[julia-users] Passing N-D Julia arrays to C functions

2016-11-04 Thread Alexander Lyapin
There is a topic: https://groups.google.com/d/msg/julia-users/EK9oNzzaoAk/kJqagPL0Ku0J However could some one give an example how to pass 3-d or 4-d array to C function. I have Array{Float64, 4} and for ccall I use Ptr{Ptr{Ptr{Ptr{Float64 as Type of parameter. Is there some way to make it m

Re: [julia-users] Passing N-D Julia arrays to C functions

2016-11-04 Thread Alexander Lyapin
i, Nov 4, 2016 at 9:22 AM, Alexander Lyapin > > wrote: > > There is a topic: > > https://groups.google.com/d/msg/julia-users/EK9oNzzaoAk/kJqagPL0Ku0J > > > > However could some one give an example how to pass 3-d or 4-d array to C > > function. > >

Re: [julia-users] Passing N-D Julia arrays to C functions

2016-11-04 Thread Alexander Lyapin
ользователь Tim Holy написал: > > ccall(sym, Void, (Ptr{Ptr{T}},), Aptrs) > > When you pass an array via `ccall`, it takes the pointer of the data, > which is why this produces a Ptr{Ptr{T}} from an Array{Ptr{T}}. > > Best, > --Tim > > On Fri, Nov 4, 2016 at 9:14 A

Re: [julia-users] Passing N-D Julia arrays to C functions

2016-11-04 Thread Alexander Lyapin
ptr1 > for i = 2:size(A)[end] > Aptr[i] = ptr1d(view(A, colons..., i)) > end > Aptr > end > ``` > > Then just pass `ptr1d(A)` as the last argument of your ccall. > > Best, > --Tim > > > On Fri, Nov 4, 2016 at 10:07 AM, Alexander Lyapin > wro

Re: [julia-users] Passing N-D Julia arrays to C functions

2016-11-21 Thread Alexander Lyapin
Thank you, for this info. I will definitely need this! пятница, 4 ноября 2016 г., 22:26:50 UTC+3 пользователь Steven G. Johnson написал: > > Note that using **double is not actually that great a way to do > multidimensional arrays in C -- way harder to do the memory management, and > also slowe

[julia-users] Passing Dictionary from Julia to C function using ccall

2016-11-21 Thread Alexander Lyapin
Is there way to pass Dictionary from Julia to C function using ccall??? I have to divide all dictionaries for subarrays and then send them to C... this is really long and leads to huge syntax. Is there way to pass whole dictionary at once? Thank you