[julia-users] Defining a type that inherits methods

2016-10-29 Thread Jérémy Béjanin
I know that it is not possible to subtype concrete types, but is it possible in some other way to create a type that behave exactly like an existing concrete type (in my case a Matrix) such that it would keep all the methods associated with it, but would still dispatch when a more specific (ie

Re: [julia-users] Parsing complex numbers

2016-10-28 Thread Jérémy Béjanin
How easy would it be to make one assuming the standard julia notation 3+4im? On Friday, October 28, 2016 at 3:58:08 PM UTC-4, Yichao Yu wrote: > > On Fri, Oct 28, 2016 at 3:53 PM, Jérémy Béjanin > <jeremy@gmail.com > wrote: > > I've noticed that parsing a string repre

[julia-users] Parsing complex numbers

2016-10-28 Thread Jérémy Béjanin
I've noticed that parsing a string representing a real number yields a real number, but parsing a string representing a complex number yields an expression that must subsequently be evaluated. Is there a reason for that behaviour? I'd like to avoid that behaviour considering I am reading

Re: [julia-users] matrix multiplications

2016-10-18 Thread Jérémy Béjanin
I know, I was asking about that being the default behaviour of * On Tuesday, October 18, 2016 at 2:10:14 PM UTC-4, Stefan Karpinski wrote: > > That's what A_mul_B! does. > > On Tue, Oct 18, 2016 at 1:45 PM, Jérémy Béjanin <jeremy@gmail.com > > wrote: > >> I t

Re: [julia-users] Recasting arrays

2016-10-18 Thread Jérémy Béjanin
Thanks, not sure how I missed that... On Tuesday, October 18, 2016 at 1:55:58 PM UTC-4, Yichao Yu wrote: > > > > On Tue, Oct 18, 2016 at 1:38 PM, Jérémy Béjanin <jeremy@gmail.com > > wrote: > >> I have seen the rem(a,b) function being used to recast nu

Re: [julia-users] matrix multiplications

2016-10-18 Thread Jérémy Béjanin
I think this is something I might have read about in the past, but are there plans to make y = a*b use an already allocated y? On Tuesday, October 18, 2016 at 12:38:00 PM UTC-4, Stefan Karpinski wrote: > > A_mul_B!(Y, A, B) -> Y > > Calculates the matrix-matrix or matrix-vector product A⋅B

[julia-users] Recasting arrays

2016-10-18 Thread Jérémy Béjanin
I have seen the rem(a,b) function being used to recast numbers, but I was wondering if there was a way to recast arrays as in C. Say, for example, that I have an array of bytes, is it possible to recast that array as UInt16, by taking pairs of bytes, or as Int32 by taking each consecutive 4

Re: [julia-users] Calling DLL function

2016-10-07 Thread Jérémy Béjanin
going through a string format and parsing. Would you have any guidance as to where in the manual I should look? On Thursday, October 6, 2016 at 8:15:41 PM UTC-4, Yichao Yu wrote: > > On Thu, Oct 6, 2016 at 5:40 PM, Jérémy Béjanin <jeremy@gmail.com > > wrote: > > Thanks!

Re: [julia-users] Calling DLL function

2016-10-06 Thread Jérémy Béjanin
Thanks! this works perfectly. The pointer_to_array() function seems to be deprecated, however, do you know how to use the suggested replacement, unsafe_wrap()? And if it's not too much to ask, I am wondering how I can do the conversion from this UInt8 buffer more efficiently. This is what I am

[julia-users] Calling DLL function

2016-10-05 Thread Jérémy Béjanin
Hello, I am trying to call a DLL function to allocate a page aligned array from julia. Here is a C++ example using that function. Note that the DLL function is wrapped into this uvAPI api, but is otherwise the same except for the name. The DLL function is called x_MemAlloc, while the API

Re: [julia-users] Algorithm performance comparison with python

2016-03-08 Thread Jérémy Béjanin
> > We currently allocate an uninitialized array and then call the bzero > function to fill it with zeros – this takes a long time for large arrays. > We should instead mmap /dev/zero since that allows the kernel to lazily > allocate pages. I suspect this is what NumPy is doing, which in this

Re: [julia-users] Algorithm performance comparison with python

2016-03-08 Thread Jérémy Béjanin
I have. I don't see anything in particular that would help me here... > >

[julia-users] Algorithm performance comparison with python

2016-03-08 Thread Jérémy Béjanin
Hello, By curiosity, I have translated a simple algorithm from python to julia in order to compare their performance (gist here ). I am still a relative newcomer and so am not sure why I am seeing worse performance from julia. The code was

[julia-users] Is build_executable.jl working?

2015-11-25 Thread Jérémy Béjanin
Hello, I was wondering if the build_executable function was working. I tried using it on Windows and got the following error (I included some lines above the error for context): ... > require.jl > docs/helpdb.jl > docs/basedocs.jl >

Re: [julia-users] Re: Reduction of multiple variables in parallel for-loop

2015-05-25 Thread Jérémy Béjanin
Thanks for the answers. Would you have a better suggestion on how to do what I want? As I explained, I am trying to fill two arrays where each array element is a function of the loop index. I realize that at the end of each loop, because the memory is not shared, each array will only have one

[julia-users] Reduction of multiple variables in parallel for-loop

2015-05-24 Thread Jérémy Béjanin
Is it possible to perform reduction on more than one variable in the case where the loop is computing more than one quantity? I tried doing something like this: var1=zeros(Float64,10,4) var2=zeros(Complex128,10,1) @parallel (+) for m=1:10 var1[m,:] = [m,2*m,3*m,4*m] var2[m] = m

[julia-users] Pre-allocation and for-loops

2015-05-21 Thread Jérémy Béjanin
In the performance tips section of the manual, it is recommended to, if convenient/possible, pre-allocate the variables used in for-loops in order to avoid unecessary allocation and garbage collection. The example given uses a function xinc(x) which returns a array . Running this function in a