Re: [julia-users] help with @generated function call please?

2016-10-15 Thread Florian Oswald
Yes I think you are right about that. Using a comprehension is just as good for my case. But part of me would like to just finally understand that part of Julia! Ok will have to wait for the next opportunity. :-) Thanks anyway. Florian On Saturday, 15 October 2016, Erik Schnetter

Re: [julia-users] help with @generated function call please?

2016-10-15 Thread Erik Schnetter
A generated function is only useful if you perform a non-trivial calculation based on the argument types. You don't do that here, so I wonder whether simply using the Cartesian indexing macros by themselves would be sufficient. Note also that you don't need to write `$N` in your code; using `N`

[julia-users] help with @generated function call please?

2016-10-14 Thread Florian Oswald
hi all, I want to evaluate a function at each index of an array. There is a N dimensional function, and I want to map it onto an N-dimensional array: fpoly(x::Array{Real,5}) = x[1] + x[2]^2 + x[3] + x[4]^2 + x[5] want to do a = rand(2,2,2,2,2); b = similar(a) for i1 in indices(a,1) for i2