[julia-users] Re: Julia vs Matlab: interpolation and looping

2016-02-03 Thread pokerhontas2k8
Thanks for the research. I also did some testing with the original code and to me it seems like the problem has nothing to do with the interpolation method but with the memory allocation. Matlab is just faster because it doesn't reallocate memory in every iteration, as you said. It also explains

[julia-users] Re: Julia vs Matlab: interpolation and looping

2016-01-30 Thread pokerhontas2k8
Ok. My original code certainly spends most of the time on looping the interpolation. In that sense, the example I post here is similar to the original code and hightlights the problem I am facing I think. Fwiw, I wrap the original code in a function. I also do it above, at least for the perform

[julia-users] Re: Julia vs Matlab: interpolation and looping

2016-01-30 Thread pokerhontas2k8
@Tomas: maybe check out Numerical Recipes in C: The Art of Scientific Computing, 2nd edition. There is also an edition for Fortran. The code that I use in C is basically from there. @Andrew: The xprime needs to be in the loop. I just made it ones to simplify but normally it changes every itera

[julia-users] Julia vs Matlab: interpolation and looping

2016-01-29 Thread pokerhontas2k8
Hi, my original problem is a dynammic programming problem in which I need to interpolate the value function on an irregular grid using a cubic spline method. I was translating my MATLAB code into Julia and used the Dierckx package in Julia to do the interpolation (there weren't some many alter

[julia-users] Re: Calling C from Julia with OpenMP (Windows)

2016-01-20 Thread pokerhontas2k8
copying the libgomp.dll into my working directory worked! Thanks! Am Mittwoch, 20. Januar 2016 03:36:54 UTC+1 schrieb Tony Kelman: > > Take a look at the libcspline3.dll in Dependency Walker. You're likely > missing a libgomp dll which you'll need to copy from your compiler > installation and p

[julia-users] Calling C from Julia with OpenMP (Windows)

2016-01-19 Thread pokerhontas2k8
Hi, I am trying to call C code from Julia.It works for 'regular' C code but now I have code that (potentially) uses OpenMP which causes trouble. I am trying to interpolate a function using a spline approximation. In short, if I type: gcc -shared -O3 nspline_omp.c -o libcspline.dll -ffast-ma

Re: [julia-users] Re: Examples of integrating Fortran code in Julia

2016-01-19 Thread pokerhontas2k8
Yes, sorry, next time I will open a new thread. I actually already have a new problem, so I am going to post that in a new thread. This particular problem here has been solved. I didn't manage to get it working with ifort (I guess there is no hope?) and with gfortran I noticed that the standar

[julia-users] Re: Examples of integrating Fortran code in Julia

2016-01-18 Thread pokerhontas2k8
Hi, first of all, I am new to Julia (and Fortran). I tried to follow OP's example and call Fortran from Julia. First, I was using the Intel Fortran compiler and tried to compile the following .f90 file (saved as f90tojl.f90) module m contains integer function five() five = 5 end fun