Thanks to everyone for the replies.
So do I understand the following correctly: if I separate my functions
and runtime code (eg MyModule and MyModuleRun), and then want to
redefine a single function in the first, then I have to reload the whole
module again?
Julia seemed so ideal for exploratory
Using JuliaParser.jl as a reference, it loks like is in the class
unary_and_binary_ops, as well as syntactic_binary_ops. The | operator is
not in either of these classes. At least one reason for the difference in
lowering to the AST is that is also an addressof-like operator in the
context
So the only the global name space is for tinkering (iterative,
interactive development), and modules are for more-or-less stable code
--- is this correct?
Is this an inherent feature of the architecture of Julia, or can one
expect this to change as issues (especially #265) are resolved?
Best,
Hi,
Does anyone now how to free up the memory in a XMLElement object in
LightXML.jl?
LightXML.jl has a free(xdoc::XMLDocument) but no corresponding
free(xelem::XMLElement). There are functions related to free in clib.jl in
the package but no docs that I can find on how to use it. I tried to
You can redefine a function like this:
function MyModule.myfunction(args...)
stuff
end
Two caveats:
- myfunction has to already exist in MyModule for this to work---you can't add
new names to an already-closed module.
- Anything that has already been compiled and uses myfunction won't
Is there any Julia function for computing the eigenvalues of a large,
sparse, hermitian matrix M? I have tried eig(M) and eigvals(M) and got the
no method error.
//A
Suppose I have a trivial module
module Foo
x = 1
end
so names(Foo) now includes a Symbol that is === to symbol(x). I have
two questions:
1. How can I intern symbols into a module programatically, possibly from
outside the module? symbol(Foo.y) does not work (using 3.5).
2. Similarly, how can I
You can use eigs. Usually, you only ask for a few of the values, but in
theory, you could get all of them, but it could take some time to compute
them.
2015-01-26 9:40 GMT-05:00 Andrei Berceanu andreiberce...@gmail.com:
Is there any Julia function for computing the eigenvalues of a large,
The underlying XMLNode needs to be freed using xmlFreeNode from libxml2:
http://xmlsoft.org/html/libxml-tree.html#xmlFreeNode
I don't think this is wrapped yet, but it should be straightforward to add
-- ideally, called via a finalizer so that the objects are freed
automatically when Julia
Not exactly what you're asking for, but code in the test/ folder is also often
a frequent source of inspiration, since it shows how to use the code.
--Tim
On Sunday, January 25, 2015 11:32:20 PM tuguldu...@gmail.com wrote:
yes, I saw those. What I am looking for is source code that implemented
1. That's my matlab code, I was hoping to be able to write it with loops
in Julia, because sometimes these vectorize operations can become
a real headache, but it's maybe hopeless to try to beat these highly
optimized libraries.
function alpha =
I did set up Julia in a docker container. When I run it from the shell
everything works just fine. However, when I start the shell inside of
emacs, I can run the docker container and start Julia, but it somehow
messes with the output:
Besides, the help of eigs says using Lanczos or Arnoldi iterations for
real symmetric or general nonsymmetric matrices respectively. Mine is
hermitian, i.e. complex and symmetric.
On Monday, January 26, 2015 at 4:02:16 PM UTC+1, Andrei Berceanu wrote:
That seems to return a lot of things
Actually this diff better shows the proposed changes:
https://github.com/robertfeldt/LightXML.jl/commit/238fbb5c41629e254088dfe7553a53c72bd5dffa
Will test and see if it helps.
/Robert
Den måndag 26 januari 2015 kl. 17:36:47 UTC+1 skrev Robert Feldt:
Ok, great. I'm not used to explicit mem
Maybe llvm has now turned on code relocation on MachO? If so, I just need
to flip a switch in the code to fix this.
On Mon, Jan 26, 2015 at 3:30 AM Luthaf lut...@luthaf.fr wrote:
I am using the latest master, on OS X 10.9, with LLVM svn
julia versioninfo()
Julia Version 0.4.0-dev+2914
Commit
Omg, I forgot to remove it! I should proof-read my code more carefully
before posting... Julia is now 5x faster than matlab.
Where is the API for this functionality exposed, so that eg ESS could
make use of it? For example, how would one eval or define new functions
into a module in the REPL?
Best,
Tamas
On Mon, Jan 26 2015, Mike Innes mike.j.in...@gmail.com wrote:
It's not an inherent feature of Julia, no, just a
On Mon, Jan 26, 2015 at 10:44 AM, Yuuki Soho yu...@vivaldi.net wrote:
Julia is now 5x faster than matlab.
Win.
Yes. There is some extra output including convergence information and the
Ritz vectors. It should probably be explained in the manual, but the first
argument is the values. You can avoid the vectors with ritzvec=false, so
something like
eigs(A, ritzvec = false)[1]
should give you the largest (in
Indeed it seems to work with complex matrices as well. What would be very
useful for me is the ability to get eigenvalues within a certain interval,
emin to emax. I dont see this in the capabilities of eigs.
//A
On Monday, January 26, 2015 at 4:21:58 PM UTC+1, Andreas Noack wrote:
Yes. There
That seems to return a lot of things besides the eigenvalues.
On Monday, January 26, 2015 at 3:43:01 PM UTC+1, Andreas Noack wrote:
You can use eigs. Usually, you only ask for a few of the values, but in
theory, you could get all of them, but it could take some time to compute
them.
Ok, great. I'm not used to explicit mem management from Julia so appreciate
feedback on proposed solution:
function free(xelem::XMLElement)
ccall(xmlFreeNode, Void, (Ptr{Void},), xelem.node.ptr)
xelem.node.ptr = nullptr
end
since XMLElement type has a node::XMLNode attribute and the XMLNode
It's not an inherent feature of Julia, no, just a tooling thing. Juno, for
example, will allow you to eval directly into modules just fine, including
defining new functions, replacing them, evalling `include`s, and replacing
the module wholesale in order to get around type redefinition issues and
Hi,
Everyone seems to agree on the same workflow, so I'll just mention my
workflow as an alternative.
Pros:
- don't need any Julia REPL restarts
- don't need to prepend module name in (interactive) code.
- variables, data structures etc all are retained during development.
Cons:
- in
Jewel.jl handles all the code analysis/eval related stuff. I don't know ESS
that well but it shouldn't be hard to make use of it if someone wants to.
In a nutshell it's basically as simple as calling `eval(Base, :(foo() =
1))`, but there's a few other things to think about like making sure Julia
`quote ... end` (or `:(...)` for shorthand) can be used to create
expression objects that are equivalent when eval'd to executing the
expression directly. from there, you can explore the resulting Expr tree
with dump() and Meta.show_sexpr() to observe the correct expression tree.
you can convert
OK, but I still don't know how to unintern a symbol. This is not
mentioned in the manual.
On Mon, Jan 26 2015, Jameson Nash vtjn...@gmail.com wrote:
`quote ... end` (or `:(...)` for shorthand) can be used to create
expression objects that are equivalent when eval'd to executing the
expression
There is a FAQ entry on this which suggests not to use types each of
elements of the enum (if I recall correctly).
I recently did a enum like this:
export nonstiff, mildlystiff, stiff
abstract Enum
immutable Stiff : Enum
val::Int
function Stiff(i::Integer)
@assert 0=i=2
On Monday, January 26, 2015 at 7:20:54 PM UTC+1, Francesco Bonazzi wrote:
A Mathematica parser could be used as an optional addition, such as what
Mathics is to SymPy.
Anyways, there are various options for Julia:
- use Expr and operate on them, this is similar to how Maxima works.
@Andreas: do you refer to this thread:
https://groups.google.com/forum/#!topic/julia-users/Kwy2Zh-i4ks
Yes, it's an option. I was looking for something specifically designed for
this purpose, but seems like Scikit Image and some others keep exactly the
approach you've described [1], so I
This should work:
help? sort
Base.sort(A, dim, [alg=algorithm,] [by=transform,]
[lt=comparison,] [rev=false])
Sort a multidimensional array A along the given dimension.
julia sort(Vector{Int}[[1,2], [1,2,3]], lt=(x,y)-(length(x)length(y)) )
2-element Array{Array{Int64,1},1}:
[1,2,3]
[1,2]
We definitely need a standard solution to this in Base Julia. We may have
enough example use cases at this point to know what it needs to look like.
Relevant issue: https://github.com/JuliaLang/julia/issues/3080
On Mon, Jan 26, 2015 at 3:11 PM, Mauro mauro...@runbox.com wrote:
There is a FAQ
The matrix is 1681x1681 with 8240 non-zero entries (i.e. 0.29% non-zero).
I'm not sure how this relates to your second comment though :)
On Monday, January 26, 2015 at 5:48:37 PM UTC+1, Andreas Noack wrote:
How large is the matrix and what is the sparsity?
You might be able to get closer to
Hello Jim,
Thanks for the long response. I looked at the papers; I think they are
worth studying. I found that I can progress most quickly modeling on
Mathematica. The design is fairly simple and consistent. Of course the
documentation is vague in some places, but so far, it is not a problem.
Hey all. I have frequently been in the position of wanting enumerations in
Julia. I have finally settled on the implementation linked below which lets
me refer to flags
in a named way and only specify their underlying numbering once. Is this
the best way, or are there better ways I haven't
I'm trying to construct a list of list and do some operation on it. In
Python I would do
In [7]: ll = [[1,2],[1,2,3],[7]]
Say I want to sort them by the length of the list, many function accepts a
`key` parameter. In this case I want the `key` to be `len`.
In [8]: max(ll, key=len)
Out[8]: [1,
On Monday, January 26, 2015 at 12:09:40 PM UTC-5, Joshua Adelman wrote:
On Monday, January 26, 2015 at 12:02:10 PM UTC-5, Wai Yip Tung wrote:
I'm trying to construct a list of list and do some operation on it. In
Python I would do
In [7]: ll = [[1,2],[1,2,3],[7]]
Say I want to sort
On Monday, January 26, 2015 at 6:11:33 PM UTC+1, lapeyre@gmail.com
wrote:
Another resource is Richard Fateman's mma4max
http://www.cs.berkeley.edu/~fateman/lisp/mma4max/, which I see has
updates since I last built it. It aims more or less to implement mma in
common lisp. In fact
(My posts are not appearing where I want. Hope this one does!)
On Monday, January 26, 2015 at 6:57:48 PM UTC+1, James Crist wrote:
Maybe the parser could be useful if rewritten in Julia:
Side tracking a bit, but one of the reasons I use SymPy instead of
something like Maxima is that it
On Monday, January 26, 2015 at 12:02:10 PM UTC-5, Wai Yip Tung wrote:
I'm trying to construct a list of list and do some operation on it. In
Python I would do
In [7]: ll = [[1,2],[1,2,3],[7]]
Say I want to sort them by the length of the list, many function accepts a
`key` parameter. In
Hi,
I'm running Julia 0.3.5 and I have some tree structures with nodes pointing
to both parents and children. I want to serialize/deserialize these
to/from file storage, but the serialize function gives a long string of
errors (longer than the length of my shell output buffer), so I'm
This behaviour is intended and as I understand it a relic from Matlab
(where you can't have arrays of arrays). It is the basis for a convenient
array construction from a range (eg, [1:5] gives [1,2,3,4,5] instead of an
array with a Range object), so there are more to it than you might think.
You need to use
()([true,true], [true,false],[false,true])
I think this is because is used as a special character in ccall. I have
seen this raised a few times, but I don't know what to search for to find
the previous discussions.
Regards Ivar
mandag 26. januar 2015 15.33.06 UTC+1 skrev
If I understand correctly, this may improve
soon: https://github.com/JuliaLang/julia/pull/9913#issuecomment-71341494
On Monday, January 26, 2015 at 12:53:33 PM UTC-5, Ivar Nesje wrote:
You need to use
()([true,true], [true,false],[false,true])
I think this is because is used as a
I fixed the typo (should be finalizer and not finalize) and also had to
import xmlFreeNode from the c lib but when I run I get:
julia(56167,0x7fff7924c300) malloc: *** error for object 0x7f9a33b159c0:
pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
so
Hi!
I've just tried the Match.jl package and it works just as expected. But now
my program needs 10 extra seconds to start, even if the code using the
@match macro is untouched. Is there anyway to cache the generated code?
If I understand the docs correctly this only works if I move the code
On Monday, January 26, 2015 at 6:11:33 PM UTC+1, lapeyre@gmail.com
wrote:
I found that I can progress most quickly modeling on Mathematica. The
design is fairly simple and consistent. Of course the documentation is
vague in some places, but so far, it is not a problem. Of course, even
Maybe the parser could be useful if rewritten in Julia:
Side tracking a bit, but one of the reasons I use SymPy instead of
something like Maxima is that it meshes seamlessly into the language
infrastructure. By writing a parser and creating another system means that
it can't use julia's
Hey everyone,
I'm trying to use @cpp ccall() to call myfunc() in a custom shared library
I wrote in C++, and I noticed there is some overhead if I put the @cpp
ccall inside a function.
The relevant portion of my Julia code:
# mypath is a constant string type that specifies the path of my
That would certainly explain it – the @cpp version probably needs to do a
fair amount of LLVM code generation, whereas `ccall` is built into the
language.
On Mon, Jan 26, 2015 at 4:59 PM, Ivar Nesje iva...@gmail.com wrote:
Did you time your function twice? The first time you call a function it
Ok now that you have put it there, the comments in the documentation make
more sense to me. It looks like both yours and mine are essentially
equivalent, but yours is simpler. I was aiming for the following behavior
with my implementation:
- different enum types won't typecheck (can't do if
Hi there,
Recently I run into this very interesting post:
http://www.johnmyleswhite.com/notebook/2013/12/06/writing-type-stable-code-in-julia/
Surprisingly, when tested both examples against the latest 0.4 build - the
speed difference of the type-stable version is only 2-3 times faster then
Is there any way I can have the code for Garch in Mean or GarchM please
Thank you..
On behalf of the organizing committee, it is my pleasure to announce that
JuliaCon 2015 will be held at the MIT Stata Center during the dates of
Wednesday, June 24 through Sunday, June 28.
More details forthcoming. We look forward to seeing you in Cambridge,
Massachusetts six months from now,
This is a performance regression, also for 0.3.5. My timings for 0.3.5:
julia @time [sumofsins1(100_000) for i in 1:100];
elapsed time: 0.446675737 seconds (320109932 bytes allocated, 21.32% gc time)
julia @time [sumofsins2(100_000) for i in 1:100];
elapsed time: 0.115537618 seconds (896 bytes
I'm not sure where the malloc error is coming from, exactly, but you need
to call finalizer, not finalize. Also it should be run on the XMLNode
rather than the XMLElement.
The following example might help (at least, it doesn't crash!)
julia n = new_textnode(s)
s
julia finalizer(n, z::XMLNode -
Perfect, it works. Thanks a lot!
I now run a shell in emacs, run a docker container in the shell, and julia
in the container, and I connect to it with M-x ess-remote. However, I also
guess that using emacs tramp should be a better approach, as the ESS manual
says:
The recommended way to
This is the other thread:
https://groups.google.com/forum/#!searchin/julia-users/simple$20IO/julia-users/MRjELN0Zzlk/TM57aTp9w6wJ
On Mon, Jan 26, 2015 at 9:39 PM, alex codoreanu alex.codore...@gmail.com
wrote:
Hi Kyle,
I have the same issue but I can't find the solution you found in a
Hello colleagues,
i think you could do (if i get the upper description correctly) just setup
a grid of points and feed it through something like inpolygon - might be
not the optimized case, but should work. There have been questions about
that here (i know, because i posted code) before.
But
I am using the latest master, on OS X 10.9, with LLVM svn
julia versioninfo()
Julia Version 0.4.0-dev+2914
Commit 4c3e03b (2015-01-26 06:17 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.4.0)
CPU: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
WORD_SIZE: 64
BLAS: libopenblas
Coming back to my original problem, I did a simplified version of it,
which is about 10x slower than a vectorized matlab version. Have I missed
anything here ?
A = ones(50,40,40);
B = ones(50,100)/2;
C = ones(40,100)/3;
D = ones(40,100)/4;
E = ones(100,100)/5;
idx = int([100:-1:1]);
Thanks guys,
I think that was it.
On Monday, 26 January 2015 16:59:54 UTC-5, Ivar Nesje wrote:
Did you time your function twice? The first time you call a function it
needs to be compiled, and for very small tests, that process will dominate.
On Monday, 26 January 2015 08:26:24 UTC-5, Christian Groll wrote:
I did set up Julia in a docker container. When I run it from the shell
everything works just fine. However, when I start the shell inside of
emacs, I can run the docker container and start Julia, but it somehow
messes with
That is not a large matrix. I'd densify it and use eigvals(Hermitian, vl,
vu) on it, where vl and vu are the bounds on the eigenvalues. E.g.
julia A = complex(randn(1681,1681), randn(1681, 1681));A = A + A';
julia eigvals(Hermitian(A), 5.0, 10.0)
31-element Array{Float64,1}:
5.26302
Did you time your function twice? The first time you call a function it needs
to be compiled, and for very small tests, that process will dominate.
65 matches
Mail list logo