[julia-users] Address of variable

2014-08-08 Thread Gerry Weaver
Hello All, I've got a couple of c functions that I'm trying to call. The first one returns a void pointer and the second one expects the address of that pointer as an argument. This would be accomplished in c via the operator. How do I get the address of a variable in Julia? I've tried using

Re: [julia-users] Address of variable

2014-08-08 Thread Jey Kottalam
Hi Gerry, You're probably looking for Julia's operator, or possibly the unsafe_pointer_from_objref method (unlikely). Note that works different in Julia than in C. The full documentation for calling C and Fortran code is available at

Re: [julia-users] Re: question about array comparison

2014-08-08 Thread Gunnar Farnebäck
1. As in Ethan's response (modulo a trivial bug): Matrix[x[k,:] for k=1:size(x,1)] Depending on how well typed the result needs to be, the leading 'Matrix' can be dropped or be made more specific. 2. I wouldn't say so but opinions vary depending on mathematical and programming language

Re: [julia-users] Address of variable

2014-08-08 Thread Gerry Weaver
Hi Jey, Oh Man. I guess it's time to call it a night. I've read that doc a couple of times and completely missed the . Thanks for your help and sorry for the noise. Thanks, -G On Friday, August 8, 2014 1:08:42 AM UTC-5, Jey Kottalam wrote: Hi Gerry, You're probably looking for Julia's

[julia-users] Idea: Compile Julia programs into binaries

2014-08-08 Thread Daniel Carrera
Hello everyone, Here is a possibly crazy idea: Since Julia is already a compiled language, how difficult would it be to have Julia produce an actual stand-alone binary? I am not sure how useful this would be. It could be used to distribute Julia programs without requiring users to install

[julia-users] Re: Idea: Compile Julia programs into binaries

2014-08-08 Thread Tobias Knopp
Hi Daniel, There were various dicussions in julia-dev and julia-users. Searching for standalone should give you some answers. In short: Its on the roadmap, it is definately feasible, there is even work beeing done in one of Jeffs branches, but my guess is that this will not land in the next

[julia-users] Coverage confusion

2014-08-08 Thread Magnus Lie Hetland
How is --code-coverage supposed to work, exactly? In my code, I seem to generally either get nonzero counts or -, marking lines that *shouldn't* be counted? Or *couldn't*? Either way, I'm not really getting any information about the percentage of code covered, unless I manually inspect it and

Re: [julia-users] Coverage confusion

2014-08-08 Thread Tim Holy
https://github.com/JuliaLang/julia/issues/7541 On Friday, August 08, 2014 02:23:22 AM Magnus Lie Hetland wrote: How is --code-coverage supposed to work, exactly? In my code, I seem to generally either get nonzero counts or -, marking lines that *shouldn't* be counted? Or *couldn't*? Either

Re: [julia-users] Re: help with improving performance of a matrix multiplication

2014-08-08 Thread Tim Holy
Did you already try devectorizing the computation? stemp * v0[(n*(i-1)) + (1:n)] allocates memory, which is bad. (Does ProfileView show a red bar at this line?) You want to write that loop as for i in 1:m, j = 1:n v1[m*(j-1) + i] = stemp * v0[n*(i-1) + j] end --Tim On Friday,

Re: [julia-users] Re: Idea: Compile Julia programs into binaries

2014-08-08 Thread Daniel Carrera
Thanks! On 8 August 2014 10:44, Tobias Knopp tobias.kn...@googlemail.com wrote: Hi Daniel, There were various dicussions in julia-dev and julia-users. Searching for standalone should give you some answers. In short: Its on the roadmap, it is definately feasible, there is even work beeing

Re: [julia-users] Re: help with improving performance of a matrix multiplication

2014-08-08 Thread Florian Oswald
Hi Tim, that *did* make a massive difference. in my test I went from 62 secs to 12 secs. just for completeness, your snippet was missing that stemp is a matrix, so now looks like this: for i in 1:m, j=1:n vtmp = 0.0 for ji=1:n vtmp += stemp[j,ji] * v0[n*(i-1) + ji] end v1[m*(j-1) + i] = vtmp

Re: [julia-users] Coverage confusion

2014-08-08 Thread Magnus Lie Hetland
Thanks!

Re: [julia-users] Best way to generate random variables from the same family with different parameters?

2014-08-08 Thread Gabriel Mitchell
I agree that if the intended use is limited to getting a random value one time then Johan's solution looks really nice. However, if you wanted to make the same call several times throughout your code and/or to compute other statistical quantities of interest it might be worth thinking about

Re: [julia-users] Re: Idea: Compile Julia programs into binaries

2014-08-08 Thread Stefan Karpinski
This is not a crazy idea at all – it's just something that most dynamic languages are not in good shape to do. It's definitely something we want and that a fair amount of work has already gone into. On Fri, Aug 8, 2014 at 7:09 AM, Daniel Carrera dcarr...@gmail.com wrote: Thanks! On 8 August

Re: [julia-users] Re: help with improving performance of a matrix multiplication

2014-08-08 Thread Stefan Karpinski
If you need the previous array while doing this update, the classic way to avoid allocation is to allocate a single temporary work array and then go back and forth between the original array and the work array. This is common for stencil computations that can't be done in-place. On Fri, Aug 8,

[julia-users] Segfault when looking up a symbol in a dynamic library

2014-08-08 Thread Douglas Bates
I am experimenting with calling IBM's Watson Sparse Matrix Package (WSMP) from Julia. This is not Open Source software. It is shipped as a library. The evaluation version is a static library but the author was kind enough to send me a dynamic library for Linux. I was able to compile, link

Re: [julia-users] Strange LLVM error

2014-08-08 Thread yaoismyhero
Hi Keno, So there was no lag or huge delay for you for the unpack function? I am using a Mac OSX 10.9.4 system, Julia 0.3.0-RC1. If you change nMCMC to 500, that should allow the algorithm to reach unpack function in a reasonable amount of time while still having too long of a pararray to

Re: [julia-users] Strange LLVM error

2014-08-08 Thread yaoismyhero
A workaround for this I found was, rather than appending to an array and then unpacking the array, to create arrays of zeros for each parameter, and then filling the arrays at each iteration. Perhaps that tidbit could clue someone in on what the problem is -- unfortunately, I do not have enough

Re: [julia-users] Strange LLVM error

2014-08-08 Thread yaoismyhero
Hmm, so there was not even lag before the unpack? If you don't mind my asking, what system are you running on? Specifically, I am running on a Macbook Pro OSX 10.9.4 with a 2.6 GHz Intel Core i7 and 16GB of ram 1600 MHz DDR3, which should be enough for a task like this. Nonetheless, because of

Re: [julia-users] Strange LLVM error

2014-08-08 Thread Keno Fischer
I ran your second code yesterday and it finished eventually without any problem. On Fri, Aug 8, 2014 at 1:00 PM, yaoismyh...@gmail.com wrote: Hi Keno, So there was no lag or huge delay for you for the unpack function? I am using a Mac OSX 10.9.4 system, Julia 0.3.0-RC1. If you change nMCMC

[julia-users] Re: Segfault when looking up a symbol in a dynamic library

2014-08-08 Thread Douglas Bates
Strangely, I can get the symbol if I first get a handle with dlopen julia const libwsmp = Pkg.dir(MixedModels,deps, usr, lib, libwsmp64.so) /home/bates/.julia/v0.3/MixedModels/deps/usr/lib/libwsmp64.so julia tt = dlopen(libwsmp) Ptr{Void} @0x03488090 julia typeof(tt) Ptr{None} julia

[julia-users] Re: Segfault when looking up a symbol in a dynamic library

2014-08-08 Thread Douglas Bates
Now that I have read the documentation it is not really so strange because that docs say that the first argument should be a handle. So never mind.

Re: [julia-users] Segfault when looking up a symbol in a dynamic library

2014-08-08 Thread Jameson Nash
Can you open an issue that dlsym should be sanitizing its inputs better? On Friday, August 8, 2014, Douglas Bates dmba...@gmail.com wrote: Now that I have read the documentation it is not really so strange because that docs say that the first argument should be a handle. So never mind.

Re: [julia-users] Segfault when looking up a symbol in a dynamic library

2014-08-08 Thread Jake Bolewski
Yes, dlsym accepts any input and just segfaults if it is not a valid file handle. On Friday, August 8, 2014 1:58:08 PM UTC-4, Jameson wrote: Can you open an issue that dlsym should be sanitizing its inputs better? On Friday, August 8, 2014, Douglas Bates dmb...@gmail.com javascript: wrote:

Re: [julia-users] Re: question about array comparison

2014-08-08 Thread Steven G. Johnson
On Friday, August 8, 2014 3:19:00 AM UTC-4, Gunnar Farnebäck wrote: 1. As in Ethan's response (modulo a trivial bug): Matrix[x[k,:] for k=1:size(x,1)] Depending on how well typed the result needs to be, the leading 'Matrix' can be dropped or be made more specific. You could also just

[julia-users] Re: Stiff ODE solver available now?

2014-08-08 Thread Frederick
Show trimmed content In Step 4, three times. First using Sundials, then in Simulate 60 seconds at rest..., then in Apply stimulus You can also search for Sundials in the UNtrimmed content.

[julia-users] Re: Stiff ODE solver available now?

2014-08-08 Thread Frederick
In Jun 19th post, show the trimmed content. Sundails is called twice in Step 4, after initializing with using Sundials. First call is in Simulate 60 seconds at rest Second call is then in Apply stimulus You can also search for Sundials in the UNtrimmed content.

[julia-users] Using Base.count()

2014-08-08 Thread Frederick
In the documentation: count(*p*, *itr*) → Integer Count the number of elements in itr for which predicate p is true. x = count(c-(c==A), ACTGA) print(x) gives the string ACTGA, when expected 2 Am I missing something, or is the documentation incorrect? Also, a quick side question: How

Re: [julia-users] Using Base.count()

2014-08-08 Thread Kevin Squire
Hi Fredrick, On Fri, Aug 8, 2014 at 4:04 PM, Frederick fpmennin...@hotmail.com wrote: In the documentation: count(*p*, *itr*) → Integer Count the number of elements in itr for which predicate p is true. x = count(c-(c==A), ACTGA) print(x) gives the string ACTGA, when expected 2 Am I

Re: [julia-users] Using Base.count()

2014-08-08 Thread Frederick
Thanks Kevin, Yes, I had redefined count. #function count(chr) ## determines complement ## where A - C; C - A; G - T; T - G ## takes chr (from string), returns str #if string(chr) == A #return 1 #elseif string(chr) == C #return 2 #elseif