Created
August 25, 2018 21:42
-
-
Save axsk/748cfd41a529c9c9b76d23c1a10da93d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sundials | |
function test1() | |
yS0 = [1. 2. 3.; 4. 5 6] | |
N, Ns = size(yS0) | |
GC.@preserve yS0n = [Sundials.NVector(yS0[:,j]) for j=1:Ns] # array of julia wrappers | |
GC.@preserve yS0nv = [Sundials.N_Vector(n) for n in yS0n] # array of pointers to sund. structs | |
pyS0 = pointer(yS0nv) | |
@show ps = unsafe_wrap(Array, pyS0, Ns) | |
@show a = Sundials.asarray(ps[1]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this segfaults
adding a @show in front of line 8 makes it run through...