diff --git a/examples/cvode_Roberts_dns.jl b/examples/cvode_Roberts_dns.jl index 485f9c31..acb0b7eb 100644 --- a/examples/cvode_Roberts_dns.jl +++ b/examples/cvode_Roberts_dns.jl @@ -1,71 +1,35 @@ - -using Sundials +using Sundials, Compat ## f routine. Compute function f(t,y). -function f(t, y, ydot, user_data) - y = Sundials.asarray(y) - ydot = Sundials.asarray(ydot) +function f(t, y_nv, ydot_nv, user_data) + y = convert(Vector, y_nv) + ydot = convert(Vector, ydot_nv) ydot[1] = -0.04*y[1] + 1.0e4*y[2]*y[3] ydot[3] = 3.0e7*y[2]*y[2] ydot[2] = -ydot[1] - ydot[3] - return Int32(0) + return Sundials.CV_SUCCESS end ## g routine. Compute functions g_i(t,y) for i = 0,1. -function g(t, y, gout, user_data) - y = Sundials.asarray(y) - gout = Sundials.asarray(gout, (2,)) +function g(t, y_nv, gout_ptr, user_data) + y = convert(Vector, y_nv) + gout = Sundials.asarray(gout_ptr, (2,)) gout[1] = y[1] - 0.0001 gout[2] = y[3] - 0.01 - return Int32(0) + return Sundials.CV_SUCCESS end ## Jacobian routine. Compute J(t,y) = df/dy. - -# Using StrPack -# -- it works -# -- it's clunky and dependent on Sundials version -# Note: this is for Sundials v 2.4; the structure changed for v 2.5 -# Because of this, I'm commenting this out. -## using StrPack -## @struct type J_DlsMat -## typ::Int32 -## M::Int32 -## N::Int32 -## ldim::Int32 -## mu::Int32 -## ml::Int32 -## s_mu::Int32 -## data::Ptr{Float64} -## ldata::Int32 -## cols::Ptr{Ptr{Float64}} -## end -# Note: Here is the (untested) structure for v 2.5 -## using StrPack -## @struct type J_DlsMat -## typ::Int32 -## M::Int -## N::Int -## ldim::Int -## mu::Int -## ml::Int -## s_mu::Int -## data::Ptr{Float64} -## ldata::Int -## cols::Ptr{Ptr{Float64}} -## end - -# The following works if the code above is uncommented. -function Jac(N, t, y, fy, Jptr, user_data, - tmp1, tmp2, tmp3) - y = Sundials.asarray(y) - dlsmat = unpack(IOString(pointer_to_array(convert(Ptr{UInt8}, Jptr), - (sum(map(sizeof, J_DlsMat.types))+10,))), - J_DlsMat) - J = pointer_to_array(unsafe_ref(dlsmat.cols), (int(neq), int(neq)), false) +# broken -- needs a wrapper from Sundials._DlsMat to Matrix and Jac user function wrapper +function Jac(N, t, ny, fy, Jptr, user_data, tmp1, tmp2, tmp3) + y = convert(Vector, ny) + dlsmat = unpack(IOString(@compat unsafe_wrap(convert(Ptr{UInt8}, Jptr), + (sum(map(sizeof, Sundials._DlsMat))+10,), false)), + Sundials._DlsMat) + J = @compat unsafe_wrap(unsafe_ref(dlsmat.cols), (Int(neq), Int(neq)), false) J[1,1] = -0.04 J[1,2] = 1.0e4*y[3] J[1,3] = 1.0e4*y[2] @@ -73,42 +37,40 @@ function Jac(N, t, y, fy, Jptr, user_data, J[2,2] = -1.0e4*y[3] - 6.0e7*y[2] J[2,3] = -1.0e4*y[2] J[3,2] = 6.0e7*y[2] - return Int32(0) + return Sundials.CV_SUCCESS end -neq = 3 +const neq = 3 -t0 = 0.0 -t1 = 0.4 -tmult = 10.0 -nout = 12 -y = [1.0,0.0,0.0] -reltol = 1e-4 -abstol = [1e-8, 1e-14, 1e-6] +const t0 = 0.0 +const t1 = 0.4 +const tmult = 10.0 +const nout = 12 +const y0 = [1.0, 0.0, 0.0] +const reltol = 1e-4 +const abstol = [1e-8, 1e-14, 1e-6] cvode_mem = Sundials.CVodeCreate(Sundials.CV_BDF, Sundials.CV_NEWTON) -flag = Sundials.CVodeInit(cvode_mem, f, t0, y) -flag = Sundials.CVodeSVtolerances(cvode_mem, reltol, abstol) -flag = Sundials.CVodeRootInit(cvode_mem, 2, g) -flag = Sundials.CVDense(cvode_mem, neq) -## flag = Sundials.CVDlsSetDenseJacFn(cvode_mem, Jac) # works, but clunky, see above +Sundials.@checkflag Sundials.CVodeInit(cvode_mem, f, t0, y0) +Sundials.@checkflag Sundials.CVodeSVtolerances(cvode_mem, reltol, abstol) +Sundials.@checkflag Sundials.CVodeRootInit(cvode_mem, 2, g) +Sundials.@checkflag Sundials.CVDense(cvode_mem, neq) +#Sundials.@checkflag Sundials.CVDlsSetDenseJacFn(cvode_mem, Jac) iout = 0 tout = t1 +const t = [t0] -rootsfound = round(Int32,[0, 0]) -t = [t0] - -while true +while iout < nout + y = similar(y0) flag = Sundials.CVode(cvode_mem, tout, y, t, Sundials.CV_NORMAL) - println("T = ", tout, ", Y = ", y) + println("T=", tout, ", Y=", y) if flag == Sundials.CV_ROOT_RETURN - flagr = Sundials.CVodeGetRootInfo(cvode_mem, pointer(rootsfound)) - println("roots = ", rootsfound) - end - if flag == Sundials.CV_SUCCESS + rootsfound = zeros(Cint, 2) + Sundials.@checkflag Sundials.CVodeGetRootInfo(cvode_mem, rootsfound) + println("roots=", rootsfound) + elseif flag == Sundials.CV_SUCCESS iout += 1 tout *= tmult end - if iout == nout break end end diff --git a/examples/cvode_Roberts_simplified.jl b/examples/cvode_Roberts_simplified.jl index aa9aa252..46cba7db 100644 --- a/examples/cvode_Roberts_simplified.jl +++ b/examples/cvode_Roberts_simplified.jl @@ -6,7 +6,11 @@ function f(t, y, ydot) ydot[1] = -0.04*y[1] + 1.0e4*y[2]*y[3] ydot[3] = 3.0e7*y[2]*y[2] ydot[2] = -ydot[1] - ydot[3] - return(Int32(0)) + return Sundials.CV_SUCCESS end -t = [0.0; 4 * logspace(-1., 7., 9)] -res = Sundials.cvode(f, [1.0, 0.0, 0.0], t) + +const t = [0.0; 4 * logspace(-1., 7., 9)] +const y0 = [1.0, 0.0, 0.0] +res = Sundials.cvode(f, y0, t) + +ts1, res3 = Sundials.cvode_fulloutput(f, y0, [0.0, 1.0]) diff --git a/examples/ida_Cable.jl b/examples/ida_Cable.jl index 9f43c132..5afde64f 100644 --- a/examples/ida_Cable.jl +++ b/examples/ida_Cable.jl @@ -15,35 +15,35 @@ using Grid ## for interpolating grids ## ## Length of cable in um -L = 4000 +const L = 4000 ## Number of space steps to simulate -dx = 10 -xsteps = round(Int,L/dx) +const dx = 10.0 +const xsteps = round(Int, L/dx) ## Number of timesteps to simulate -tf = 10.0 -dt = 0.1 -timesteps = round(Int, tf/dt) -t = 0.0:dt:(dt*(timesteps-1)) +const tf = 10.0 +const dt = 0.1 +const timesteps = round(Int, tf/dt) +const t = collect(0.0:dt:(dt*(timesteps-1))) -d = 4.0 * 1e-4 ## Cable diameter in cm -R_m = 2.5e11 ## Membrane resistance in Ohms/cm^2 -G_m = 1.0/R_m ## Membrane conductance -R_i = 30.0 ## Longitudinal resistivity in Ohms*cm -C_m = 1e-6 ## Membrane capacitance in F/cm^2 +const d = 4.0 * 1e-4 ## Cable diameter in cm +const R_m = 2.5e11 ## Membrane resistance in Ohms/cm^2 +const G_m = 1.0/R_m ## Membrane conductance +const R_i = 30.0 ## Longitudinal resistivity in Ohms*cm +const C_m = 1e-6 ## Membrane capacitance in F/cm^2 ## Define the injected current J -J = zeros(timesteps,xsteps) -I_in = 0.1 +const J = zeros(timesteps, xsteps) +const I_in = 0.1 ## When to start injecting current -I_delay = 1.0 +const I_delay = 1.0 ## Duration of injected current -I_dur = 5.0 +const I_dur = 5.0 J[max(1,round(Int,(I_delay)/dt)):round(Int,(I_delay+I_dur)/dt),round(Int,1*xsteps/2)] = I_in -G_J = map(i -> CoordInterpGrid(t, vec(J[:,i]), 0.0, InterpQuadratic),1:xsteps) +const G_J = map(i -> CoordInterpGrid(t, vec(J[:,i]), 0.0, InterpQuadratic),1:xsteps) ## @@ -53,7 +53,6 @@ G_J = map(i -> CoordInterpGrid(t, vec(J[:,i]), 0.0, InterpQuadratic),1:xsteps) ## function cableres(t, u, up, r) - r[:] = u ## Initialize r to u, to take care of boundary equations. ## Loop over segments; set res = up - (central difference). @@ -65,12 +64,11 @@ function cableres(t, u, up, r) end - return (0) + return Sundials.CV_SUCCESS end function initial() - u = zeros(xsteps) u[2:xsteps-2] = -60.0 ## initial value -60 mV @@ -86,45 +84,35 @@ function initial() up[:] = -1.0 * r return (u,up,id) - end -nvector = Sundials.nvector function idabandsol(f::Function, y0::Vector{Float64}, yp0::Vector{Float64}, id::Vector{Float64}, t::Vector{Float64}; reltol::Float64=1e-4, abstol::Float64=1e-6) neq = length(y0) mem = Sundials.IDACreate() - flag = Sundials.IDAInit(mem, cfunction(Sundials.idasolfun, Int32, - (Sundials.realtype, Sundials.N_Vector, Sundials.N_Vector, Sundials.N_Vector, Ref{Function})), - t[1], nvector(y0), nvector(yp0)) - assert(flag == 0) - flag = Sundials.IDASetId(mem,nvector(id)) - assert(flag == 0) - flag = Sundials.IDASetUserData(mem, f) - assert(flag == 0) - flag = Sundials.IDASStolerances(mem, reltol, abstol) - assert(flag == 0) - mu = xsteps-1 - ml = xsteps-1 - flag = Sundials.IDABand(mem, neq, mu, ml) - ##flag = Sundials.IDADense(mem, neq) - assert(flag == 0) + Sundials.@checkflag Sundials.IDAInit(mem, cfunction(Sundials.idasolfun, Cint, + (Sundials.realtype, Sundials.N_Vector, Sundials.N_Vector, Sundials.N_Vector, Ref{Function})), + t[1], y0, yp0) + Sundials.@checkflag Sundials.IDASetId(mem, id) + Sundials.@checkflag Sundials.IDASetUserData(mem, f) + Sundials.@checkflag Sundials.IDASStolerances(mem, reltol, abstol) + Sundials.@checkflag Sundials.IDABand(mem, neq, xsteps-1, xsteps-1) + ##Sundials.@checkflag Sundials.IDADense(mem, neq) rtest = zeros(neq) - flag = Sundials.IDACalcIC(mem, Sundials.IDA_YA_YDP_INIT, t[2]) - assert(flag == 0) - yres = zeros(length(t), length(y0)) - ypres = zeros(length(t), length(y0)) - yres[1,:] = y0 - ypres[1,:] = yp0 + Sundials.@checkflag Sundials.IDACalcIC(mem, Sundials.IDA_YA_YDP_INIT, t[2]) + yres = zeros(Float64, length(y0), length(t)) + ypres = zeros(Float64, length(y0), length(t)) + yres[:, 1] = y0 + ypres[:, 1] = yp0 y = copy(y0) yp = copy(yp0) tout = [0.0] for k in 2:length(t) - retval = Sundials.IDASolve(mem, t[k], tout, y, yp, Sundials.IDA_NORMAL) - yres[k,:] = y[:] - ypres[k,:] = yp[:] + Sundials.@checkflag Sundials.IDASolve(mem, t[k], tout, y, yp, Sundials.IDA_NORMAL) + yres[:, k] = y + ypres[:, k] = yp end return yres, ypres end diff --git a/examples/ida_Heat2D.jl b/examples/ida_Heat2D.jl index 9f381763..883545c4 100644 --- a/examples/ida_Heat2D.jl +++ b/examples/ida_Heat2D.jl @@ -36,18 +36,16 @@ const bval = 0.1 ## central differencing on the interior points, and includes algebraic ## equations for the boundary values. ## -## So for each interior point, the residual component has the form -## r_i = u'_i - (central difference)_i -## while for each boundary point, it is r_i = u_i. +## So for each interior point, the residual component has the form +## r_i = u'_i - (central difference)_i +## while for each boundary point, it is r_i = u_i. ## function heatres(t, u, up, r) - r[:] = u ## Initialize r to u, to take care of boundary equations. - + ## Loop over interior points; set res = up - (central difference). for j = 2:(MGRID-2) - offset = MGRID * j for i = 2:(MGRID-2) loc = offset + i @@ -56,16 +54,15 @@ function heatres(t, u, up, r) 4.0 * u[loc]) end end - - return (0) + + return Sundials.CV_SUCCESS end function initial() - mm = MGRID mm1 = mm - 1 - + u = zeros(NEQ) id = ones(NEQ) @@ -85,7 +82,7 @@ function initial() heatres(0.0, u, up, r) - ## Copy -res into up to get correct interior initial up values. + ## Copy -res into up to get correct interior initial up values. up[:] = -1.0 * r ## Finally, set values of u, up, and id at boundary points. @@ -103,54 +100,42 @@ function initial() constraints = ones(NEQ) return (u,up,id,constraints) - end -nvector = Sundials.nvector function idabandsol(f::Function, y0::Vector{Float64}, yp0::Vector{Float64}, id::Vector{Float64}, constraints::Vector{Float64}, t::Vector{Float64}; reltol::Float64=1e-4, abstol::Float64=1e-6) - neq = length(y0) mem = Sundials.IDACreate() - flag = Sundials.IDAInit(mem, cfunction(Sundials.idasolfun, Int32, - (Sundials.realtype, Sundials.N_Vector, Sundials.N_Vector, Sundials.N_Vector, Ref{Function})), - t[1], nvector(y0), nvector(yp0)) - assert(flag == 0) - flag = Sundials.IDASetId(mem,nvector(id)) - assert(flag == 0) - flag = Sundials.IDASetConstraints(mem,nvector(constraints)) - assert(flag == 0) - flag = Sundials.IDASetUserData(mem, f) - assert(flag == 0) - flag = Sundials.IDASStolerances(mem, reltol, abstol) - assert(flag == 0) - mu = MGRID - ml = MGRID - flag = Sundials.IDABand(mem, neq, mu, ml) - assert(flag == 0) + Sundials.@checkflag Sundials.IDAInit(mem, cfunction(Sundials.idasolfun, Cint, + (Sundials.realtype, Sundials.N_Vector, Sundials.N_Vector, Sundials.N_Vector, Ref{Function})), + t[1], y0, yp0) + Sundials.@checkflag Sundials.IDASetId(mem, id) + Sundials.@checkflag Sundials.IDASetConstraints(mem, constraints) + Sundials.@checkflag Sundials.IDASetUserData(mem, f) + Sundials.@checkflag Sundials.IDASStolerances(mem, reltol, abstol) + Sundials.@checkflag Sundials.IDABand(mem, neq, MGRID, MGRID) rtest = zeros(neq) - flag = Sundials.IDACalcIC(mem, Sundials.IDA_YA_YDP_INIT, t[2]) - assert(flag == 0) - yres = zeros(length(t), length(y0)) - ypres = zeros(length(t), length(y0)) - yres[1,:] = y0 - ypres[1,:] = yp0 + Sundials.@checkflag Sundials.IDACalcIC(mem, Sundials.IDA_YA_YDP_INIT, t[2]) + yres = zeros(Float64, length(y0), length(t)) + ypres = zeros(Float64, length(y0), length(t)) + yres[:, 1] = y0 + ypres[:, 1] = yp0 y = copy(y0) yp = copy(yp0) tout = [0.0] for k in 2:length(t) - retval = Sundials.IDASolve(mem, t[k], tout, y, yp, Sundials.IDA_NORMAL) - yres[k,:] = y[:] - ypres[k,:] = yp[:] + Sundials.@checkflag Sundials.IDASolve(mem, t[k], tout, y, yp, Sundials.IDA_NORMAL) + yres[:, k] = y + ypres[:, k] = yp end return yres, ypres end -nsteps = 10 -tstep = 0.005 -t = 0.0:tstep:(tstep*nsteps) +const nsteps = 10 +const tstep = 0.005 +const t = collect(0.0:tstep:(tstep*nsteps)) u0, up0, id, constraints = initial() yout, ypout = idabandsol(heatres, u0, up0, id, constraints, map(x -> x, t), diff --git a/examples/ida_Roberts_dns.jl b/examples/ida_Roberts_dns.jl index 7f130bd9..bc8d611a 100644 --- a/examples/ida_Roberts_dns.jl +++ b/examples/ida_Roberts_dns.jl @@ -35,78 +35,77 @@ using Sundials ## Define the system residual function. -function resrob(tres, yy, yp, rr, user_data) - yval = Sundials.asarray(yy) - ypval = Sundials.asarray(yp) - rval = Sundials.asarray(rr) - rval[1] = -0.04*yval[1] + 1.0e4*yval[2]*yval[3] - rval[2] = -rval[1] - 3.0e7*yval[2]*yval[2] - ypval[2] - rval[1] -= ypval[1] - rval[3] = yval[1] + yval[2] + yval[3] - 1.0 - return Int32(0) # indicates normal return +function resrob(tres, yy_nv, yp_nv, rr_nv, user_data) + yy = convert(Vector, yy_nv) + yp = convert(Vector, yp_nv) + rr = convert(Vector, rr_nv) + rr[1] = -0.04*yy[1] + 1.0e4*yy[2]*yy[3] + rr[2] = -rr[1] - 3.0e7*yy[2]*yy[2] - yp[2] + rr[1] -= yp[1] + rr[3] = yy[1] + yy[2] + yy[3] - 1.0 + return Sundials.IDA_SUCCESS end ## Root function routine. Compute functions g_i(t,y) for i = 0,1. -function grob(t, yy, yp, gout, user_data) - yval = Sundials.asarray(yy) - gval = Sundials.asarray(gout, (2,)) - gval[1] = yval[1] - 0.0001 - gval[2] = yval[3] - 0.01 - return Int32(0) # indicates normal return +function grob(t, yy_nv, yp_nv, gout_ptr, user_data) + yy = convert(Vector, yy_nv) + gout = Sundials.asarray(gout_ptr, (2,)) + gout[1] = yy[1] - 0.0001 + gout[2] = yy[3] - 0.01 + return Sundials.IDA_SUCCESS end ## Define the Jacobian function. BROKEN - JJ is wrong function jacrob(Neq, tt, cj, yy, yp, resvec, JJ, user_data, tempv1, tempv2, tempv3) - yval = Sundials.asarray(yy) JJ = pointer_to_array(convert(Ptr{Float64}, JJ), (3,3)) JJ[1,1] = -0.04 - cj JJ[2,1] = 0.04 JJ[3,1] = 1.0 - JJ[1,2] = 1.0e4*yval[3] - JJ[2,2] = -1.0e4*yval[3] - 6.0e7*yval[2] - cj + JJ[1,2] = 1.0e4*yy[3] + JJ[2,2] = -1.0e4*yy[3] - 6.0e7*yy[2] - cj JJ[3,2] = 1.0 - JJ[1,3] = 1.0e4*yval[2] - JJ[2,3] = -1.0e4*yval[2] + JJ[1,3] = 1.0e4*yy[2] + JJ[2,3] = -1.0e4*yy[2] JJ[3,3] = 1.0 - return Int32(0) # indicates normal return + return Sundials.IDA_SUCCESS end -neq = 3 -nout = 12 -t0 = 0.0 -yy = [1.0,0.0,0.0] -yp = [-0.04,0.04,0.0] -rtol = 1e-4 -avtol = [1e-8, 1e-14, 1e-6] -tout1 = 0.4 +const neq = 3 +const nout = 12 +const t0 = 0.0 +const yy0 = [1.0,0.0,0.0] +const yp0 = [-0.04,0.04,0.0] +const rtol = 1e-4 +const avtol = [1e-8, 1e-14, 1e-6] +const tout1 = 0.4 mem = Sundials.IDACreate() -retval = Sundials.IDAInit(mem, resrob, t0, yy, yp) -retval = Sundials.IDASVtolerances(mem, rtol, avtol) +Sundials.@checkflag Sundials.IDAInit(mem, resrob, t0, yy0, yp0) +Sundials.@checkflag Sundials.IDASVtolerances(mem, rtol, avtol) ## Call IDARootInit to specify the root function grob with 2 components -retval = Sundials.IDARootInit(mem, 2, grob) +Sundials.@checkflag Sundials.IDARootInit(mem, 2, grob) ## Call IDADense and set up the linear solver. -retval = Sundials.IDADense(mem, neq) +Sundials.@checkflag Sundials.IDADense(mem, neq) ## retval = Sundials.IDADlsSetDenseJacFn(mem, jacrob) iout = 0 tout = tout1 tret = [1.0] -rootsfound = round(Int32,[0, 0]) -while true +while iout < nout + yy = similar(yy0) + yp = similar(yp0) retval = Sundials.IDASolve(mem, tout, tret, yy, yp, Sundials.IDA_NORMAL) - println("T = ", tout, ", Y = ", yy) + println("T=", tout, ", Y=", yy) if retval == Sundials.IDA_ROOT_RETURN - retvalr = Sundials.IDAGetRootInfo(mem, pointer(rootsfound)) - println("roots = ", rootsfound) - end - if retval == Sundials.IDA_SUCCESS + rootsfound = zeros(Cint, 2) + Sundials.@checkflag Sundials.IDAGetRootInfo(mem, rootsfound) + println("roots=", rootsfound) + elseif retval == Sundials.IDA_SUCCESS iout += 1 tout *= 10.0 end - if iout == nout break end end diff --git a/examples/kinsol_mkinTest.jl b/examples/kinsol_mkinTest.jl index a17200b5..ffc541f1 100644 --- a/examples/kinsol_mkinTest.jl +++ b/examples/kinsol_mkinTest.jl @@ -1,5 +1,5 @@ ## Adapted from sundialsTB/kinsol/examples_ser/mkinTest_nds.m - + ## %mkinTest_dns - KINSOL example problem (serial, dense) ## % Simple test problem for the Dense linear solver in KINSOL ## % This example solves the system @@ -9,41 +9,32 @@ ## % Radu Serban - -import Sundials +using Sundials ## function to be optimized -function sysfn(y_in, fy_in, a_in) - y = Sundials.asarray(y_in) - fy = Sundials.asarray(fy_in) +function sysfn(y_nv, fy_nv, a_in) + y = convert(Vector, y_nv) + fy = convert(Vector, fy_nv) fy[1] = y[1]^2 + y[2]^2 - 1.0 fy[2] = y[2] - y[1]^2 - return Int32(0) # indicates normal return + return Sundials.KIN_SUCCESS end ## Initialize problem -neq = 2 +const neq = 2 kmem = Sundials.KINCreate() -flag = Sundials.KINSetFuncNormTol(kmem, 1.0e-5) -flag = Sundials.KINSetScaledStepTol(kmem, 1.0e-4) -flag = Sundials.KINSetMaxSetupCalls(kmem, 1) +Sundials.@checkflag Sundials.KINSetFuncNormTol(kmem, 1.0e-5) +Sundials.@checkflag Sundials.KINSetScaledStepTol(kmem, 1.0e-4) +Sundials.@checkflag Sundials.KINSetMaxSetupCalls(kmem, 1) y = ones(neq) -flag = Sundials.KINInit(kmem, sysfn, y) -flag = Sundials.KINDense(kmem, neq) +Sundials.@checkflag Sundials.KINInit(kmem, sysfn, y) +Sundials.@checkflag Sundials.KINDense(kmem, neq) ## Solve problem scale = ones(neq) -strategy = 1 # KIN_LINESEARCH -flag = Sundials.KINSol(kmem, - y, - strategy, - scale, - scale) +Sundials.@checkflag Sundials.KINSol(kmem, y, Sundials.KIN_LINESEARCH, + scale, scale) println("Solution: ", y) residual = ones(2) -sysfn(y, residual, [1,2]) +sysfn(y, residual, [1, 2]) println("Residual: ", residual) - -Sundials.KINFree([kmem]) - - diff --git a/examples/kinsol_mkin_simplified.jl b/examples/kinsol_mkin_simplified.jl index cd81452d..d0aa951a 100644 --- a/examples/kinsol_mkin_simplified.jl +++ b/examples/kinsol_mkin_simplified.jl @@ -1,7 +1,7 @@ ## This uses the simplified kinsol interface. ## Results should match that in kinsol_kminTest.jl. -import Sundials +using Sundials function sysfn(y, fy) fy[1] = y[1]^2 + y[2]^2 - 1.0 diff --git a/src/Sundials.jl b/src/Sundials.jl index 3b8a6120..7d59458d 100644 --- a/src/Sundials.jl +++ b/src/Sundials.jl @@ -6,43 +6,30 @@ const depsfile = joinpath(dirname(dirname(@__FILE__)),"deps","deps.jl") if isfile(depsfile) include(depsfile) else - error("Sundials not properly installed. Please run Pkg.build(\"Sundials\")") + error("Sundials is not properly installed. Please run Pkg.build(\"Sundials\")") end - ################################################################## -# -# Read in the wrapping code generated by the Clang.jl package. -# +# Deprecations ################################################################## -recurs_sym_type(ex::Any) = - (ex==Union{} || typeof(ex)==Symbol || length(ex.args)==1) ? eval(ex) : Expr(ex.head, ex.args[1], recurs_sym_type(ex.args[2])) -macro c(ret_type, func, arg_types, lib) - local _arg_types = Expr(:tuple, [recurs_sym_type(a) for a in arg_types.args]...) - local _ret_type = recurs_sym_type(ret_type) - local _args_in = Any[ @compat Symbol(string('a',x)) for x in 1:length(_arg_types.args) ] - local _lib = eval(lib) - quote - $(esc(func))($(_args_in...)) = ccall( ($(string(func)), $(Expr(:quote, _lib)) ), $_ret_type, $_arg_types, $(_args_in...) ) - end -end +@deprecate nvlength length +@deprecate asarray convert +@deprecate nvector NVector -macro ctypedef(fake_t,real_t) - real_t = recurs_sym_type(real_t) - quote - typealias $fake_t $real_t - end -end +# some definitions from the system C headers wrapped into the types_and_consts.jl +const DBL_MAX = prevfloat(Inf) +const DBL_MIN = nextfloat(-Inf) +const DBL_EPSILON = eps(Cdouble) -typealias __builtin_va_list Ptr{:Void} +typealias FILE Void +typealias __builtin_va_list Ptr{Void} -if isdefined(:libsundials_cvodes) - const libsundials_cvode = libsundials_cvodes - const libsundials_ida = libsundials_idas -end +include("types_and_consts.jl") + +include("handle.jl") +include("nvector_wrapper.jl") -include("sundials_h.jl") include("nvector.jl") include("libsundials.jl") if isdefined(:libsundials_cvodes) @@ -50,426 +37,13 @@ if isdefined(:libsundials_cvodes) else include("cvode.jl") end -shlib = libsundials_ida if isdefined(:libsundials_cvodes) include("idas.jl") else include("ida.jl") end -shlib = libsundials_kinsol include("kinsol.jl") -include("constants.jl") - -################################################################## -# -# Methods to convert between Julia Vectors and Sundials N_Vectors. -# -################################################################## - -nvlength(x::N_Vector) = unsafe_load(unsafe_load(convert(Ptr{Ptr{Clong}}, x))) -asarray(x::N_Vector) = @compat unsafe_wrap(Array, N_VGetArrayPointer_Serial(x), (nvlength(x),)) -asarray(x::Vector{realtype}) = x -asarray(x::Ptr{realtype}, dims::Tuple) = @compat unsafe_wrap(Array, x, dims) -asarray(x::N_Vector, dims::Tuple) = reinterpret(realtype, asarray(x), dims) -nvector(x::Vector{realtype}) = N_VMake_Serial(length(x), x) -nvector(x::N_Vector) = x - - -################################################################## -# -# Methods following the C API that allow the direct use of Julia -# Vectors instead of Sundials N_Vectors and Functions in place of -# CFunctions. -# -################################################################## - - - -# KINSOL -KINInit(mem, sysfn::Function, y) = - KINInit(mem, cfunction(sysfn, Int32, (N_Vector, N_Vector, Ptr{Void})), nvector(y)) -KINSetConstraints(mem, constraints::Vector{realtype}) = - KINSetConstraints(mem, nvector(constraints)) -KINSol(mem, u::Vector{realtype}, strategy, u_scale::Vector{realtype}, f_scale::Vector{realtype}) = - KINSol(mem, nvector(u), strategy, nvector(u_scale), nvector(f_scale)) - -# IDA -IDAInit(mem, res::Function, t0, yy0, yp0) = - IDAInit(mem, cfunction(res, Int32, (realtype, N_Vector, N_Vector, N_Vector, Ptr{Void})), t0, nvector(yy0), nvector(yp0)) -IDARootInit(mem, nrtfn, g::Function) = - IDARootInit(mem, nrtfn, cfunction(g, Int32, (realtype, N_Vector, N_Vector, Ptr{realtype}, Ptr{Void}))) -IDASVtolerances(mem, reltol, abstol::Vector{realtype}) = - IDASVtolerances(mem, reltol, nvector(abstol)) -IDADlsSetDenseJacFn(mem, jac::Function) = - IDADlsSetDenseJacFn(mem, cfunction(jac, Int32, (Int32, realtype, realtype, N_Vector, N_Vector, N_Vector, DlsMat, Ptr{Void}, N_Vector, N_Vector, N_Vector))) -IDASetId(mem, id::Vector{realtype}) = - IDASetId(mem, nvector(id)) -IDASetConstraints(mem, constraints::Vector{realtype}) = - IDASetConstraints(mem, nvector(constraints)) -IDASolve(mem, tout, tret, yret::Vector{realtype}, ypret::Vector{realtype}, itask) = - IDASolve(mem, tout, tret, nvector(yret), nvector(ypret), itask) - -# CVODE -CVodeInit(mem, f::Function, t0, y0) = - CVodeInit(mem, cfunction(f, Int32, (realtype, N_Vector, N_Vector, Ptr{Void})), t0, nvector(y0)) -CVodeReInit(mem, t0, y0::Vector{realtype}) = - CVodeReInit(mem, t0, nvector(y0)) -CVodeSVtolerances(mem, reltol, abstol::Vector{realtype}) = - CVodeSVtolerances(mem, reltol, nvector(abstol)) -CVodeGetDky(mem, t, k, dky::Vector{realtype}) = - CVodeGetDky(mem, t, k, nvector(dky)) -CVodeGetErrWeights(mem, eweight::Vector{realtype}) = - CVodeGetErrWeights(mem, nvector(eweight)) -CVodeGetEstLocalErrors(mem, ele::Vector{realtype}) = - CVodeGetEstLocalErrors(mem, nvector(ele)) -CVodeRootInit(mem, nrtfn, g::Function) = - CVodeRootInit(mem, nrtfn, cfunction(g, Int32, (realtype, N_Vector, Ptr{realtype}, Ptr{Void}))) -CVDlsSetDenseJacFn(mem, jac::Function) = - CVDlsSetDenseJacFn(mem, cfunction(jac, Int32, (Int32, realtype, N_Vector, N_Vector, DlsMat, Ptr{Void}, N_Vector, N_Vector, N_Vector))) -CVode(mem, tout, yout::Vector{realtype}, tret, itask) = - CVode(mem, tout, nvector(yout), tret, itask) - -if isdefined(:libsundials_cvodes) -# CVODES -CVodeQuadInit(mem, fQ::Function, yQ0) = - CVodeQuadInit(mem, cfunction(fQ, Int32, (realtype, N_Vector, N_Vector, Ptr{Void})), nvector(yQ0)) -CVodeQuadReInit(mem, yQ0::Vector{realtype}) = - CVodeQuadReInit(mem, nvector(yQ0)) -CVodeQuadSVtolerances(mem, reltolQ, abstolQ::Vector{realtype}) = - CVodeQuadSVtolerances(mem, reltolQ, nvector(abstolQ)) -CVodeSensInit(mem, Ns, ism, fS::Function, yS0) = - CVodeSensInit(mem, Ns, ism, cfunction(fS, Int32, (Int32, realtype, N_Vector, N_Vector, N_Vector, N_Vector, Ptr{Void}, N_Vector, N_Vector)), yS0) -CVodeSensInit1(mem, Ns, ism, fS1::Function, yS0) = - CVodeSensInit1(mem, Ns, ism, cfunction(fS1, Int32, (Int32, realtype, N_Vector, N_Vector, Int32, N_Vector, N_Vector, Ptr{Void}, N_Vector, N_Vector)), yS0) -CVodeSensReInit(mem, ism, yS0::Vector{realtype}) = - CVodeSensReInit(mem, ism, nvector(yS0)) -CVodeSensSVtolerances(mem, reltolS, abstolS::Vector{realtype}) = - CVodeSensSVtolerances(mem, reltolS, nvector(abstolS)) -CVodeQuadSensInit(mem, fQS::Function, yQS0) = - CVodeQuadSensInit(mem, cfunction(fQS, Int32, (int32, realtype, N_Vector, N_Vector, N_Vector, N_Vector, Ptr{Void}, N_Vector, N_Vector)), nvector(yQS0)) -CVodeQuadSensReInit(mem, yQS0::Vector{realtype}) = - CVodeQuadSensReInit(mem, nvector(yQS0)) -CVodeQuadSensSVtolerances(mem, reltolQS, abstolQS::Vector{realtype}) = - CVodeQuadSensSVtolerances(mem, reltolQS, nvector(abstolQS)) -CVodeGetQuad(mem, tret, yQout::Vector{realtype}) = - CVodeGetQuad(mem, tret, nvector(yQout)) -CVodeGetQuadDky(mem, t, k, dky::Vector{realtype}) = - CVodeGetQuadDky(mem, t, k, nvector(dky)) -CVodeGetSens(mem, tret, ySout::Vector{realtype}) = - CVodeGetSens(mem, tret, nvector(ySout)) -CVodeGetSens1(mem, tret, is, ySout::Vector{realtype}) = - CVodeGetSens1(mem, tret, is, nvector(ySout)) -CVodeGetSensDky(mem, t, k, dkyA::Vector{realtype}) = - CVodeGetSensDky(mem, t, k, nvector(dkyA)) -CVodeGetSensDky1(mem, t, k, is, dky::Vector{realtype}) = - CVodeGetSensDky1(mem, t, k, is, nvector(dky)) -CVodeGetQuadSens(mem, tret, yQSout::Vector{realtype}) = - CVodeGetQuadSens(mem, tret, nvector(yQSout)) -CVodeGetQuadSens1(mem, tret, is, yQSout::Vector{realtype}) = - CVodeGetQuadSens1(mem, tret, is, nvector(yQSout)) -CVodeGetQuadSensDky(mem, t, k, kdyQS_all::Vector{realtype}) = - CVodeGetQuadSensDky(mem, t, k, nvector(kdyQS_all)) -CVodeGetQuadSensDky1(mem, t, k, is, kdyQS::Vector{realtype}) = - CVodeGetQuadSensDky1(mem, t, k, is, nvector(kdyQS)) -CVodeGetQuadErrWeights(mem, eQweight::Vector{realtype}) = - CVodeGetQuadErrWeights(mem, nvector(eQweight)) -CVodeGetSensErrWeights(mem, eSweight::Vector{realtype}) = - CVodeGetSensErrWeights(mem, nvector(eSweight)) -CVodeGetQuadSensErrWeights(mem, eQSweight::Vector{realtype}) = - CVodeGetQuadSensErrWeights(mem, nvector(eQSweight)) -CVodeInitB(mem, which, fB::Function, tB0, yB0) = - CVodeInitB(mem, which, cfunction(fB, Int32, (realtype, N_Vector, N_Vector, N_Vector, Ptr{Void})), tB0, nvector(yB0)) -CVodeInitBS(mem, which, fBs::Function, tB0, yB0) = - CVodeInitBS(mem, which, cfunction(fBs, Int32, (realtype, N_Vector, N_Vector, N_Vector, Ptr{Void})), tB0, nvector(yB0)) -CVodeReInitB(mem, which, tB0, yB0::Vector{realtype}) = - CVodeReInitB(mem, which, tB0, nvector(yB0)) -CVodeSVtolerancesB(mem, which, reltolB, abstolB::Vector{realtype}) = - CVodeSVtolerancesB(mem, which, reltolB, nvector(abstolB)) -CVodeQuadInitB(mem, which, fQB::Function, yQB0) = - CVodeQuadInitB(mem, which, cfunction(fQB, Int32, (realtype, N_Vector, N_Vector, N_Vector, Ptr{Void})), nvector(yQB0)) -CVodeQuadInitBS(mem, which, fQBs::Function, yQB0) = - CVodeQuadInitBS(mem, which, cfunction(fQBs, Int32, (realtype, N_Vector, N_Vector, N_Vector, N_Vector, Ptr{Void})), nvector(yQB0)) -CVodeQuadReInitB(mem, which, yQB0::Vector{realtype}) = - CVodeQuadReInitB(mem, which, nvector(yQB0)) -CVodeQuadSVtolerancesB(mem, which, reltolQB, abstolQB::Vector{realtype}) = - CVodeQuadSVtolerancesB(mem, which, reltolQB, nvector(abstolQB)) -CVodeF(mem, tout, yout::Vector{realtype}, tret, itask, ncheckPtr) = - CVodeF(mem, tout, nvector(yout), tret, itask, ncheckPtr) -CVodeGetB(mem, which, tBret, yB::Vector{realtype}) = - CVodeGetB(mem, which, tBret, nvector(yB)) -CVodeGetQuadB(mem, which, tBret, qB::Vector{realtype}) = - CVodeGetQuadB(mem, which, tBret, nvector(qB)) -CVodeGetAdjY(mem, which, t, y::Vector{realtype}) = - CVodeGetAdjY(mem, which, t, nvector(y)) -CVodeGetAdjDataPointHermite(mem, which, t, y::Vector{realtype}, yd::Vector{realtype}) = - CVodeGetAdjDataPointHermite(mem, which, t, nvector(y), nvector(yd)) -CVodeGetAdjDataPointPolynomial(mem, which, t, y::Vector{realtype}) = - CVodeGetAdjDataPointPolynomial(mem, which, t, nvector(y)) -CVodeWFtolerances(mem, efun::Function) = - CVodeWFtolerances(mem, cfunction(efun, Int32, (N_Vector, N_Vector, Ptr{Void}))) -CVodeSetErrHandlerFn(mem, ehfun::Function, eh_data) = - CVodeSetErrHandlerFn(mem, cfunction(ehfun, Void, (Int32, Ptr{UInt8}, Ptr{UInt8}, Ptr{UInt8}, Ptr{Void})), eh_data) - -# IDAS (still incomplete) -IDAReInit(mem, t0, yy0::Vector{realtype}, yp0::Vector{realtype}) = - IDAReInit(mem, t0, nvector(yy0), nvector(yp0)) -IDAQuadInit(mem, rhsQ::Function, yQ0) = - IDAQuadInit(mem, cfunction(rhsQ, Int32, (realtype, N_Vector, N_Vector, N_Vector, Ptr{Void})), nvector(yQ0)) -IDAQuadReInit(mem, yQ0::Vector{realtype}) = - IDAQuadReInit(mem, nvector(yQ0)) - - ## IDAQuadSVtolerances(mem, reltol, abstol::Vector{realtype}) = - ## IDAQuadSVtolerances(mem, reltol, nvector(abstol)) -end - -################################################################## -# -# Simplified interfaces. -# -################################################################## - - -macro checkflag(ex) - # Insert a check that the given function call returns 0, - # throw an error otherwise. Only apply directly to function calls. - @assert Base.Meta.isexpr(ex, :call) - fname = ex.args[1] - quote - flag = $(esc(ex)) - if flag != 0 - error($(string(fname, " failed with error code = ")), flag) - end - flag - end -end - -@c Int32 KINSetUserData (Ptr{:Void},Any) libsundials_kinsol ## needed to allow passing a Function through the user data - -function kinsolfun(y::N_Vector, fy::N_Vector, userfun::Function) - y = asarray(y) - fy = asarray(fy) - userfun(y, fy) - return Int32(0) -end - -function kinsol(f::Function, y0::Vector{Float64}) - # f, Function to be optimized of the form f(y::Vector{Float64}, fy::Vector{Float64}) - # where `y` is the input vector, and `fy` is the result of the function - # y0, Vector of initial values - # return: the solution vector - neq = length(y0) - kmem = KINCreate() - if kmem == C_NULL - error("Failed to allocate KINSOL solver object") - end - - y = copy(y0) - try - # use the user_data field to pass a function - # see: https://github.com/JuliaLang/julia/issues/2554 - flag = @checkflag KINInit(kmem, cfunction(kinsolfun, Int32, (N_Vector, N_Vector, Ref{Function})), nvector(y0)) - flag = @checkflag KINDense(kmem, neq) - flag = @checkflag KINSetUserData(kmem, f) - ## Solve problem - scale = ones(neq) - strategy = 0 # KIN_NONE - flag = @checkflag KINSol(kmem, - y, - strategy, - scale, - scale) - finally - KINFree([kmem]) - end - - return y -end - -@c Int32 CVodeSetUserData (Ptr{:Void},Any) libsundials_cvode ## needed to allow passing a Function through the user data - -function cvodefun(t::Float64, y::N_Vector, yp::N_Vector, userfun::Function) - y = Sundials.asarray(y) - yp = Sundials.asarray(yp) - userfun(t, y, yp) - return Int32(0) -end - -""" -`cvode(f::Function, y0::Vector{Float64}, t::Vector{Float64},integrator=:BDF; reltol::Float64=1e-3, abstol::Float64=1e-6)` - -* `f`, Function of the form - `f(t, y::Vector{Float64}, yp::Vector{Float64})` - where `y` is the input state vector, and `yp` is the output vector - of time derivatives for the states `y` -* `y0`, Vector of initial values -* `t`, Vector of time values at which to record integration results -* `integrator`, the chosen integration algorithm. Default is `:BDF` - , other option is `:Adams` -* `reltol`, Relative Tolerance to be used (default=1e-3) -* `abstol`, Absolute Tolerance to be used (default=1e-6) - -return: a solution matrix with time steps in `t` along rows and - state variable `y` along columns -""" -function cvode(f::Function, y0::Vector{Float64}, t::Vector{Float64}, - integrator=:BDF; reltol::Float64=1e-3, abstol::Float64=1e-6) - - neq = length(y0) - - if integrator==:BDF - mem = CVodeCreate(CV_BDF, CV_NEWTON) - elseif integrator==:Adams - mem = CVodeCreate(CV_ADAMS, CV_FUNCTIONAL) - end - if mem == C_NULL - error("Failed to allocate CVODE solver object") - end - - yres = zeros(length(t), length(y0)) - try - flag = @checkflag CVodeInit(mem, cfunction(cvodefun, Int32, (realtype, N_Vector, N_Vector, Ref{Function})), t[1], nvector(y0)) - flag = @checkflag CVodeSetUserData(mem, f) - flag = @checkflag CVodeSStolerances(mem, reltol, abstol) - flag = @checkflag CVDense(mem, neq) - yres[1,:] = y0 - y = copy(y0) - tout = [0.0] - for k in 2:length(t) - flag = @checkflag CVode(mem, t[k], y, tout, CV_NORMAL) - yres[k,:] = y - end - finally - CVodeFree([mem]) - end - return yres -end - -""" -`cvode_fulloutput(f::Function, y0::Vector{Float64}, tspan::Vector{Float64},integrator=:BDF; reltol::Float64=1e-3, abstol::Float64=1e-6)` - -* `f`, Function of the form - `f(t, y::Vector{Float64}, yp::Vector{Float64})` - where `y` is the input state vector, and `yp` is the output vector - of time derivatives for the states `y` -* `y0`, Vector of initial values -* `tspan`, a vector where `tspan[1]` is the starting time and the other values are - time values which are guaranteed in the output -* `integrator`, the chosen integration algorithm. Default is `:BDF` - , other option is `:Adams` -* `reltol`, Relative Tolerance to be used (default=1e-3) -* `abstol`, Absolute Tolerance to be used (default=1e-6) - -return: a vector with the timepoints `t` and a vector with the outputs `y0` -""" -function cvode_fulloutput(f::Function, y0::Vector{Float64}, - tspan::Vector{Float64}, integrator=:BDF; - reltol::Float64=1e-3, abstol::Float64=1e-6) - t = tspan[1] - Ts = tspan[2:end] - neq = length(y0) - if integrator==:BDF - mem = CVodeCreate(CV_BDF, CV_NEWTON) - elseif integrator==:Adams - mem = CVodeCreate(CV_ADAMS, CV_FUNCTIONAL) - end - - if mem == C_NULL - error("Failed to allocate CVODE solver object") - end - - yres = Vector{typeof(y0)}(0) - ts = [t] - try - flag = @checkflag CVodeInit(mem, cfunction(cvodefun, Int32, (realtype, N_Vector, N_Vector, Ref{Function})), t, nvector(y0)) - flag = @checkflag CVodeSetUserData(mem, f) - flag = @checkflag CVodeSStolerances(mem, reltol, abstol) - flag = @checkflag CVDense(mem, neq) - push!(yres,y0) - y = copy(y0) - tout = [0.0] - for T in Ts - while tout[end]= reltol) - if diffstates === nothing - error("Must supply diffstates argument to use IDA initial value solver.") - end - flag = @checkflag IDASetId(mem, collect(Float64, diffstates)) - flag = @checkflag IDACalcIC(mem, IDA_YA_YDP_INIT, t[2]) - end - yres[1,:] = y0 - ypres[1,:] = yp0 - y = copy(y0) - yp = copy(yp0) - tout = [0.0] - for k in 2:length(t) - retval = @checkflag IDASolve(mem, t[k], tout, y, yp, IDA_NORMAL) - yres[k,:] = y - ypres[k,:] = yp - end - finally - IDAFree([mem]) - end - - return yres, ypres -end - +include("simple.jl") end # module diff --git a/src/constants.jl b/src/constants.jl deleted file mode 100644 index edcb25ed..00000000 --- a/src/constants.jl +++ /dev/null @@ -1,266 +0,0 @@ -# hand made using grep -# these could probably be weeded out more - -const ADAMS_Q_MAX = 12 -const BDF_Q_MAX = 5 -const CVDIAG_ILL_INPUT = -3 -const CVDIAG_INV_FAIL = -5 -const CVDIAG_LMEM_NULL = -2 -const CVDIAG_MEM_FAIL = -4 -const CVDIAG_MEM_NULL = -1 -const CVDIAG_NO_ADJ = -101 -const CVDIAG_RHSFUNC_RECVR = -7 -const CVDIAG_RHSFUNC_UNRECVR = -6 -const CVDIAG_SUCCESS = 0 -const CVDLS_ILL_INPUT = -3 -const CVDLS_JACFUNC_RECVR = -6 -const CVDLS_JACFUNC_UNRECVR = -5 -const CVDLS_LMEMB_NULL = -102 -const CVDLS_LMEM_NULL = -2 -const CVDLS_MEM_FAIL = -4 -const CVDLS_MEM_NULL = -1 -const CVDLS_NO_ADJ = -101 -const CVDLS_SUCCESS = 0 -const CVSPILS_DGMAX = 0.2 -const CVSPILS_EPLIN = 0.05 -const CVSPILS_ILL_INPUT = -3 -const CVSPILS_LMEMB_NULL = -102 -const CVSPILS_LMEM_NULL = -2 -const CVSPILS_MAXL = 5 -const CVSPILS_MEM_FAIL = -4 -const CVSPILS_MEM_NULL = -1 -const CVSPILS_MSBPRE = 50 -const CVSPILS_NO_ADJ = -101 -const CVSPILS_PMEM_NULL = -5 -const CVSPILS_SUCCESS = 0 -const CV_ADAMS = 1 -const CV_BAD_DKY = -26 -const CV_BAD_IS = -45 -const CV_BAD_K = -24 -const CV_BAD_T = -25 -const CV_BAD_TB0 = -104 -const CV_BDF = 2 -const CV_CENTERED = 1 -const CV_CONV_FAILURE = -4 -const CV_ERR_FAILURE = -3 -const CV_FAIL_BAD_J = 1 -const CV_FAIL_OTHER = 2 -const CV_FIRST_QRHSFUNC_ERR = -32 -const CV_FIRST_QSRHSFUNC_ERR = -52 -const CV_FIRST_RHSFUNC_ERR = -9 -const CV_FIRST_SRHSFUNC_ERR = -42 -const CV_FORWARD = 2 -const CV_FUNCTIONAL = 1 -const CV_FWD_FAIL = -106 -const CV_GETY_BADT = -107 -const CV_HERMITE = 1 -const CV_ILL_INPUT = -22 -const CV_LINIT_FAIL = -5 -const CV_LSETUP_FAIL = -6 -const CV_LSOLVE_FAIL = -7 -const CV_MEM_FAIL = -20 -const CV_MEM_NULL = -21 -const CV_NEWTON = 2 -const CV_NORMAL = 1 -const CV_NO_ADJ = -101 -const CV_NO_BCK = -103 -const CV_NO_FAILURES = 0 -const CV_NO_FWD = -102 -const CV_NO_MALLOC = -23 -const CV_NO_QUAD = -30 -const CV_NO_QUADSENS = -50 -const CV_NO_SENS = -40 -const CV_ONE_STEP = 2 -const CV_POLYNOMIAL = 2 -const CV_QRHSFUNC_FAIL = -31 -const CV_QSRHSFUNC_FAIL = -51 -const CV_REIFWD_FAIL = -105 -const CV_REPTD_QRHSFUNC_ERR = -33 -const CV_REPTD_QSRHSFUNC_ERR = -53 -const CV_REPTD_RHSFUNC_ERR = -10 -const CV_REPTD_SRHSFUNC_ERR = -43 -const CV_RHSFUNC_FAIL = -8 -const CV_ROOT_RETURN = 2 -const CV_RTFUNC_FAIL = -12 -const CV_SIMULTANEOUS = 1 -const CV_SRHSFUNC_FAIL = -41 -const CV_STAGGERED = 2 -const CV_STAGGERED1 = 3 -const CV_SUCCESS = 0 -const CV_TOO_CLOSE = -27 -const CV_TOO_MUCH_ACC = -2 -const CV_TOO_MUCH_WORK = -1 -const CV_TSTOP_RETURN = 1 -const CV_UNREC_QRHSFUNC_ERR = -34 -const CV_UNREC_QSRHSFUNC_ERR = -54 -const CV_UNREC_RHSFUNC_ERR = -11 -const CV_UNREC_SRHSFUNC_ERR = -44 -const CV_WARNING = 99 -const FCMIX_CVODE = 1 -const FCMIX_IDA = 2 -const FCMIX_KINSOL = 3 -const HMAX_INV_DEFAULT = 0.0 -const HMIN_DEFAULT = 0.0 -const IDADLS_ILL_INPUT = -3 -const IDADLS_JACFUNC_RECVR = -6 -const IDADLS_JACFUNC_UNRECVR = -5 -const IDADLS_LMEMB_NULL = -102 -const IDADLS_LMEM_NULL = -2 -const IDADLS_MEM_FAIL = -4 -const IDADLS_MEM_NULL = -1 -const IDADLS_NO_ADJ = -101 -const IDADLS_SUCCESS = 0 -const IDASPILS_ILL_INPUT = -3 -const IDASPILS_LMEMB_NULL = -102 -const IDASPILS_LMEM_NULL = -2 -const IDASPILS_MEM_FAIL = -4 -const IDASPILS_MEM_NULL = -1 -const IDASPILS_NO_ADJ = -101 -const IDASPILS_PMEM_NULL = -5 -const IDASPILS_SUCCESS = 0 -const IDA_BAD_DKY = -27 -const IDA_BAD_EWT = -24 -const IDA_BAD_IS = -43 -const IDA_BAD_K = -25 -const IDA_BAD_T = -26 -const IDA_BAD_TB0 = -104 -const IDA_CENTERED = 1 -const IDA_CONSTR_FAIL = -11 -const IDA_CONV_FAIL = -4 -const IDA_EE = 4 -const IDA_ERR_FAIL = -3 -const IDA_FIRST_QRHS_ERR = -32 -const IDA_FIRST_QSRHS_ERR = -52 -const IDA_FIRST_RES_FAIL = -12 -const IDA_FORWARD = 2 -const IDA_FWD_FAIL = -106 -const IDA_GETY_BADT = -107 -const IDA_HERMITE = 1 -const IDA_ILL_INPUT = -22 -const IDA_LINESEARCH_FAIL = -13 -const IDA_LINIT_FAIL = -5 -const IDA_LSETUP_FAIL = -6 -const IDA_LSOLVE_FAIL = -7 -const IDA_MEM_FAIL = -21 -const IDA_MEM_NULL = -20 -const IDA_NN = 0 -const IDA_NORMAL = 1 -const IDA_NO_ADJ = -101 -const IDA_NO_BCK = -103 -const IDA_NO_FWD = -102 -const IDA_NO_MALLOC = -23 -const IDA_NO_QUAD = -30 -const IDA_NO_QUADSENS = -50 -const IDA_NO_RECOVERY = -14 -const IDA_NO_SENS = -40 -const IDA_ONE_STEP = 2 -const IDA_POLYNOMIAL = 2 -const IDA_QRHS_FAIL = -31 -const IDA_QSRHS_FAIL = -51 -const IDA_REIFWD_FAIL = -105 -const IDA_REP_QRHS_ERR = -33 -const IDA_REP_QSRHS_ERR = -53 -const IDA_REP_RES_ERR = -9 -const IDA_REP_SRES_ERR = -42 -const IDA_RES_FAIL = -8 -const IDA_ROOT_RETURN = 2 -const IDA_RTFUNC_FAIL = -10 -const IDA_SIMULTANEOUS = 1 -const IDA_SRES_FAIL = -41 -const IDA_SS = 1 -const IDA_STAGGERED = 2 -const IDA_SUCCESS = 0 -const IDA_SV = 2 -const IDA_TOO_MUCH_ACC = -2 -const IDA_TOO_MUCH_WORK = -1 -const IDA_TSTOP_RETURN = 1 -const IDA_WARNING = 99 -const IDA_WF = 3 -const IDA_YA_YDP_INIT = 1 -const IDA_Y_INIT = 2 -const KINBBDPRE_FUNC_UNRECVR = -12 -const KINBBDPRE_PDATA_NULL = -11 -const KINBBDPRE_SUCCESS = 0 -const KINDLS_ILL_INPUT = -3 -const KINDLS_JACFUNC_RECVR = -6 -const KINDLS_JACFUNC_UNRECVR = -5 -const KINDLS_LMEM_NULL = -2 -const KINDLS_MEM_FAIL = -4 -const KINDLS_MEM_NULL = -1 -const KINDLS_SUCCESS = 0 -const KINSPILS_ILL_INPUT = -3 -const KINSPILS_LMEM_NULL = -2 -const KINSPILS_MAXL = 10 -const KINSPILS_MEM_FAIL = -4 -const KINSPILS_MEM_NULL = -1 -const KINSPILS_PMEM_NULL = -5 -const KINSPILS_SUCCESS = 0 -const KIN_ETACHOICE1 = 1 -const KIN_ETACHOICE2 = 2 -const KIN_ETACONSTANT = 3 -const KIN_FIRST_SYSFUNC_ERR = -14 -const KIN_ILL_INPUT = -2 -const KIN_INITIAL_GUESS_OK = 1 -const KIN_LINESEARCH = 1 -const KIN_LINESEARCH_BCFAIL = -8 -const KIN_LINESEARCH_NONCONV = -5 -const KIN_LINIT_FAIL = -10 -const KIN_LINSOLV_NO_RECOVERY = -9 -const KIN_LSETUP_FAIL = -11 -const KIN_LSOLVE_FAIL = -12 -const KIN_MAXITER_REACHED = -6 -const KIN_MEM_FAIL = -4 -const KIN_MEM_NULL = -1 -const KIN_MXNEWT_5X_EXCEEDED = -7 -const KIN_NONE = 0 -const KIN_NO_MALLOC = -3 -const KIN_REPTD_SYSFUNC_ERR = -15 -const KIN_STEP_LT_STPTOL = 2 -const KIN_SUCCESS = 0 -const KIN_SYSFUNC_FAIL = -13 -const KIN_WARNING = 99 -const MSBSET_DEFAULT = 10 -const MSBSET_SUB_DEFAULT = 5 -const MXHNIL_DEFAULT = 10 -const MXITER_DEFAULT = 200 -const MXNBCF_DEFAULT = 10 -const MXORDP1 = 6 -const MXSTEP_DEFAULT = 500 -const NUM_TESTS = 5 -const OMEGA_MAX = 0.9 -const OMEGA_MIN = 0.00001 -const PRINTFL_DEFAULT = 0 -const Q_MAX = ADAMS_Q_MAX -const SPBCG_ATIMES_FAIL_REC = 4 -const SPBCG_ATIMES_FAIL_UNREC = -2 -const SPBCG_CONV_FAIL = 2 -const SPBCG_MEM_NULL = -1 -const SPBCG_PSET_FAIL_REC = 5 -const SPBCG_PSET_FAIL_UNREC = -4 -const SPBCG_PSOLVE_FAIL_REC = 3 -const SPBCG_PSOLVE_FAIL_UNREC = -3 -const SPBCG_RES_REDUCED = 1 -const SPBCG_SUCCESS = 0 -const SPGMR_ATIMES_FAIL_REC = 5 -const SPGMR_ATIMES_FAIL_UNREC = -2 -const SPGMR_CONV_FAIL = 2 -const SPGMR_GS_FAIL = -4 -const SPGMR_MEM_NULL = -1 -const SPGMR_PSET_FAIL_REC = 6 -const SPGMR_PSET_FAIL_UNREC = -6 -const SPGMR_PSOLVE_FAIL_REC = 4 -const SPGMR_PSOLVE_FAIL_UNREC = -3 -const SPGMR_QRFACT_FAIL = 3 -const SPGMR_QRSOL_FAIL = -5 -const SPGMR_RES_REDUCED = 1 -const SPGMR_SUCCESS = 0 -const SPTFQMR_ATIMES_FAIL_REC = 4 -const SPTFQMR_ATIMES_FAIL_UNREC = -2 -const SPTFQMR_CONV_FAIL = 2 -const SPTFQMR_MEM_NULL = -1 -const SPTFQMR_PSET_FAIL_REC = 5 -const SPTFQMR_PSET_FAIL_UNREC = -4 -const SPTFQMR_PSOLVE_FAIL_REC = 3 -const SPTFQMR_PSOLVE_FAIL_UNREC = -3 -const SPTFQMR_RES_REDUCED = 1 -const SPTFQMR_SUCCESS = 0 diff --git a/src/cvode.jl b/src/cvode.jl index 960ac1b8..efd1e350 100644 --- a/src/cvode.jl +++ b/src/cvode.jl @@ -1,630 +1,751 @@ -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVodeCreate(lmm::Int,iter::Int) - ccall((:CVodeCreate,libsundials_cvode),Ptr{Void},(Cint,Cint),lmm,iter) +function __CVodeCreate(lmm::Cint,iter::Cint) + ccall((:CVodeCreate,libsundials_cvode),CVODEMemPtr,(Cint,Cint),lmm,iter) end -function CVodeSetErrHandlerFn(cvode_mem::Ptr{Void},ehfun::CVErrHandlerFn,eh_data::Ptr{Void}) - ccall((:CVodeSetErrHandlerFn,libsundials_cvode),Cint,(Ptr{Void},CVErrHandlerFn,Ptr{Void}),cvode_mem,ehfun,eh_data) +function CVodeCreate(lmm,iter) + __CVodeCreate(convert(Cint,lmm),convert(Cint,iter)) end -function CVodeSetErrFile(cvode_mem::Ptr{Void},errfp::Ptr{Void}) - ccall((:CVodeSetErrFile,libsundials_cvode),Cint,(Ptr{Void},Ptr{Void}),cvode_mem,errfp) +function __CVodeSetErrHandlerFn(cvode_mem::CVODEMemPtr,ehfun::CVErrHandlerFn,eh_data::Ptr{Void}) + ccall((:CVodeSetErrHandlerFn,libsundials_cvode),Cint,(CVODEMemPtr,CVErrHandlerFn,Ptr{Void}),cvode_mem,ehfun,eh_data) end -function CVodeSetUserData(cvode_mem::Ptr{Void},user_data::Ptr{Void}) - ccall((:CVodeSetUserData,libsundials_cvode),Cint,(Ptr{Void},Ptr{Void}),cvode_mem,user_data) +function CVodeSetErrHandlerFn(cvode_mem,ehfun,eh_data) + __CVodeSetErrHandlerFn(convert(CVODEMemPtr,cvode_mem),ehfun,pointer(eh_data)) end -function CVodeSetMaxOrd(cvode_mem::Ptr{Void},maxord::Int) - ccall((:CVodeSetMaxOrd,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxord) +function __CVodeSetErrFile(cvode_mem::CVODEMemPtr,errfp::Ptr{FILE}) + ccall((:CVodeSetErrFile,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{FILE}),cvode_mem,errfp) end -function CVodeSetMaxNumSteps(cvode_mem::Ptr{Void},mxsteps::Int) - ccall((:CVodeSetMaxNumSteps,libsundials_cvode),Cint,(Ptr{Void},Clong),cvode_mem,mxsteps) +function CVodeSetErrFile(cvode_mem,errfp) + __CVodeSetErrFile(convert(CVODEMemPtr,cvode_mem),errfp) end -function CVodeSetMaxHnilWarns(cvode_mem::Ptr{Void},mxhnil::Int) - ccall((:CVodeSetMaxHnilWarns,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,mxhnil) +function __CVodeSetUserData(cvode_mem::CVODEMemPtr,user_data::Any) + ccall((:CVodeSetUserData,libsundials_cvode),Cint,(CVODEMemPtr,Any),cvode_mem,user_data) end -function CVodeSetStabLimDet(cvode_mem::Ptr{Void},stldet::Int) - ccall((:CVodeSetStabLimDet,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,stldet) +function CVodeSetUserData(cvode_mem,user_data) + __CVodeSetUserData(convert(CVODEMemPtr,cvode_mem),user_data) end -function CVodeSetInitStep(cvode_mem::Ptr{Void},hin::realtype) - ccall((:CVodeSetInitStep,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,hin) +function __CVodeSetMaxOrd(cvode_mem::CVODEMemPtr,maxord::Cint) + ccall((:CVodeSetMaxOrd,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,maxord) end -function CVodeSetMinStep(cvode_mem::Ptr{Void},hmin::realtype) - ccall((:CVodeSetMinStep,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,hmin) +function CVodeSetMaxOrd(cvode_mem,maxord) + __CVodeSetMaxOrd(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxord)) end -function CVodeSetMaxStep(cvode_mem::Ptr{Void},hmax::realtype) - ccall((:CVodeSetMaxStep,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,hmax) +function __CVodeSetMaxNumSteps(cvode_mem::CVODEMemPtr,mxsteps::Clong) + ccall((:CVodeSetMaxNumSteps,libsundials_cvode),Cint,(CVODEMemPtr,Clong),cvode_mem,mxsteps) end -function CVodeSetStopTime(cvode_mem::Ptr{Void},tstop::realtype) - ccall((:CVodeSetStopTime,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,tstop) +function CVodeSetMaxNumSteps(cvode_mem,mxsteps) + __CVodeSetMaxNumSteps(convert(CVODEMemPtr,cvode_mem),convert(Clong,mxsteps)) end -function CVodeSetMaxErrTestFails(cvode_mem::Ptr{Void},maxnef::Int) - ccall((:CVodeSetMaxErrTestFails,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxnef) +function __CVodeSetMaxHnilWarns(cvode_mem::CVODEMemPtr,mxhnil::Cint) + ccall((:CVodeSetMaxHnilWarns,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,mxhnil) end -function CVodeSetMaxNonlinIters(cvode_mem::Ptr{Void},maxcor::Int) - ccall((:CVodeSetMaxNonlinIters,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxcor) +function CVodeSetMaxHnilWarns(cvode_mem,mxhnil) + __CVodeSetMaxHnilWarns(convert(CVODEMemPtr,cvode_mem),convert(Cint,mxhnil)) end -function CVodeSetMaxConvFails(cvode_mem::Ptr{Void},maxncf::Int) - ccall((:CVodeSetMaxConvFails,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxncf) +function __CVodeSetStabLimDet(cvode_mem::CVODEMemPtr,stldet::Cint) + ccall((:CVodeSetStabLimDet,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,stldet) end -function CVodeSetNonlinConvCoef(cvode_mem::Ptr{Void},nlscoef::realtype) - ccall((:CVodeSetNonlinConvCoef,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,nlscoef) +function CVodeSetStabLimDet(cvode_mem,stldet) + __CVodeSetStabLimDet(convert(CVODEMemPtr,cvode_mem),convert(Cint,stldet)) end -function CVodeSetIterType(cvode_mem::Ptr{Void},iter::Int) - ccall((:CVodeSetIterType,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,iter) +function __CVodeSetInitStep(cvode_mem::CVODEMemPtr,hin::realtype) + ccall((:CVodeSetInitStep,libsundials_cvode),Cint,(CVODEMemPtr,realtype),cvode_mem,hin) end -function CVodeSetRootDirection(cvode_mem::Ptr{Void},rootdir::Ptr{Cint}) - ccall((:CVodeSetRootDirection,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,rootdir) +function CVodeSetInitStep(cvode_mem,hin) + __CVodeSetInitStep(convert(CVODEMemPtr,cvode_mem),hin) end -function CVodeSetNoInactiveRootWarn(cvode_mem::Ptr{Void}) - ccall((:CVodeSetNoInactiveRootWarn,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) +function __CVodeSetMinStep(cvode_mem::CVODEMemPtr,hmin::realtype) + ccall((:CVodeSetMinStep,libsundials_cvode),Cint,(CVODEMemPtr,realtype),cvode_mem,hmin) end -function CVodeInit(cvode_mem::Ptr{Void},f::CVRhsFn,t0::realtype,y0::N_Vector) - ccall((:CVodeInit,libsundials_cvode),Cint,(Ptr{Void},CVRhsFn,realtype,N_Vector),cvode_mem,f,t0,y0) +function CVodeSetMinStep(cvode_mem,hmin) + __CVodeSetMinStep(convert(CVODEMemPtr,cvode_mem),hmin) end -function CVodeReInit(cvode_mem::Ptr{Void},t0::realtype,y0::N_Vector) - ccall((:CVodeReInit,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector),cvode_mem,t0,y0) +function __CVodeSetMaxStep(cvode_mem::CVODEMemPtr,hmax::realtype) + ccall((:CVodeSetMaxStep,libsundials_cvode),Cint,(CVODEMemPtr,realtype),cvode_mem,hmax) end -function CVodeSStolerances(cvode_mem::Ptr{Void},reltol::realtype,abstol::realtype) - ccall((:CVodeSStolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,realtype),cvode_mem,reltol,abstol) +function CVodeSetMaxStep(cvode_mem,hmax) + __CVodeSetMaxStep(convert(CVODEMemPtr,cvode_mem),hmax) end -function CVodeSVtolerances(cvode_mem::Ptr{Void},reltol::realtype,abstol::N_Vector) - ccall((:CVodeSVtolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector),cvode_mem,reltol,abstol) +function __CVodeSetStopTime(cvode_mem::CVODEMemPtr,tstop::realtype) + ccall((:CVodeSetStopTime,libsundials_cvode),Cint,(CVODEMemPtr,realtype),cvode_mem,tstop) end -function CVodeWFtolerances(cvode_mem::Ptr{Void},efun::CVEwtFn) - ccall((:CVodeWFtolerances,libsundials_cvode),Cint,(Ptr{Void},CVEwtFn),cvode_mem,efun) +function CVodeSetStopTime(cvode_mem,tstop) + __CVodeSetStopTime(convert(CVODEMemPtr,cvode_mem),tstop) end -function CVodeRootInit(cvode_mem::Ptr{Void},nrtfn::Int,g::CVRootFn) - ccall((:CVodeRootInit,libsundials_cvode),Cint,(Ptr{Void},Cint,CVRootFn),cvode_mem,nrtfn,g) +function __CVodeSetMaxErrTestFails(cvode_mem::CVODEMemPtr,maxnef::Cint) + ccall((:CVodeSetMaxErrTestFails,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,maxnef) end -function CVode(cvode_mem::Ptr{Void},tout::realtype,yout::N_Vector,tret::Vector{realtype},itask::Int) - ccall((:CVode,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector,Ptr{realtype},Cint),cvode_mem,tout,yout,tret,itask) +function CVodeSetMaxErrTestFails(cvode_mem,maxnef) + __CVodeSetMaxErrTestFails(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxnef)) end -function CVodeGetDky(cvode_mem::Ptr{Void},t::realtype,k::Int,dky::N_Vector) - ccall((:CVodeGetDky,libsundials_cvode),Cint,(Ptr{Void},realtype,Cint,N_Vector),cvode_mem,t,k,dky) +function __CVodeSetMaxNonlinIters(cvode_mem::CVODEMemPtr,maxcor::Cint) + ccall((:CVodeSetMaxNonlinIters,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,maxcor) end -function CVodeGetWorkSpace(cvode_mem::Ptr{Void},lenrw::Ptr{Clong},leniw::Ptr{Clong}) - ccall((:CVodeGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrw,leniw) +function CVodeSetMaxNonlinIters(cvode_mem,maxcor) + __CVodeSetMaxNonlinIters(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxcor)) end -function CVodeGetNumSteps(cvode_mem::Ptr{Void},nsteps::Ptr{Clong}) - ccall((:CVodeGetNumSteps,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nsteps) +function __CVodeSetMaxConvFails(cvode_mem::CVODEMemPtr,maxncf::Cint) + ccall((:CVodeSetMaxConvFails,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,maxncf) end -function CVodeGetNumRhsEvals(cvode_mem::Ptr{Void},nfevals::Ptr{Clong}) - ccall((:CVodeGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevals) +function CVodeSetMaxConvFails(cvode_mem,maxncf) + __CVodeSetMaxConvFails(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxncf)) end -function CVodeGetNumLinSolvSetups(cvode_mem::Ptr{Void},nlinsetups::Ptr{Clong}) - ccall((:CVodeGetNumLinSolvSetups,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nlinsetups) +function __CVodeSetNonlinConvCoef(cvode_mem::CVODEMemPtr,nlscoef::realtype) + ccall((:CVodeSetNonlinConvCoef,libsundials_cvode),Cint,(CVODEMemPtr,realtype),cvode_mem,nlscoef) end -function CVodeGetNumErrTestFails(cvode_mem::Ptr{Void},netfails::Ptr{Clong}) - ccall((:CVodeGetNumErrTestFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,netfails) +function CVodeSetNonlinConvCoef(cvode_mem,nlscoef) + __CVodeSetNonlinConvCoef(convert(CVODEMemPtr,cvode_mem),nlscoef) end -function CVodeGetLastOrder(cvode_mem::Ptr{Void},qlast::Ptr{Cint}) - ccall((:CVodeGetLastOrder,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,qlast) +function __CVodeSetIterType(cvode_mem::CVODEMemPtr,iter::Cint) + ccall((:CVodeSetIterType,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,iter) end -function CVodeGetCurrentOrder(cvode_mem::Ptr{Void},qcur::Ptr{Cint}) - ccall((:CVodeGetCurrentOrder,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,qcur) +function CVodeSetIterType(cvode_mem,iter) + __CVodeSetIterType(convert(CVODEMemPtr,cvode_mem),convert(Cint,iter)) end -function CVodeGetNumStabLimOrderReds(cvode_mem::Ptr{Void},nslred::Ptr{Clong}) - ccall((:CVodeGetNumStabLimOrderReds,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nslred) +function __CVodeSetRootDirection(cvode_mem::CVODEMemPtr,rootdir::Ptr{Cint}) + ccall((:CVodeSetRootDirection,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Cint}),cvode_mem,rootdir) end -function CVodeGetActualInitStep(cvode_mem::Ptr{Void},hinused::Vector{realtype}) - ccall((:CVodeGetActualInitStep,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,hinused) +function CVodeSetRootDirection(cvode_mem,rootdir) + __CVodeSetRootDirection(convert(CVODEMemPtr,cvode_mem),pointer(rootdir)) end -function CVodeGetLastStep(cvode_mem::Ptr{Void},hlast::Vector{realtype}) - ccall((:CVodeGetLastStep,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,hlast) +function __CVodeSetNoInactiveRootWarn(cvode_mem::CVODEMemPtr) + ccall((:CVodeSetNoInactiveRootWarn,libsundials_cvode),Cint,(CVODEMemPtr,),cvode_mem) end -function CVodeGetCurrentStep(cvode_mem::Ptr{Void},hcur::Vector{realtype}) - ccall((:CVodeGetCurrentStep,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,hcur) +function CVodeSetNoInactiveRootWarn(cvode_mem) + __CVodeSetNoInactiveRootWarn(convert(CVODEMemPtr,cvode_mem)) end -function CVodeGetCurrentTime(cvode_mem::Ptr{Void},tcur::Vector{realtype}) - ccall((:CVodeGetCurrentTime,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,tcur) +function __CVodeInit(cvode_mem::CVODEMemPtr,f::CVRhsFn,t0::realtype,y0::N_Vector) + ccall((:CVodeInit,libsundials_cvode),Cint,(CVODEMemPtr,CVRhsFn,realtype,N_Vector),cvode_mem,f,t0,y0) end -function CVodeGetTolScaleFactor(cvode_mem::Ptr{Void},tolsfac::Vector{realtype}) - ccall((:CVodeGetTolScaleFactor,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,tolsfac) +function CVodeInit(cvode_mem,f,t0,y0) + __y0 = convert(NVector,y0) + __CVodeInit(convert(CVODEMemPtr,cvode_mem),CVRhsFn_wrapper(f),t0,convert(N_Vector,__y0)) end -function CVodeGetErrWeights(cvode_mem::Ptr{Void},eweight::N_Vector) - ccall((:CVodeGetErrWeights,libsundials_cvode),Cint,(Ptr{Void},N_Vector),cvode_mem,eweight) +function __CVodeReInit(cvode_mem::CVODEMemPtr,t0::realtype,y0::N_Vector) + ccall((:CVodeReInit,libsundials_cvode),Cint,(CVODEMemPtr,realtype,N_Vector),cvode_mem,t0,y0) end -function CVodeGetEstLocalErrors(cvode_mem::Ptr{Void},ele::N_Vector) - ccall((:CVodeGetEstLocalErrors,libsundials_cvode),Cint,(Ptr{Void},N_Vector),cvode_mem,ele) +function CVodeReInit(cvode_mem,t0,y0) + __y0 = convert(NVector,y0) + __CVodeReInit(convert(CVODEMemPtr,cvode_mem),t0,convert(N_Vector,__y0)) end -function CVodeGetNumGEvals(cvode_mem::Ptr{Void},ngevals::Ptr{Clong}) - ccall((:CVodeGetNumGEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,ngevals) +function __CVodeSStolerances(cvode_mem::CVODEMemPtr,reltol::realtype,abstol::realtype) + ccall((:CVodeSStolerances,libsundials_cvode),Cint,(CVODEMemPtr,realtype,realtype),cvode_mem,reltol,abstol) end -function CVodeGetRootInfo(cvode_mem::Ptr{Void},rootsfound::Ptr{Cint}) - ccall((:CVodeGetRootInfo,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,rootsfound) +function CVodeSStolerances(cvode_mem,reltol,abstol) + __CVodeSStolerances(convert(CVODEMemPtr,cvode_mem),reltol,abstol) end -function CVodeGetIntegratorStats(cvode_mem::Ptr{Void},nsteps::Ptr{Clong},nfevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Vector{realtype},hlast::Vector{realtype},hcur::Vector{realtype},tcur::Vector{realtype}) - ccall((:CVodeGetIntegratorStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),cvode_mem,nsteps,nfevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) +function __CVodeSVtolerances(cvode_mem::CVODEMemPtr,reltol::realtype,abstol::N_Vector) + ccall((:CVodeSVtolerances,libsundials_cvode),Cint,(CVODEMemPtr,realtype,N_Vector),cvode_mem,reltol,abstol) end -function CVodeGetNumNonlinSolvIters(cvode_mem::Ptr{Void},nniters::Ptr{Clong}) - ccall((:CVodeGetNumNonlinSolvIters,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nniters) +function CVodeSVtolerances(cvode_mem,reltol,abstol) + __abstol = convert(NVector,abstol) + __CVodeSVtolerances(convert(CVODEMemPtr,cvode_mem),reltol,convert(N_Vector,__abstol)) end -function CVodeGetNumNonlinSolvConvFails(cvode_mem::Ptr{Void},nncfails::Ptr{Clong}) - ccall((:CVodeGetNumNonlinSolvConvFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nncfails) +function __CVodeWFtolerances(cvode_mem::CVODEMemPtr,efun::CVEwtFn) + ccall((:CVodeWFtolerances,libsundials_cvode),Cint,(CVODEMemPtr,CVEwtFn),cvode_mem,efun) end -function CVodeGetNonlinSolvStats(cvode_mem::Ptr{Void},nniters::Ptr{Clong},nncfails::Ptr{Clong}) - ccall((:CVodeGetNonlinSolvStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,nniters,nncfails) +function CVodeWFtolerances(cvode_mem,efun) + __CVodeWFtolerances(convert(CVODEMemPtr,cvode_mem),efun) end -function CVodeGetReturnFlagName(flag::Int) - ccall((:CVodeGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +function __CVodeRootInit(cvode_mem::CVODEMemPtr,nrtfn::Cint,g::CVRootFn) + ccall((:CVodeRootInit,libsundials_cvode),Cint,(CVODEMemPtr,Cint,CVRootFn),cvode_mem,nrtfn,g) end -function CVodeFree(cvode_mem::Vector{Ptr{Void}}) - ccall((:CVodeFree,libsundials_cvode),Void,(Ptr{Ptr{Void}},),cvode_mem) +function CVodeRootInit(cvode_mem,nrtfn,g) + __CVodeRootInit(convert(CVODEMemPtr,cvode_mem),convert(Cint,nrtfn),CVRootFn_wrapper(g)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_direct.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function __CVode(cvode_mem::CVODEMemPtr,tout::realtype,yout::N_Vector,tret::Ptr{realtype},itask::Cint) + ccall((:CVode,libsundials_cvode),Cint,(CVODEMemPtr,realtype,N_Vector,Ptr{realtype},Cint),cvode_mem,tout,yout,tret,itask) +end -function CVDlsSetDenseJacFn(cvode_mem::Ptr{Void},jac::CVDlsDenseJacFn) - ccall((:CVDlsSetDenseJacFn,libsundials_cvode),Cint,(Ptr{Void},CVDlsDenseJacFn),cvode_mem,jac) +function CVode(cvode_mem,tout,yout,tret,itask) + __yout = convert(NVector,yout) + __CVode(convert(CVODEMemPtr,cvode_mem),tout,convert(N_Vector,__yout),pointer(tret),convert(Cint,itask)) end -function CVDlsSetBandJacFn(cvode_mem::Ptr{Void},jac::CVDlsBandJacFn) - ccall((:CVDlsSetBandJacFn,libsundials_cvode),Cint,(Ptr{Void},CVDlsBandJacFn),cvode_mem,jac) +function __CVodeGetDky(cvode_mem::CVODEMemPtr,t::realtype,k::Cint,dky::N_Vector) + ccall((:CVodeGetDky,libsundials_cvode),Cint,(CVODEMemPtr,realtype,Cint,N_Vector),cvode_mem,t,k,dky) end -function CVDlsGetWorkSpace(cvode_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:CVDlsGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +function CVodeGetDky(cvode_mem,t,k,dky) + __dky = convert(NVector,dky) + __CVodeGetDky(convert(CVODEMemPtr,cvode_mem),t,convert(Cint,k),convert(N_Vector,__dky)) end -function CVDlsGetNumJacEvals(cvode_mem::Ptr{Void},njevals::Ptr{Clong}) - ccall((:CVDlsGetNumJacEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,njevals) +function __CVodeGetWorkSpace(cvode_mem::CVODEMemPtr,lenrw::Ptr{Clong},leniw::Ptr{Clong}) + ccall((:CVodeGetWorkSpace,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrw,leniw) end -function CVDlsGetNumRhsEvals(cvode_mem::Ptr{Void},nfevalsLS::Ptr{Clong}) - ccall((:CVDlsGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevalsLS) +function CVodeGetWorkSpace(cvode_mem,lenrw,leniw) + __CVodeGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrw),pointer(leniw)) end -function CVDlsGetLastFlag(cvode_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:CVDlsGetLastFlag,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,flag) +function __CVodeGetNumSteps(cvode_mem::CVODEMemPtr,nsteps::Ptr{Clong}) + ccall((:CVodeGetNumSteps,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nsteps) end -function CVDlsGetReturnFlagName(flag::Int) - ccall((:CVDlsGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +function CVodeGetNumSteps(cvode_mem,nsteps) + __CVodeGetNumSteps(convert(CVODEMemPtr,cvode_mem),pointer(nsteps)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_spils.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVSpilsSetPrecType(cvode_mem::Ptr{Void},pretype::Int) - ccall((:CVSpilsSetPrecType,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,pretype) +function __CVodeGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevals::Ptr{Clong}) + ccall((:CVodeGetNumRhsEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevals) end -function CVSpilsSetGSType(cvode_mem::Ptr{Void},gstype::Int) - ccall((:CVSpilsSetGSType,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,gstype) +function CVodeGetNumRhsEvals(cvode_mem,nfevals) + __CVodeGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevals)) end -function CVSpilsSetMaxl(cvode_mem::Ptr{Void},maxl::Int) - ccall((:CVSpilsSetMaxl,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxl) +function __CVodeGetNumLinSolvSetups(cvode_mem::CVODEMemPtr,nlinsetups::Ptr{Clong}) + ccall((:CVodeGetNumLinSolvSetups,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nlinsetups) end -function CVSpilsSetEpsLin(cvode_mem::Ptr{Void},eplifac::realtype) - ccall((:CVSpilsSetEpsLin,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,eplifac) +function CVodeGetNumLinSolvSetups(cvode_mem,nlinsetups) + __CVodeGetNumLinSolvSetups(convert(CVODEMemPtr,cvode_mem),pointer(nlinsetups)) end -function CVSpilsSetPreconditioner(cvode_mem::Ptr{Void},pset::CVSpilsPrecSetupFn,psolve::CVSpilsPrecSolveFn) - ccall((:CVSpilsSetPreconditioner,libsundials_cvode),Cint,(Ptr{Void},CVSpilsPrecSetupFn,CVSpilsPrecSolveFn),cvode_mem,pset,psolve) +function __CVodeGetNumErrTestFails(cvode_mem::CVODEMemPtr,netfails::Ptr{Clong}) + ccall((:CVodeGetNumErrTestFails,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,netfails) end -function CVSpilsSetJacTimesVecFn(cvode_mem::Ptr{Void},jtv::CVSpilsJacTimesVecFn) - ccall((:CVSpilsSetJacTimesVecFn,libsundials_cvode),Cint,(Ptr{Void},CVSpilsJacTimesVecFn),cvode_mem,jtv) +function CVodeGetNumErrTestFails(cvode_mem,netfails) + __CVodeGetNumErrTestFails(convert(CVODEMemPtr,cvode_mem),pointer(netfails)) end -function CVSpilsGetWorkSpace(cvode_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:CVSpilsGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +function __CVodeGetLastOrder(cvode_mem::CVODEMemPtr,qlast::Ptr{Cint}) + ccall((:CVodeGetLastOrder,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Cint}),cvode_mem,qlast) end -function CVSpilsGetNumPrecEvals(cvode_mem::Ptr{Void},npevals::Ptr{Clong}) - ccall((:CVSpilsGetNumPrecEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,npevals) +function CVodeGetLastOrder(cvode_mem,qlast) + __CVodeGetLastOrder(convert(CVODEMemPtr,cvode_mem),pointer(qlast)) end -function CVSpilsGetNumPrecSolves(cvode_mem::Ptr{Void},npsolves::Ptr{Clong}) - ccall((:CVSpilsGetNumPrecSolves,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,npsolves) +function __CVodeGetCurrentOrder(cvode_mem::CVODEMemPtr,qcur::Ptr{Cint}) + ccall((:CVodeGetCurrentOrder,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Cint}),cvode_mem,qcur) end -function CVSpilsGetNumLinIters(cvode_mem::Ptr{Void},nliters::Ptr{Clong}) - ccall((:CVSpilsGetNumLinIters,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nliters) +function CVodeGetCurrentOrder(cvode_mem,qcur) + __CVodeGetCurrentOrder(convert(CVODEMemPtr,cvode_mem),pointer(qcur)) end -function CVSpilsGetNumConvFails(cvode_mem::Ptr{Void},nlcfails::Ptr{Clong}) - ccall((:CVSpilsGetNumConvFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nlcfails) +function __CVodeGetNumStabLimOrderReds(cvode_mem::CVODEMemPtr,nslred::Ptr{Clong}) + ccall((:CVodeGetNumStabLimOrderReds,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nslred) end -function CVSpilsGetNumJtimesEvals(cvode_mem::Ptr{Void},njvevals::Ptr{Clong}) - ccall((:CVSpilsGetNumJtimesEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,njvevals) +function CVodeGetNumStabLimOrderReds(cvode_mem,nslred) + __CVodeGetNumStabLimOrderReds(convert(CVODEMemPtr,cvode_mem),pointer(nslred)) end -function CVSpilsGetNumRhsEvals(cvode_mem::Ptr{Void},nfevalsLS::Ptr{Clong}) - ccall((:CVSpilsGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevalsLS) +function __CVodeGetActualInitStep(cvode_mem::CVODEMemPtr,hinused::Ptr{realtype}) + ccall((:CVodeGetActualInitStep,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,hinused) end -function CVSpilsGetLastFlag(cvode_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:CVSpilsGetLastFlag,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,flag) +function CVodeGetActualInitStep(cvode_mem,hinused) + __CVodeGetActualInitStep(convert(CVODEMemPtr,cvode_mem),pointer(hinused)) end -function CVSpilsGetReturnFlagName(flag::Int) - ccall((:CVSpilsGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +function __CVodeGetLastStep(cvode_mem::CVODEMemPtr,hlast::Ptr{realtype}) + ccall((:CVodeGetLastStep,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,hlast) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_band.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVBand(cvode_mem::Ptr{Void},N::Int,mupper::Int,mlower::Int) - ccall((:CVBand,libsundials_cvode),Cint,(Ptr{Void},Clong,Clong,Clong),cvode_mem,N,mupper,mlower) +function CVodeGetLastStep(cvode_mem,hlast) + __CVodeGetLastStep(convert(CVODEMemPtr,cvode_mem),pointer(hlast)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_bandpre.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVBandPrecInit(cvode_mem::Ptr{Void},N::Int,mu::Int,ml::Int) - ccall((:CVBandPrecInit,libsundials_cvode),Cint,(Ptr{Void},Clong,Clong,Clong),cvode_mem,N,mu,ml) +function __CVodeGetCurrentStep(cvode_mem::CVODEMemPtr,hcur::Ptr{realtype}) + ccall((:CVodeGetCurrentStep,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,hcur) end -function CVBandPrecGetWorkSpace(cvode_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:CVBandPrecGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +function CVodeGetCurrentStep(cvode_mem,hcur) + __CVodeGetCurrentStep(convert(CVODEMemPtr,cvode_mem),pointer(hcur)) end -function CVBandPrecGetNumRhsEvals(cvode_mem::Ptr{Void},nfevalsBP::Ptr{Clong}) - ccall((:CVBandPrecGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevalsBP) +function __CVodeGetCurrentTime(cvode_mem::CVODEMemPtr,tcur::Ptr{realtype}) + ccall((:CVodeGetCurrentTime,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,tcur) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_bbdpre.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function CVodeGetCurrentTime(cvode_mem,tcur) + __CVodeGetCurrentTime(convert(CVODEMemPtr,cvode_mem),pointer(tcur)) +end +function __CVodeGetTolScaleFactor(cvode_mem::CVODEMemPtr,tolsfac::Ptr{realtype}) + ccall((:CVodeGetTolScaleFactor,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,tolsfac) +end -function CVBBDPrecInit(cvode_mem::Ptr{Void},Nlocal::Int,mudq::Int,mldq::Int,mukeep::Int,mlkeep::Int,dqrely::realtype,gloc::CVLocalFn,cfn::CVCommFn) - ccall((:CVBBDPrecInit,libsundials_cvode),Cint,(Ptr{Void},Clong,Clong,Clong,Clong,Clong,realtype,CVLocalFn,CVCommFn),cvode_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dqrely,gloc,cfn) +function CVodeGetTolScaleFactor(cvode_mem,tolsfac) + __CVodeGetTolScaleFactor(convert(CVODEMemPtr,cvode_mem),pointer(tolsfac)) end -function CVBBDPrecReInit(cvode_mem::Ptr{Void},mudq::Int,mldq::Int,dqrely::realtype) - ccall((:CVBBDPrecReInit,libsundials_cvode),Cint,(Ptr{Void},Clong,Clong,realtype),cvode_mem,mudq,mldq,dqrely) +function __CVodeGetErrWeights(cvode_mem::CVODEMemPtr,eweight::N_Vector) + ccall((:CVodeGetErrWeights,libsundials_cvode),Cint,(CVODEMemPtr,N_Vector),cvode_mem,eweight) end -function CVBBDPrecGetWorkSpace(cvode_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:CVBBDPrecGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +function CVodeGetErrWeights(cvode_mem,eweight) + __eweight = convert(NVector,eweight) + __CVodeGetErrWeights(convert(CVODEMemPtr,cvode_mem),convert(N_Vector,__eweight)) end -function CVBBDPrecGetNumGfnEvals(cvode_mem::Ptr{Void},ngevalsBBDP::Ptr{Clong}) - ccall((:CVBBDPrecGetNumGfnEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,ngevalsBBDP) +function __CVodeGetEstLocalErrors(cvode_mem::CVODEMemPtr,ele::N_Vector) + ccall((:CVodeGetEstLocalErrors,libsundials_cvode),Cint,(CVODEMemPtr,N_Vector),cvode_mem,ele) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_dense.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVDense(cvode_mem::Ptr{Void},N::Int) - ccall((:CVDense,libsundials_cvode),Cint,(Ptr{Void},Clong),cvode_mem,N) +function CVodeGetEstLocalErrors(cvode_mem,ele) + __ele = convert(NVector,ele) + __CVodeGetEstLocalErrors(convert(CVODEMemPtr,cvode_mem),convert(N_Vector,__ele)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_diag.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function __CVodeGetNumGEvals(cvode_mem::CVODEMemPtr,ngevals::Ptr{Clong}) + ccall((:CVodeGetNumGEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,ngevals) +end -function CVDiag(cvode_mem::Ptr{Void}) - ccall((:CVDiag,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) +function CVodeGetNumGEvals(cvode_mem,ngevals) + __CVodeGetNumGEvals(convert(CVODEMemPtr,cvode_mem),pointer(ngevals)) end -function CVDiagGetWorkSpace(cvode_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:CVDiagGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +function __CVodeGetRootInfo(cvode_mem::CVODEMemPtr,rootsfound::Ptr{Cint}) + ccall((:CVodeGetRootInfo,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Cint}),cvode_mem,rootsfound) end -function CVDiagGetNumRhsEvals(cvode_mem::Ptr{Void},nfevalsLS::Ptr{Clong}) - ccall((:CVDiagGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevalsLS) +function CVodeGetRootInfo(cvode_mem,rootsfound) + __CVodeGetRootInfo(convert(CVODEMemPtr,cvode_mem),pointer(rootsfound)) end -function CVDiagGetLastFlag(cvode_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:CVDiagGetLastFlag,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,flag) +function __CVodeGetIntegratorStats(cvode_mem::CVODEMemPtr,nsteps::Ptr{Clong},nfevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Ptr{realtype},hlast::Ptr{realtype},hcur::Ptr{realtype},tcur::Ptr{realtype}) + ccall((:CVodeGetIntegratorStats,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),cvode_mem,nsteps,nfevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) end -function CVDiagGetReturnFlagName(flag::Int) - ccall((:CVDiagGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +function CVodeGetIntegratorStats(cvode_mem,nsteps,nfevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) + __CVodeGetIntegratorStats(convert(CVODEMemPtr,cvode_mem),pointer(nsteps),pointer(nfevals),pointer(nlinsetups),pointer(netfails),pointer(qlast),pointer(qcur),pointer(hinused),pointer(hlast),pointer(hcur),pointer(tcur)) +end + +function __CVodeGetNumNonlinSolvIters(cvode_mem::CVODEMemPtr,nniters::Ptr{Clong}) + ccall((:CVodeGetNumNonlinSolvIters,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nniters) +end + +function CVodeGetNumNonlinSolvIters(cvode_mem,nniters) + __CVodeGetNumNonlinSolvIters(convert(CVODEMemPtr,cvode_mem),pointer(nniters)) +end + +function __CVodeGetNumNonlinSolvConvFails(cvode_mem::CVODEMemPtr,nncfails::Ptr{Clong}) + ccall((:CVodeGetNumNonlinSolvConvFails,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nncfails) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_impl.h + +function CVodeGetNumNonlinSolvConvFails(cvode_mem,nncfails) + __CVodeGetNumNonlinSolvConvFails(convert(CVODEMemPtr,cvode_mem),pointer(nncfails)) +end + +function __CVodeGetNonlinSolvStats(cvode_mem::CVODEMemPtr,nniters::Ptr{Clong},nncfails::Ptr{Clong}) + ccall((:CVodeGetNonlinSolvStats,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,nniters,nncfails) +end + +function CVodeGetNonlinSolvStats(cvode_mem,nniters,nncfails) + __CVodeGetNonlinSolvStats(convert(CVODEMemPtr,cvode_mem),pointer(nniters),pointer(nncfails)) +end + +function __CVodeGetReturnFlagName(flag::Clong) + ccall((:CVodeGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +end + +function CVodeGetReturnFlagName(flag) + __CVodeGetReturnFlagName(convert(Clong,flag)) +end + +function CVodeFree(cvode_mem::Ref{CVODEMemPtr}) + ccall((:CVodeFree,libsundials_cvode),Void,(Ref{CVODEMemPtr},),cvode_mem) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_direct.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVodeCreate(lmm::Int,iter::Int) - ccall((:CVodeCreate,libsundials_cvode),Ptr{Void},(Cint,Cint),lmm,iter) + +function __CVDlsSetDenseJacFn(cvode_mem::CVODEMemPtr,jac::CVDlsDenseJacFn) + ccall((:CVDlsSetDenseJacFn,libsundials_cvode),Cint,(CVODEMemPtr,CVDlsDenseJacFn),cvode_mem,jac) end -function CVodeSetErrHandlerFn(cvode_mem::Ptr{Void},ehfun::CVErrHandlerFn,eh_data::Ptr{Void}) - ccall((:CVodeSetErrHandlerFn,libsundials_cvode),Cint,(Ptr{Void},CVErrHandlerFn,Ptr{Void}),cvode_mem,ehfun,eh_data) +function CVDlsSetDenseJacFn(cvode_mem,jac) + __CVDlsSetDenseJacFn(convert(CVODEMemPtr,cvode_mem),jac) end -function CVodeSetErrFile(cvode_mem::Ptr{Void},errfp::Ptr{Void}) - ccall((:CVodeSetErrFile,libsundials_cvode),Cint,(Ptr{Void},Ptr{Void}),cvode_mem,errfp) +function __CVDlsSetBandJacFn(cvode_mem::CVODEMemPtr,jac::CVDlsBandJacFn) + ccall((:CVDlsSetBandJacFn,libsundials_cvode),Cint,(CVODEMemPtr,CVDlsBandJacFn),cvode_mem,jac) end -function CVodeSetUserData(cvode_mem::Ptr{Void},user_data::Ptr{Void}) - ccall((:CVodeSetUserData,libsundials_cvode),Cint,(Ptr{Void},Ptr{Void}),cvode_mem,user_data) +function CVDlsSetBandJacFn(cvode_mem,jac) + __CVDlsSetBandJacFn(convert(CVODEMemPtr,cvode_mem),jac) end -function CVodeSetMaxOrd(cvode_mem::Ptr{Void},maxord::Int) - ccall((:CVodeSetMaxOrd,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxord) +function __CVDlsGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:CVDlsGetWorkSpace,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) end -function CVodeSetMaxNumSteps(cvode_mem::Ptr{Void},mxsteps::Int) - ccall((:CVodeSetMaxNumSteps,libsundials_cvode),Cint,(Ptr{Void},Clong),cvode_mem,mxsteps) +function CVDlsGetWorkSpace(cvode_mem,lenrwLS,leniwLS) + __CVDlsGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwLS),pointer(leniwLS)) end -function CVodeSetMaxHnilWarns(cvode_mem::Ptr{Void},mxhnil::Int) - ccall((:CVodeSetMaxHnilWarns,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,mxhnil) +function __CVDlsGetNumJacEvals(cvode_mem::CVODEMemPtr,njevals::Ptr{Clong}) + ccall((:CVDlsGetNumJacEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,njevals) end -function CVodeSetStabLimDet(cvode_mem::Ptr{Void},stldet::Int) - ccall((:CVodeSetStabLimDet,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,stldet) +function CVDlsGetNumJacEvals(cvode_mem,njevals) + __CVDlsGetNumJacEvals(convert(CVODEMemPtr,cvode_mem),pointer(njevals)) end -function CVodeSetInitStep(cvode_mem::Ptr{Void},hin::realtype) - ccall((:CVodeSetInitStep,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,hin) +function __CVDlsGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevalsLS::Ptr{Clong}) + ccall((:CVDlsGetNumRhsEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevalsLS) end -function CVodeSetMinStep(cvode_mem::Ptr{Void},hmin::realtype) - ccall((:CVodeSetMinStep,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,hmin) +function CVDlsGetNumRhsEvals(cvode_mem,nfevalsLS) + __CVDlsGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevalsLS)) end -function CVodeSetMaxStep(cvode_mem::Ptr{Void},hmax::realtype) - ccall((:CVodeSetMaxStep,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,hmax) +function __CVDlsGetLastFlag(cvode_mem::CVODEMemPtr,flag::Ptr{Clong}) + ccall((:CVDlsGetLastFlag,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,flag) end -function CVodeSetStopTime(cvode_mem::Ptr{Void},tstop::realtype) - ccall((:CVodeSetStopTime,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,tstop) +function CVDlsGetLastFlag(cvode_mem,flag) + __CVDlsGetLastFlag(convert(CVODEMemPtr,cvode_mem),pointer(flag)) end -function CVodeSetMaxErrTestFails(cvode_mem::Ptr{Void},maxnef::Int) - ccall((:CVodeSetMaxErrTestFails,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxnef) +function __CVDlsGetReturnFlagName(flag::Clong) + ccall((:CVDlsGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) end -function CVodeSetMaxNonlinIters(cvode_mem::Ptr{Void},maxcor::Int) - ccall((:CVodeSetMaxNonlinIters,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxcor) +function CVDlsGetReturnFlagName(flag) + __CVDlsGetReturnFlagName(convert(Clong,flag)) end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_spils.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVodeSetMaxConvFails(cvode_mem::Ptr{Void},maxncf::Int) - ccall((:CVodeSetMaxConvFails,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxncf) + +function __CVSpilsSetPrecType(cvode_mem::CVODEMemPtr,pretype::Cint) + ccall((:CVSpilsSetPrecType,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,pretype) end -function CVodeSetNonlinConvCoef(cvode_mem::Ptr{Void},nlscoef::realtype) - ccall((:CVodeSetNonlinConvCoef,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,nlscoef) +function CVSpilsSetPrecType(cvode_mem,pretype) + __CVSpilsSetPrecType(convert(CVODEMemPtr,cvode_mem),convert(Cint,pretype)) end -function CVodeSetIterType(cvode_mem::Ptr{Void},iter::Int) - ccall((:CVodeSetIterType,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,iter) +function __CVSpilsSetGSType(cvode_mem::CVODEMemPtr,gstype::Cint) + ccall((:CVSpilsSetGSType,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,gstype) end -function CVodeSetRootDirection(cvode_mem::Ptr{Void},rootdir::Ptr{Cint}) - ccall((:CVodeSetRootDirection,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,rootdir) +function CVSpilsSetGSType(cvode_mem,gstype) + __CVSpilsSetGSType(convert(CVODEMemPtr,cvode_mem),convert(Cint,gstype)) end -function CVodeSetNoInactiveRootWarn(cvode_mem::Ptr{Void}) - ccall((:CVodeSetNoInactiveRootWarn,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) +function __CVSpilsSetMaxl(cvode_mem::CVODEMemPtr,maxl::Cint) + ccall((:CVSpilsSetMaxl,libsundials_cvode),Cint,(CVODEMemPtr,Cint),cvode_mem,maxl) end -function CVodeInit(cvode_mem::Ptr{Void},f::CVRhsFn,t0::realtype,y0::N_Vector) - ccall((:CVodeInit,libsundials_cvode),Cint,(Ptr{Void},CVRhsFn,realtype,N_Vector),cvode_mem,f,t0,y0) +function CVSpilsSetMaxl(cvode_mem,maxl) + __CVSpilsSetMaxl(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxl)) end -function CVodeReInit(cvode_mem::Ptr{Void},t0::realtype,y0::N_Vector) - ccall((:CVodeReInit,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector),cvode_mem,t0,y0) +function __CVSpilsSetEpsLin(cvode_mem::CVODEMemPtr,eplifac::realtype) + ccall((:CVSpilsSetEpsLin,libsundials_cvode),Cint,(CVODEMemPtr,realtype),cvode_mem,eplifac) end -function CVodeSStolerances(cvode_mem::Ptr{Void},reltol::realtype,abstol::realtype) - ccall((:CVodeSStolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,realtype),cvode_mem,reltol,abstol) +function CVSpilsSetEpsLin(cvode_mem,eplifac) + __CVSpilsSetEpsLin(convert(CVODEMemPtr,cvode_mem),eplifac) end -function CVodeSVtolerances(cvode_mem::Ptr{Void},reltol::realtype,abstol::N_Vector) - ccall((:CVodeSVtolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector),cvode_mem,reltol,abstol) +function __CVSpilsSetPreconditioner(cvode_mem::CVODEMemPtr,pset::CVSpilsPrecSetupFn,psolve::CVSpilsPrecSolveFn) + ccall((:CVSpilsSetPreconditioner,libsundials_cvode),Cint,(CVODEMemPtr,CVSpilsPrecSetupFn,CVSpilsPrecSolveFn),cvode_mem,pset,psolve) end -function CVodeWFtolerances(cvode_mem::Ptr{Void},efun::CVEwtFn) - ccall((:CVodeWFtolerances,libsundials_cvode),Cint,(Ptr{Void},CVEwtFn),cvode_mem,efun) +function CVSpilsSetPreconditioner(cvode_mem,pset,psolve) + __CVSpilsSetPreconditioner(convert(CVODEMemPtr,cvode_mem),pset,psolve) end -function CVodeRootInit(cvode_mem::Ptr{Void},nrtfn::Int,g::CVRootFn) - ccall((:CVodeRootInit,libsundials_cvode),Cint,(Ptr{Void},Cint,CVRootFn),cvode_mem,nrtfn,g) +function __CVSpilsSetJacTimesVecFn(cvode_mem::CVODEMemPtr,jtv::CVSpilsJacTimesVecFn) + ccall((:CVSpilsSetJacTimesVecFn,libsundials_cvode),Cint,(CVODEMemPtr,CVSpilsJacTimesVecFn),cvode_mem,jtv) end -function CVode(cvode_mem::Ptr{Void},tout::realtype,yout::N_Vector,tret::Vector{realtype},itask::Int) - ccall((:CVode,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector,Ptr{realtype},Cint),cvode_mem,tout,yout,tret,itask) +function CVSpilsSetJacTimesVecFn(cvode_mem,jtv) + __CVSpilsSetJacTimesVecFn(convert(CVODEMemPtr,cvode_mem),jtv) end -function CVodeGetDky(cvode_mem::Ptr{Void},t::realtype,k::Int,dky::N_Vector) - ccall((:CVodeGetDky,libsundials_cvode),Cint,(Ptr{Void},realtype,Cint,N_Vector),cvode_mem,t,k,dky) +function __CVSpilsGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:CVSpilsGetWorkSpace,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) end -function CVodeGetWorkSpace(cvode_mem::Ptr{Void},lenrw::Ptr{Clong},leniw::Ptr{Clong}) - ccall((:CVodeGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrw,leniw) +function CVSpilsGetWorkSpace(cvode_mem,lenrwLS,leniwLS) + __CVSpilsGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwLS),pointer(leniwLS)) end -function CVodeGetNumSteps(cvode_mem::Ptr{Void},nsteps::Ptr{Clong}) - ccall((:CVodeGetNumSteps,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nsteps) +function __CVSpilsGetNumPrecEvals(cvode_mem::CVODEMemPtr,npevals::Ptr{Clong}) + ccall((:CVSpilsGetNumPrecEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,npevals) end -function CVodeGetNumRhsEvals(cvode_mem::Ptr{Void},nfevals::Ptr{Clong}) - ccall((:CVodeGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevals) +function CVSpilsGetNumPrecEvals(cvode_mem,npevals) + __CVSpilsGetNumPrecEvals(convert(CVODEMemPtr,cvode_mem),pointer(npevals)) end -function CVodeGetNumLinSolvSetups(cvode_mem::Ptr{Void},nlinsetups::Ptr{Clong}) - ccall((:CVodeGetNumLinSolvSetups,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nlinsetups) +function __CVSpilsGetNumPrecSolves(cvode_mem::CVODEMemPtr,npsolves::Ptr{Clong}) + ccall((:CVSpilsGetNumPrecSolves,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,npsolves) end -function CVodeGetNumErrTestFails(cvode_mem::Ptr{Void},netfails::Ptr{Clong}) - ccall((:CVodeGetNumErrTestFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,netfails) +function CVSpilsGetNumPrecSolves(cvode_mem,npsolves) + __CVSpilsGetNumPrecSolves(convert(CVODEMemPtr,cvode_mem),pointer(npsolves)) end -function CVodeGetLastOrder(cvode_mem::Ptr{Void},qlast::Ptr{Cint}) - ccall((:CVodeGetLastOrder,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,qlast) +function __CVSpilsGetNumLinIters(cvode_mem::CVODEMemPtr,nliters::Ptr{Clong}) + ccall((:CVSpilsGetNumLinIters,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nliters) end -function CVodeGetCurrentOrder(cvode_mem::Ptr{Void},qcur::Ptr{Cint}) - ccall((:CVodeGetCurrentOrder,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,qcur) +function CVSpilsGetNumLinIters(cvode_mem,nliters) + __CVSpilsGetNumLinIters(convert(CVODEMemPtr,cvode_mem),pointer(nliters)) end -function CVodeGetNumStabLimOrderReds(cvode_mem::Ptr{Void},nslred::Ptr{Clong}) - ccall((:CVodeGetNumStabLimOrderReds,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nslred) +function __CVSpilsGetNumConvFails(cvode_mem::CVODEMemPtr,nlcfails::Ptr{Clong}) + ccall((:CVSpilsGetNumConvFails,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nlcfails) end -function CVodeGetActualInitStep(cvode_mem::Ptr{Void},hinused::Vector{realtype}) - ccall((:CVodeGetActualInitStep,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,hinused) +function CVSpilsGetNumConvFails(cvode_mem,nlcfails) + __CVSpilsGetNumConvFails(convert(CVODEMemPtr,cvode_mem),pointer(nlcfails)) end -function CVodeGetLastStep(cvode_mem::Ptr{Void},hlast::Vector{realtype}) - ccall((:CVodeGetLastStep,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,hlast) +function __CVSpilsGetNumJtimesEvals(cvode_mem::CVODEMemPtr,njvevals::Ptr{Clong}) + ccall((:CVSpilsGetNumJtimesEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,njvevals) end -function CVodeGetCurrentStep(cvode_mem::Ptr{Void},hcur::Vector{realtype}) - ccall((:CVodeGetCurrentStep,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,hcur) +function CVSpilsGetNumJtimesEvals(cvode_mem,njvevals) + __CVSpilsGetNumJtimesEvals(convert(CVODEMemPtr,cvode_mem),pointer(njvevals)) end -function CVodeGetCurrentTime(cvode_mem::Ptr{Void},tcur::Vector{realtype}) - ccall((:CVodeGetCurrentTime,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,tcur) +function __CVSpilsGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevalsLS::Ptr{Clong}) + ccall((:CVSpilsGetNumRhsEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevalsLS) end -function CVodeGetTolScaleFactor(cvode_mem::Ptr{Void},tolsfac::Vector{realtype}) - ccall((:CVodeGetTolScaleFactor,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,tolsfac) +function CVSpilsGetNumRhsEvals(cvode_mem,nfevalsLS) + __CVSpilsGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevalsLS)) end -function CVodeGetErrWeights(cvode_mem::Ptr{Void},eweight::N_Vector) - ccall((:CVodeGetErrWeights,libsundials_cvode),Cint,(Ptr{Void},N_Vector),cvode_mem,eweight) +function __CVSpilsGetLastFlag(cvode_mem::CVODEMemPtr,flag::Ptr{Clong}) + ccall((:CVSpilsGetLastFlag,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,flag) end -function CVodeGetEstLocalErrors(cvode_mem::Ptr{Void},ele::N_Vector) - ccall((:CVodeGetEstLocalErrors,libsundials_cvode),Cint,(Ptr{Void},N_Vector),cvode_mem,ele) +function CVSpilsGetLastFlag(cvode_mem,flag) + __CVSpilsGetLastFlag(convert(CVODEMemPtr,cvode_mem),pointer(flag)) end -function CVodeGetNumGEvals(cvode_mem::Ptr{Void},ngevals::Ptr{Clong}) - ccall((:CVodeGetNumGEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,ngevals) +function __CVSpilsGetReturnFlagName(flag::Clong) + ccall((:CVSpilsGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) end -function CVodeGetRootInfo(cvode_mem::Ptr{Void},rootsfound::Ptr{Cint}) - ccall((:CVodeGetRootInfo,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,rootsfound) +function CVSpilsGetReturnFlagName(flag) + __CVSpilsGetReturnFlagName(convert(Clong,flag)) end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_band.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVodeGetIntegratorStats(cvode_mem::Ptr{Void},nsteps::Ptr{Clong},nfevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Vector{realtype},hlast::Vector{realtype},hcur::Vector{realtype},tcur::Vector{realtype}) - ccall((:CVodeGetIntegratorStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),cvode_mem,nsteps,nfevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) + +function __CVBand(cvode_mem::CVODEMemPtr,N::Clong,mupper::Clong,mlower::Clong) + ccall((:CVBand,libsundials_cvode),Cint,(CVODEMemPtr,Clong,Clong,Clong),cvode_mem,N,mupper,mlower) end -function CVodeGetNumNonlinSolvIters(cvode_mem::Ptr{Void},nniters::Ptr{Clong}) - ccall((:CVodeGetNumNonlinSolvIters,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nniters) +function CVBand(cvode_mem,N,mupper,mlower) + __CVBand(convert(CVODEMemPtr,cvode_mem),convert(Clong,N),convert(Clong,mupper),convert(Clong,mlower)) end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_bandpre.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVodeGetNumNonlinSolvConvFails(cvode_mem::Ptr{Void},nncfails::Ptr{Clong}) - ccall((:CVodeGetNumNonlinSolvConvFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nncfails) + +function __CVBandPrecInit(cvode_mem::CVODEMemPtr,N::Clong,mu::Clong,ml::Clong) + ccall((:CVBandPrecInit,libsundials_cvode),Cint,(CVODEMemPtr,Clong,Clong,Clong),cvode_mem,N,mu,ml) end -function CVodeGetNonlinSolvStats(cvode_mem::Ptr{Void},nniters::Ptr{Clong},nncfails::Ptr{Clong}) - ccall((:CVodeGetNonlinSolvStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,nniters,nncfails) +function CVBandPrecInit(cvode_mem,N,mu,ml) + __CVBandPrecInit(convert(CVODEMemPtr,cvode_mem),convert(Clong,N),convert(Clong,mu),convert(Clong,ml)) end -function CVodeGetReturnFlagName(flag::Int) - ccall((:CVodeGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +function __CVBandPrecGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:CVBandPrecGetWorkSpace,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) end -function CVodeFree(cvode_mem::Vector{Ptr{Void}}) - ccall((:CVodeFree,libsundials_cvode),Void,(Ptr{Ptr{Void}},),cvode_mem) +function CVBandPrecGetWorkSpace(cvode_mem,lenrwLS,leniwLS) + __CVBandPrecGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwLS),pointer(leniwLS)) end -function CVEwtSet(ycur::N_Vector,weight::N_Vector,data::Ptr{Void}) - ccall((:CVEwtSet,libsundials_cvode),Cint,(N_Vector,N_Vector,Ptr{Void}),ycur,weight,data) +function __CVBandPrecGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevalsBP::Ptr{Clong}) + ccall((:CVBandPrecGetNumRhsEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevalsBP) end -function CVErrHandler(error_code::Int,_module::Ptr{UInt8},_function::Ptr{UInt8},msg::Ptr{UInt8},data::Ptr{Void}) - ccall((:CVErrHandler,libsundials_cvode),Void,(Cint,Ptr{UInt8},Ptr{UInt8},Ptr{UInt8},Ptr{Void}),error_code,_module,_function,msg,data) +function CVBandPrecGetNumRhsEvals(cvode_mem,nfevalsBP) + __CVBandPrecGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevalsBP)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_spbcgs.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_bbdpre.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function SpbcgMalloc(l_max::Int,vec_tmpl::N_Vector) - ccall((:SpbcgMalloc,libsundials_cvode),SpbcgMem,(Cint,N_Vector),l_max,vec_tmpl) + +function __CVBBDPrecInit(cvode_mem::CVODEMemPtr,Nlocal::Clong,mudq::Clong,mldq::Clong,mukeep::Clong,mlkeep::Clong,dqrely::realtype,gloc::CVLocalFn,cfn::CVCommFn) + ccall((:CVBBDPrecInit,libsundials_cvode),Cint,(CVODEMemPtr,Clong,Clong,Clong,Clong,Clong,realtype,CVLocalFn,CVCommFn),cvode_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dqrely,gloc,cfn) +end + +function CVBBDPrecInit(cvode_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dqrely,gloc,cfn) + __CVBBDPrecInit(convert(CVODEMemPtr,cvode_mem),convert(Clong,Nlocal),convert(Clong,mudq),convert(Clong,mldq),convert(Clong,mukeep),convert(Clong,mlkeep),dqrely,gloc,cfn) +end + +function __CVBBDPrecReInit(cvode_mem::CVODEMemPtr,mudq::Clong,mldq::Clong,dqrely::realtype) + ccall((:CVBBDPrecReInit,libsundials_cvode),Cint,(CVODEMemPtr,Clong,Clong,realtype),cvode_mem,mudq,mldq,dqrely) +end + +function CVBBDPrecReInit(cvode_mem,mudq,mldq,dqrely) + __CVBBDPrecReInit(convert(CVODEMemPtr,cvode_mem),convert(Clong,mudq),convert(Clong,mldq),dqrely) +end + +function __CVBBDPrecGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:CVBBDPrecGetWorkSpace,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) end -function SpbcgSolve(mem::SpbcgMem,A_data::Ptr{Void},x::N_Vector,b::N_Vector,pretype::Int,delta::realtype,P_data::Ptr{Void},sx::N_Vector,sb::N_Vector,atimes::ATimesFn,psolve::PSolveFn,res_norm::Vector{realtype},nli::Ptr{Cint},nps::Ptr{Cint}) - ccall((:SpbcgSolve,libsundials_cvode),Cint,(SpbcgMem,Ptr{Void},N_Vector,N_Vector,Cint,realtype,Ptr{Void},N_Vector,N_Vector,ATimesFn,PSolveFn,Ptr{realtype},Ptr{Cint},Ptr{Cint}),mem,A_data,x,b,pretype,delta,P_data,sx,sb,atimes,psolve,res_norm,nli,nps) +function CVBBDPrecGetWorkSpace(cvode_mem,lenrwLS,leniwLS) + __CVBBDPrecGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwLS),pointer(leniwLS)) end -function SpbcgFree(mem::SpbcgMem) - ccall((:SpbcgFree,libsundials_cvode),Void,(SpbcgMem,),mem) +function __CVBBDPrecGetNumGfnEvals(cvode_mem::CVODEMemPtr,ngevalsBBDP::Ptr{Clong}) + ccall((:CVBBDPrecGetNumGfnEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,ngevalsBBDP) end -function CVSpbcg(cvode_mem::Ptr{Void},pretype::Int,maxl::Int) - ccall((:CVSpbcg,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,pretype,maxl) +function CVBBDPrecGetNumGfnEvals(cvode_mem,ngevalsBBDP) + __CVBBDPrecGetNumGfnEvals(convert(CVODEMemPtr,cvode_mem),pointer(ngevalsBBDP)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_spgmr.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_dense.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function SpgmrMalloc(l_max::Int,vec_tmpl::N_Vector) - ccall((:SpgmrMalloc,libsundials_cvode),SpgmrMem,(Cint,N_Vector),l_max,vec_tmpl) + +function __CVDense(cvode_mem::CVODEMemPtr,N::Clong) + ccall((:CVDense,libsundials_cvode),Cint,(CVODEMemPtr,Clong),cvode_mem,N) +end + +function CVDense(cvode_mem,N) + __CVDense(convert(CVODEMemPtr,cvode_mem),convert(Clong,N)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_diag.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + + +function __CVDiag(cvode_mem::CVODEMemPtr) + ccall((:CVDiag,libsundials_cvode),Cint,(CVODEMemPtr,),cvode_mem) end -function SpgmrSolve(mem::SpgmrMem,A_data::Ptr{Void},x::N_Vector,b::N_Vector,pretype::Int,gstype::Int,delta::realtype,max_restarts::Int,P_data::Ptr{Void},s1::N_Vector,s2::N_Vector,atimes::ATimesFn,psolve::PSolveFn,res_norm::Vector{realtype},nli::Ptr{Cint},nps::Ptr{Cint}) - ccall((:SpgmrSolve,libsundials_cvode),Cint,(SpgmrMem,Ptr{Void},N_Vector,N_Vector,Cint,Cint,realtype,Cint,Ptr{Void},N_Vector,N_Vector,ATimesFn,PSolveFn,Ptr{realtype},Ptr{Cint},Ptr{Cint}),mem,A_data,x,b,pretype,gstype,delta,max_restarts,P_data,s1,s2,atimes,psolve,res_norm,nli,nps) +function CVDiag(cvode_mem) + __CVDiag(convert(CVODEMemPtr,cvode_mem)) end -function SpgmrFree(mem::SpgmrMem) - ccall((:SpgmrFree,libsundials_cvode),Void,(SpgmrMem,),mem) +function __CVDiagGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:CVDiagGetWorkSpace,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) end -function CVSpgmr(cvode_mem::Ptr{Void},pretype::Int,maxl::Int) - ccall((:CVSpgmr,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,pretype,maxl) +function CVDiagGetWorkSpace(cvode_mem,lenrwLS,leniwLS) + __CVDiagGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwLS),pointer(leniwLS)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvode/cvode_sptfqmr.h + +function __CVDiagGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevalsLS::Ptr{Clong}) + ccall((:CVDiagGetNumRhsEvals,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevalsLS) +end + +function CVDiagGetNumRhsEvals(cvode_mem,nfevalsLS) + __CVDiagGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevalsLS)) +end + +function __CVDiagGetLastFlag(cvode_mem::CVODEMemPtr,flag::Ptr{Clong}) + ccall((:CVDiagGetLastFlag,libsundials_cvode),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,flag) +end + +function CVDiagGetLastFlag(cvode_mem,flag) + __CVDiagGetLastFlag(convert(CVODEMemPtr,cvode_mem),pointer(flag)) +end + +function __CVDiagGetReturnFlagName(flag::Clong) + ccall((:CVDiagGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +end + +function CVDiagGetReturnFlagName(flag) + __CVDiagGetReturnFlagName(convert(Clong,flag)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_impl.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_spbcgs.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + + +function __CVSpbcg(cvode_mem::CVODEMemPtr,pretype::Cint,maxl::Cint) + ccall((:CVSpbcg,libsundials_cvode),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,pretype,maxl) +end + +function CVSpbcg(cvode_mem,pretype,maxl) + __CVSpbcg(convert(CVODEMemPtr,cvode_mem),convert(Cint,pretype),convert(Cint,maxl)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_spgmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function SptfqmrMalloc(l_max::Int,vec_tmpl::N_Vector) - ccall((:SptfqmrMalloc,libsundials_cvode),SptfqmrMem,(Cint,N_Vector),l_max,vec_tmpl) +function __CVSpgmr(cvode_mem::CVODEMemPtr,pretype::Cint,maxl::Cint) + ccall((:CVSpgmr,libsundials_cvode),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,pretype,maxl) end -function SptfqmrSolve(mem::SptfqmrMem,A_data::Ptr{Void},x::N_Vector,b::N_Vector,pretype::Int,delta::realtype,P_data::Ptr{Void},sx::N_Vector,sb::N_Vector,atimes::ATimesFn,psolve::PSolveFn,res_norm::Vector{realtype},nli::Ptr{Cint},nps::Ptr{Cint}) - ccall((:SptfqmrSolve,libsundials_cvode),Cint,(SptfqmrMem,Ptr{Void},N_Vector,N_Vector,Cint,realtype,Ptr{Void},N_Vector,N_Vector,ATimesFn,PSolveFn,Ptr{realtype},Ptr{Cint},Ptr{Cint}),mem,A_data,x,b,pretype,delta,P_data,sx,sb,atimes,psolve,res_norm,nli,nps) +function CVSpgmr(cvode_mem,pretype,maxl) + __CVSpgmr(convert(CVODEMemPtr,cvode_mem),convert(Cint,pretype),convert(Cint,maxl)) end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvode/cvode_sptfqmr.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + -function SptfqmrFree(mem::SptfqmrMem) - ccall((:SptfqmrFree,libsundials_cvode),Void,(SptfqmrMem,),mem) +function __CVSptfqmr(cvode_mem::CVODEMemPtr,pretype::Cint,maxl::Cint) + ccall((:CVSptfqmr,libsundials_cvode),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,pretype,maxl) end -function CVSptfqmr(cvode_mem::Ptr{Void},pretype::Int,maxl::Int) - ccall((:CVSptfqmr,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,pretype,maxl) +function CVSptfqmr(cvode_mem,pretype,maxl) + __CVSptfqmr(convert(CVODEMemPtr,cvode_mem),convert(Cint,pretype),convert(Cint,maxl)) end diff --git a/src/cvodes.jl b/src/cvodes.jl index b828d390..fa21dbba 100644 --- a/src/cvodes.jl +++ b/src/cvodes.jl @@ -1,829 +1,1616 @@ -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVodeCreate(lmm::Int,iter::Int) - ccall((:CVodeCreate,libsundials_cvode),Ptr{Void},(Cint,Cint),lmm,iter) +function __CVodeCreate(lmm::Cint,iter::Cint) + ccall((:CVodeCreate,libsundials_cvodes),CVODEMemPtr,(Cint,Cint),lmm,iter) end -function CVodeInit(cvode_mem::Ptr{Void},f::CVRhsFn,t0::realtype,y0::N_Vector) - ccall((:CVodeInit,libsundials_cvode),Cint,(Ptr{Void},CVRhsFn,realtype,N_Vector),cvode_mem,f,t0,y0) +function CVodeCreate(lmm,iter) + __CVodeCreate(convert(Cint,lmm),convert(Cint,iter)) end -function CVodeReInit(cvode_mem::Ptr{Void},t0::realtype,y0::N_Vector) - ccall((:CVodeReInit,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector),cvode_mem,t0,y0) +function __CVodeInit(cvode_mem::CVODEMemPtr,f::CVRhsFn,t0::realtype,y0::N_Vector) + ccall((:CVodeInit,libsundials_cvodes),Cint,(CVODEMemPtr,CVRhsFn,realtype,N_Vector),cvode_mem,f,t0,y0) end -function CVodeSStolerances(cvode_mem::Ptr{Void},reltol::realtype,abstol::realtype) - ccall((:CVodeSStolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,realtype),cvode_mem,reltol,abstol) +function CVodeInit(cvode_mem,f,t0,y0) + __y0 = convert(NVector,y0) + __CVodeInit(convert(CVODEMemPtr,cvode_mem),CVRhsFn_wrapper(f),t0,convert(N_Vector,__y0)) end -function CVodeSVtolerances(cvode_mem::Ptr{Void},reltol::realtype,abstol::N_Vector) - ccall((:CVodeSVtolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector),cvode_mem,reltol,abstol) +function __CVodeReInit(cvode_mem::CVODEMemPtr,t0::realtype,y0::N_Vector) + ccall((:CVodeReInit,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,N_Vector),cvode_mem,t0,y0) end -function CVodeWFtolerances(cvode_mem::Ptr{Void},efun::CVEwtFn) - ccall((:CVodeWFtolerances,libsundials_cvode),Cint,(Ptr{Void},CVEwtFn),cvode_mem,efun) +function CVodeReInit(cvode_mem,t0,y0) + __y0 = convert(NVector,y0) + __CVodeReInit(convert(CVODEMemPtr,cvode_mem),t0,convert(N_Vector,__y0)) end -function CVodeQuadInit(cvode_mem::Ptr{Void},fQ::CVQuadRhsFn,yQ0::N_Vector) - ccall((:CVodeQuadInit,libsundials_cvode),Cint,(Ptr{Void},CVQuadRhsFn,N_Vector),cvode_mem,fQ,yQ0) +function __CVodeSStolerances(cvode_mem::CVODEMemPtr,reltol::realtype,abstol::realtype) + ccall((:CVodeSStolerances,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,realtype),cvode_mem,reltol,abstol) end -function CVodeQuadReInit(cvode_mem::Ptr{Void},yQ0::N_Vector) - ccall((:CVodeQuadReInit,libsundials_cvode),Cint,(Ptr{Void},N_Vector),cvode_mem,yQ0) +function CVodeSStolerances(cvode_mem,reltol,abstol) + __CVodeSStolerances(convert(CVODEMemPtr,cvode_mem),reltol,abstol) end -function CVodeQuadSStolerances(cvode_mem::Ptr{Void},reltolQ::realtype,abstolQ::realtype) - ccall((:CVodeQuadSStolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,realtype),cvode_mem,reltolQ,abstolQ) +function __CVodeSVtolerances(cvode_mem::CVODEMemPtr,reltol::realtype,abstol::N_Vector) + ccall((:CVodeSVtolerances,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,N_Vector),cvode_mem,reltol,abstol) end -function CVodeQuadSVtolerances(cvode_mem::Ptr{Void},reltolQ::realtype,abstolQ::N_Vector) - ccall((:CVodeQuadSVtolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector),cvode_mem,reltolQ,abstolQ) +function CVodeSVtolerances(cvode_mem,reltol,abstol) + __abstol = convert(NVector,abstol) + __CVodeSVtolerances(convert(CVODEMemPtr,cvode_mem),reltol,convert(N_Vector,__abstol)) end -function CVodeSensInit(cvode_mem::Ptr{Void},Ns::Int,ism::Int,fS::CVSensRhsFn,yS0::Ptr{N_Vector}) - ccall((:CVodeSensInit,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint,CVSensRhsFn,Ptr{N_Vector}),cvode_mem,Ns,ism,fS,yS0) +function __CVodeWFtolerances(cvode_mem::CVODEMemPtr,efun::CVEwtFn) + ccall((:CVodeWFtolerances,libsundials_cvodes),Cint,(CVODEMemPtr,CVEwtFn),cvode_mem,efun) end -function CVodeSensInit1(cvode_mem::Ptr{Void},Ns::Int,ism::Int,fS1::CVSensRhs1Fn,yS0::Ptr{N_Vector}) - ccall((:CVodeSensInit1,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint,CVSensRhs1Fn,Ptr{N_Vector}),cvode_mem,Ns,ism,fS1,yS0) +function CVodeWFtolerances(cvode_mem,efun) + __CVodeWFtolerances(convert(CVODEMemPtr,cvode_mem),efun) end -function CVodeSensReInit(cvode_mem::Ptr{Void},ism::Int,yS0::Ptr{N_Vector}) - ccall((:CVodeSensReInit,libsundials_cvode),Cint,(Ptr{Void},Cint,Ptr{N_Vector}),cvode_mem,ism,yS0) +function __CVodeQuadInit(cvode_mem::CVODEMemPtr,fQ::CVQuadRhsFn,yQ0::N_Vector) + ccall((:CVodeQuadInit,libsundials_cvodes),Cint,(CVODEMemPtr,CVQuadRhsFn,N_Vector),cvode_mem,fQ,yQ0) end -function CVodeSensSStolerances(cvode_mem::Ptr{Void},reltolS::realtype,abstolS::Vector{realtype}) - ccall((:CVodeSensSStolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,Ptr{realtype}),cvode_mem,reltolS,abstolS) +function CVodeQuadInit(cvode_mem,fQ,yQ0) + __yQ0 = convert(NVector,yQ0) + __CVodeQuadInit(convert(CVODEMemPtr,cvode_mem),fQ,convert(N_Vector,__yQ0)) end -function CVodeSensSVtolerances(cvode_mem::Ptr{Void},reltolS::realtype,abstolS::Ptr{N_Vector}) - ccall((:CVodeSensSVtolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,Ptr{N_Vector}),cvode_mem,reltolS,abstolS) +function __CVodeQuadReInit(cvode_mem::CVODEMemPtr,yQ0::N_Vector) + ccall((:CVodeQuadReInit,libsundials_cvodes),Cint,(CVODEMemPtr,N_Vector),cvode_mem,yQ0) end -function CVodeSensEEtolerances(cvode_mem::Ptr{Void}) - ccall((:CVodeSensEEtolerances,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) +function CVodeQuadReInit(cvode_mem,yQ0) + __yQ0 = convert(NVector,yQ0) + __CVodeQuadReInit(convert(CVODEMemPtr,cvode_mem),convert(N_Vector,__yQ0)) end -function CVodeQuadSensInit(cvode_mem::Ptr{Void},fQS::CVQuadSensRhsFn,yQS0::Ptr{N_Vector}) - ccall((:CVodeQuadSensInit,libsundials_cvode),Cint,(Ptr{Void},CVQuadSensRhsFn,Ptr{N_Vector}),cvode_mem,fQS,yQS0) +function __CVodeQuadSStolerances(cvode_mem::CVODEMemPtr,reltolQ::realtype,abstolQ::realtype) + ccall((:CVodeQuadSStolerances,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,realtype),cvode_mem,reltolQ,abstolQ) end -function CVodeQuadSensReInit(cvode_mem::Ptr{Void},yQS0::Ptr{N_Vector}) - ccall((:CVodeQuadSensReInit,libsundials_cvode),Cint,(Ptr{Void},Ptr{N_Vector}),cvode_mem,yQS0) +function CVodeQuadSStolerances(cvode_mem,reltolQ,abstolQ) + __CVodeQuadSStolerances(convert(CVODEMemPtr,cvode_mem),reltolQ,abstolQ) end -function CVodeQuadSensSStolerances(cvode_mem::Ptr{Void},reltolQS::realtype,abstolQS::Vector{realtype}) - ccall((:CVodeQuadSensSStolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,Ptr{realtype}),cvode_mem,reltolQS,abstolQS) +function __CVodeQuadSVtolerances(cvode_mem::CVODEMemPtr,reltolQ::realtype,abstolQ::N_Vector) + ccall((:CVodeQuadSVtolerances,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,N_Vector),cvode_mem,reltolQ,abstolQ) end -function CVodeQuadSensSVtolerances(cvode_mem::Ptr{Void},reltolQS::realtype,abstolQS::Ptr{N_Vector}) - ccall((:CVodeQuadSensSVtolerances,libsundials_cvode),Cint,(Ptr{Void},realtype,Ptr{N_Vector}),cvode_mem,reltolQS,abstolQS) +function CVodeQuadSVtolerances(cvode_mem,reltolQ,abstolQ) + __abstolQ = convert(NVector,abstolQ) + __CVodeQuadSVtolerances(convert(CVODEMemPtr,cvode_mem),reltolQ,convert(N_Vector,__abstolQ)) end -function CVodeQuadSensEEtolerances(cvode_mem::Ptr{Void}) - ccall((:CVodeQuadSensEEtolerances,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) +function __CVodeSensInit(cvode_mem::CVODEMemPtr,Ns::Cint,ism::Cint,fS::CVSensRhsFn,yS0::Ptr{N_Vector}) + ccall((:CVodeSensInit,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint,CVSensRhsFn,Ptr{N_Vector}),cvode_mem,Ns,ism,fS,yS0) end -function CVodeRootInit(cvode_mem::Ptr{Void},nrtfn::Int,g::CVRootFn) - ccall((:CVodeRootInit,libsundials_cvode),Cint,(Ptr{Void},Cint,CVRootFn),cvode_mem,nrtfn,g) +function CVodeSensInit(cvode_mem,Ns,ism,fS,yS0) + __CVodeSensInit(convert(CVODEMemPtr,cvode_mem),convert(Cint,Ns),convert(Cint,ism),fS,pointer(yS0)) end -function CVodeFree(cvode_mem::Vector{Ptr{Void}}) - ccall((:CVodeFree,libsundials_cvode),Void,(Ptr{Ptr{Void}},),cvode_mem) +function __CVodeSensInit1(cvode_mem::CVODEMemPtr,Ns::Cint,ism::Cint,fS1::CVSensRhs1Fn,yS0::Ptr{N_Vector}) + ccall((:CVodeSensInit1,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint,CVSensRhs1Fn,Ptr{N_Vector}),cvode_mem,Ns,ism,fS1,yS0) end -function CVodeQuadFree(cvode_mem::Ptr{Void}) - ccall((:CVodeQuadFree,libsundials_cvode),Void,(Ptr{Void},),cvode_mem) +function CVodeSensInit1(cvode_mem,Ns,ism,fS1,yS0) + __CVodeSensInit1(convert(CVODEMemPtr,cvode_mem),convert(Cint,Ns),convert(Cint,ism),fS1,pointer(yS0)) end -function CVodeSensFree(cvode_mem::Ptr{Void}) - ccall((:CVodeSensFree,libsundials_cvode),Void,(Ptr{Void},),cvode_mem) +function __CVodeSensReInit(cvode_mem::CVODEMemPtr,ism::Cint,yS0::Ptr{N_Vector}) + ccall((:CVodeSensReInit,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Ptr{N_Vector}),cvode_mem,ism,yS0) end -function CVodeQuadSensFree(cvode_mem::Ptr{Void}) - ccall((:CVodeQuadSensFree,libsundials_cvode),Void,(Ptr{Void},),cvode_mem) +function CVodeSensReInit(cvode_mem,ism,yS0) + __CVodeSensReInit(convert(CVODEMemPtr,cvode_mem),convert(Cint,ism),pointer(yS0)) end -function CVodeSetErrHandlerFn(cvode_mem::Ptr{Void},ehfun::CVErrHandlerFn,eh_data::Ptr{Void}) - ccall((:CVodeSetErrHandlerFn,libsundials_cvode),Cint,(Ptr{Void},CVErrHandlerFn,Ptr{Void}),cvode_mem,ehfun,eh_data) +function __CVodeSensSStolerances(cvode_mem::CVODEMemPtr,reltolS::realtype,abstolS::Ptr{realtype}) + ccall((:CVodeSensSStolerances,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Ptr{realtype}),cvode_mem,reltolS,abstolS) end -function CVodeSetErrFile(cvode_mem::Ptr{Void},errfp::Ptr{Void}) - ccall((:CVodeSetErrFile,libsundials_cvode),Cint,(Ptr{Void},Ptr{Void}),cvode_mem,errfp) +function CVodeSensSStolerances(cvode_mem,reltolS,abstolS) + __CVodeSensSStolerances(convert(CVODEMemPtr,cvode_mem),reltolS,pointer(abstolS)) end -# function CVodeSetErrFile(cvode_mem::Ptr{Void},errfp::Ptr{Void}) -# ccall((:CVodeSetErrFile,libsundials_cvode),Cint,(Ptr{Void},Ptr{Void}),cvode_mem,errfp) -# end -function CVodeSetUserData(cvode_mem::Ptr{Void},user_data::Ptr{Void}) - ccall((:CVodeSetUserData,libsundials_cvode),Cint,(Ptr{Void},Ptr{Void}),cvode_mem,user_data) +function __CVodeSensSVtolerances(cvode_mem::CVODEMemPtr,reltolS::realtype,abstolS::Ptr{N_Vector}) + ccall((:CVodeSensSVtolerances,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Ptr{N_Vector}),cvode_mem,reltolS,abstolS) end -function CVodeSetMaxOrd(cvode_mem::Ptr{Void},maxord::Int) - ccall((:CVodeSetMaxOrd,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxord) +function CVodeSensSVtolerances(cvode_mem,reltolS,abstolS) + __CVodeSensSVtolerances(convert(CVODEMemPtr,cvode_mem),reltolS,pointer(abstolS)) end -function CVodeSetMaxNumSteps(cvode_mem::Ptr{Void},mxsteps::Int) - ccall((:CVodeSetMaxNumSteps,libsundials_cvode),Cint,(Ptr{Void},Clong),cvode_mem,mxsteps) +function __CVodeSensEEtolerances(cvode_mem::CVODEMemPtr) + ccall((:CVodeSensEEtolerances,libsundials_cvodes),Cint,(CVODEMemPtr,),cvode_mem) end -function CVodeSetMaxHnilWarns(cvode_mem::Ptr{Void},mxhnil::Int) - ccall((:CVodeSetMaxHnilWarns,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,mxhnil) +function CVodeSensEEtolerances(cvode_mem) + __CVodeSensEEtolerances(convert(CVODEMemPtr,cvode_mem)) end -function CVodeSetStabLimDet(cvode_mem::Ptr{Void},stldet::Int) - ccall((:CVodeSetStabLimDet,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,stldet) +function __CVodeQuadSensInit(cvode_mem::CVODEMemPtr,fQS::CVQuadSensRhsFn,yQS0::Ptr{N_Vector}) + ccall((:CVodeQuadSensInit,libsundials_cvodes),Cint,(CVODEMemPtr,CVQuadSensRhsFn,Ptr{N_Vector}),cvode_mem,fQS,yQS0) end -function CVodeSetInitStep(cvode_mem::Ptr{Void},hin::realtype) - ccall((:CVodeSetInitStep,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,hin) +function CVodeQuadSensInit(cvode_mem,fQS,yQS0) + __CVodeQuadSensInit(convert(CVODEMemPtr,cvode_mem),fQS,pointer(yQS0)) end -function CVodeSetMinStep(cvode_mem::Ptr{Void},hmin::realtype) - ccall((:CVodeSetMinStep,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,hmin) +function __CVodeQuadSensReInit(cvode_mem::CVODEMemPtr,yQS0::Ptr{N_Vector}) + ccall((:CVodeQuadSensReInit,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{N_Vector}),cvode_mem,yQS0) end -function CVodeSetMaxStep(cvode_mem::Ptr{Void},hmax::realtype) - ccall((:CVodeSetMaxStep,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,hmax) +function CVodeQuadSensReInit(cvode_mem,yQS0) + __CVodeQuadSensReInit(convert(CVODEMemPtr,cvode_mem),pointer(yQS0)) end -function CVodeSetStopTime(cvode_mem::Ptr{Void},tstop::realtype) - ccall((:CVodeSetStopTime,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,tstop) +function __CVodeQuadSensSStolerances(cvode_mem::CVODEMemPtr,reltolQS::realtype,abstolQS::Ptr{realtype}) + ccall((:CVodeQuadSensSStolerances,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Ptr{realtype}),cvode_mem,reltolQS,abstolQS) end -function CVodeSetMaxErrTestFails(cvode_mem::Ptr{Void},maxnef::Int) - ccall((:CVodeSetMaxErrTestFails,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxnef) +function CVodeQuadSensSStolerances(cvode_mem,reltolQS,abstolQS) + __CVodeQuadSensSStolerances(convert(CVODEMemPtr,cvode_mem),reltolQS,pointer(abstolQS)) end -function CVodeSetMaxNonlinIters(cvode_mem::Ptr{Void},maxcor::Int) - ccall((:CVodeSetMaxNonlinIters,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxcor) +function __CVodeQuadSensSVtolerances(cvode_mem::CVODEMemPtr,reltolQS::realtype,abstolQS::Ptr{N_Vector}) + ccall((:CVodeQuadSensSVtolerances,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Ptr{N_Vector}),cvode_mem,reltolQS,abstolQS) end -function CVodeSetMaxConvFails(cvode_mem::Ptr{Void},maxncf::Int) - ccall((:CVodeSetMaxConvFails,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxncf) +function CVodeQuadSensSVtolerances(cvode_mem,reltolQS,abstolQS) + __CVodeQuadSensSVtolerances(convert(CVODEMemPtr,cvode_mem),reltolQS,pointer(abstolQS)) end -function CVodeSetNonlinConvCoef(cvode_mem::Ptr{Void},nlscoef::realtype) - ccall((:CVodeSetNonlinConvCoef,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,nlscoef) +function __CVodeQuadSensEEtolerances(cvode_mem::CVODEMemPtr) + ccall((:CVodeQuadSensEEtolerances,libsundials_cvodes),Cint,(CVODEMemPtr,),cvode_mem) end -function CVodeSetIterType(cvode_mem::Ptr{Void},iter::Int) - ccall((:CVodeSetIterType,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,iter) +function CVodeQuadSensEEtolerances(cvode_mem) + __CVodeQuadSensEEtolerances(convert(CVODEMemPtr,cvode_mem)) end -function CVodeSetRootDirection(cvode_mem::Ptr{Void},rootdir::Ptr{Cint}) - ccall((:CVodeSetRootDirection,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,rootdir) +function __CVodeRootInit(cvode_mem::CVODEMemPtr,nrtfn::Cint,g::CVRootFn) + ccall((:CVodeRootInit,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,CVRootFn),cvode_mem,nrtfn,g) end -function CVodeSetNoInactiveRootWarn(cvode_mem::Ptr{Void}) - ccall((:CVodeSetNoInactiveRootWarn,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) +function CVodeRootInit(cvode_mem,nrtfn,g) + __CVodeRootInit(convert(CVODEMemPtr,cvode_mem),convert(Cint,nrtfn),CVRootFn_wrapper(g)) end -function CVodeSetQuadErrCon(cvode_mem::Ptr{Void},errconQ::Int) - ccall((:CVodeSetQuadErrCon,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,errconQ) +function CVodeFree(cvode_mem::Ref{CVODEMemPtr}) + ccall((:CVodeFree,libsundials_cvodes),Void,(Ref{CVODEMemPtr},),cvode_mem) end -function CVodeSetSensDQMethod(cvode_mem::Ptr{Void},DQtype::Int,DQrhomax::realtype) - ccall((:CVodeSetSensDQMethod,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype),cvode_mem,DQtype,DQrhomax) +function __CVodeQuadFree(cvode_mem::CVODEMemPtr) + ccall((:CVodeQuadFree,libsundials_cvodes),Void,(CVODEMemPtr,),cvode_mem) end -function CVodeSetSensErrCon(cvode_mem::Ptr{Void},errconS::Int) - ccall((:CVodeSetSensErrCon,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,errconS) +function CVodeQuadFree(cvode_mem) + __CVodeQuadFree(convert(CVODEMemPtr,cvode_mem)) end -function CVodeSetSensMaxNonlinIters(cvode_mem::Ptr{Void},maxcorS::Int) - ccall((:CVodeSetSensMaxNonlinIters,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxcorS) +function __CVodeSensFree(cvode_mem::CVODEMemPtr) + ccall((:CVodeSensFree,libsundials_cvodes),Void,(CVODEMemPtr,),cvode_mem) end -function CVodeSetSensParams(cvode_mem::Ptr{Void},p::Vector{realtype},pbar::Vector{realtype},plist::Ptr{Cint}) - ccall((:CVodeSetSensParams,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype},Ptr{realtype},Ptr{Cint}),cvode_mem,p,pbar,plist) +function CVodeSensFree(cvode_mem) + __CVodeSensFree(convert(CVODEMemPtr,cvode_mem)) end -function CVodeSetQuadSensErrCon(cvode_mem::Ptr{Void},errconQS::Int) - ccall((:CVodeSetQuadSensErrCon,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,errconQS) +function __CVodeQuadSensFree(cvode_mem::CVODEMemPtr) + ccall((:CVodeQuadSensFree,libsundials_cvodes),Void,(CVODEMemPtr,),cvode_mem) end -function CVodeSensToggleOff(cvode_mem::Ptr{Void}) - ccall((:CVodeSensToggleOff,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) +function CVodeQuadSensFree(cvode_mem) + __CVodeQuadSensFree(convert(CVODEMemPtr,cvode_mem)) end -function CVode(cvode_mem::Ptr{Void},tout::realtype,yout::N_Vector,tret::Vector{realtype},itask::Int) - ccall((:CVode,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector,Ptr{realtype},Cint),cvode_mem,tout,yout,tret,itask) +function __CVodeSetErrHandlerFn(cvode_mem::CVODEMemPtr,ehfun::CVErrHandlerFn,eh_data::Ptr{Void}) + ccall((:CVodeSetErrHandlerFn,libsundials_cvodes),Cint,(CVODEMemPtr,CVErrHandlerFn,Ptr{Void}),cvode_mem,ehfun,eh_data) end -function CVodeGetDky(cvode_mem::Ptr{Void},t::realtype,k::Int,dky::N_Vector) - ccall((:CVodeGetDky,libsundials_cvode),Cint,(Ptr{Void},realtype,Cint,N_Vector),cvode_mem,t,k,dky) +function CVodeSetErrHandlerFn(cvode_mem,ehfun,eh_data) + __CVodeSetErrHandlerFn(convert(CVODEMemPtr,cvode_mem),ehfun,pointer(eh_data)) end -function CVodeGetQuad(cvode_mem::Ptr{Void},tret::Vector{realtype},yQout::N_Vector) - ccall((:CVodeGetQuad,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype},N_Vector),cvode_mem,tret,yQout) +function __CVodeSetErrFile(cvode_mem::CVODEMemPtr,errfp::Ptr{FILE}) + ccall((:CVodeSetErrFile,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{FILE}),cvode_mem,errfp) end -function CVodeGetQuadDky(cvode_mem::Ptr{Void},t::realtype,k::Int,dky::N_Vector) - ccall((:CVodeGetQuadDky,libsundials_cvode),Cint,(Ptr{Void},realtype,Cint,N_Vector),cvode_mem,t,k,dky) +function CVodeSetErrFile(cvode_mem,errfp) + __CVodeSetErrFile(convert(CVODEMemPtr,cvode_mem),errfp) end -function CVodeGetSens(cvode_mem::Ptr{Void},tret::Vector{realtype},ySout::Ptr{N_Vector}) - ccall((:CVodeGetSens,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype},Ptr{N_Vector}),cvode_mem,tret,ySout) +function __CVodeSetUserData(cvode_mem::CVODEMemPtr,user_data::Any) + ccall((:CVodeSetUserData,libsundials_cvodes),Cint,(CVODEMemPtr,Any),cvode_mem,user_data) end -function CVodeGetSens1(cvode_mem::Ptr{Void},tret::Vector{realtype},is::Int,ySout::N_Vector) - ccall((:CVodeGetSens1,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype},Cint,N_Vector),cvode_mem,tret,is,ySout) +function CVodeSetUserData(cvode_mem,user_data) + __CVodeSetUserData(convert(CVODEMemPtr,cvode_mem),user_data) end -function CVodeGetSensDky(cvode_mem::Ptr{Void},t::realtype,k::Int,dkyA::Ptr{N_Vector}) - ccall((:CVodeGetSensDky,libsundials_cvode),Cint,(Ptr{Void},realtype,Cint,Ptr{N_Vector}),cvode_mem,t,k,dkyA) +function __CVodeSetMaxOrd(cvode_mem::CVODEMemPtr,maxord::Cint) + ccall((:CVodeSetMaxOrd,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,maxord) end -function CVodeGetSensDky1(cvode_mem::Ptr{Void},t::realtype,k::Int,is::Int,dky::N_Vector) - ccall((:CVodeGetSensDky1,libsundials_cvode),Cint,(Ptr{Void},realtype,Cint,Cint,N_Vector),cvode_mem,t,k,is,dky) +function CVodeSetMaxOrd(cvode_mem,maxord) + __CVodeSetMaxOrd(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxord)) end -function CVodeGetQuadSens(cvode_mem::Ptr{Void},tret::Vector{realtype},yQSout::Ptr{N_Vector}) - ccall((:CVodeGetQuadSens,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype},Ptr{N_Vector}),cvode_mem,tret,yQSout) +function __CVodeSetMaxNumSteps(cvode_mem::CVODEMemPtr,mxsteps::Clong) + ccall((:CVodeSetMaxNumSteps,libsundials_cvodes),Cint,(CVODEMemPtr,Clong),cvode_mem,mxsteps) end -function CVodeGetQuadSens1(cvode_mem::Ptr{Void},tret::Vector{realtype},is::Int,yQSout::N_Vector) - ccall((:CVodeGetQuadSens1,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype},Cint,N_Vector),cvode_mem,tret,is,yQSout) +function CVodeSetMaxNumSteps(cvode_mem,mxsteps) + __CVodeSetMaxNumSteps(convert(CVODEMemPtr,cvode_mem),convert(Clong,mxsteps)) end -function CVodeGetQuadSensDky(cvode_mem::Ptr{Void},t::realtype,k::Int,dkyQS_all::Ptr{N_Vector}) - ccall((:CVodeGetQuadSensDky,libsundials_cvode),Cint,(Ptr{Void},realtype,Cint,Ptr{N_Vector}),cvode_mem,t,k,dkyQS_all) +function __CVodeSetMaxHnilWarns(cvode_mem::CVODEMemPtr,mxhnil::Cint) + ccall((:CVodeSetMaxHnilWarns,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,mxhnil) end -function CVodeGetQuadSensDky1(cvode_mem::Ptr{Void},t::realtype,k::Int,is::Int,dkyQS::N_Vector) - ccall((:CVodeGetQuadSensDky1,libsundials_cvode),Cint,(Ptr{Void},realtype,Cint,Cint,N_Vector),cvode_mem,t,k,is,dkyQS) +function CVodeSetMaxHnilWarns(cvode_mem,mxhnil) + __CVodeSetMaxHnilWarns(convert(CVODEMemPtr,cvode_mem),convert(Cint,mxhnil)) end -function CVodeGetWorkSpace(cvode_mem::Ptr{Void},lenrw::Ptr{Clong},leniw::Ptr{Clong}) - ccall((:CVodeGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrw,leniw) +function __CVodeSetStabLimDet(cvode_mem::CVODEMemPtr,stldet::Cint) + ccall((:CVodeSetStabLimDet,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,stldet) end -function CVodeGetNumSteps(cvode_mem::Ptr{Void},nsteps::Ptr{Clong}) - ccall((:CVodeGetNumSteps,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nsteps) +function CVodeSetStabLimDet(cvode_mem,stldet) + __CVodeSetStabLimDet(convert(CVODEMemPtr,cvode_mem),convert(Cint,stldet)) end -function CVodeGetNumRhsEvals(cvode_mem::Ptr{Void},nfevals::Ptr{Clong}) - ccall((:CVodeGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevals) +function __CVodeSetInitStep(cvode_mem::CVODEMemPtr,hin::realtype) + ccall((:CVodeSetInitStep,libsundials_cvodes),Cint,(CVODEMemPtr,realtype),cvode_mem,hin) end -function CVodeGetNumLinSolvSetups(cvode_mem::Ptr{Void},nlinsetups::Ptr{Clong}) - ccall((:CVodeGetNumLinSolvSetups,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nlinsetups) +function CVodeSetInitStep(cvode_mem,hin) + __CVodeSetInitStep(convert(CVODEMemPtr,cvode_mem),hin) end -function CVodeGetNumErrTestFails(cvode_mem::Ptr{Void},netfails::Ptr{Clong}) - ccall((:CVodeGetNumErrTestFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,netfails) +function __CVodeSetMinStep(cvode_mem::CVODEMemPtr,hmin::realtype) + ccall((:CVodeSetMinStep,libsundials_cvodes),Cint,(CVODEMemPtr,realtype),cvode_mem,hmin) end -function CVodeGetLastOrder(cvode_mem::Ptr{Void},qlast::Ptr{Cint}) - ccall((:CVodeGetLastOrder,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,qlast) +function CVodeSetMinStep(cvode_mem,hmin) + __CVodeSetMinStep(convert(CVODEMemPtr,cvode_mem),hmin) end -function CVodeGetCurrentOrder(cvode_mem::Ptr{Void},qcur::Ptr{Cint}) - ccall((:CVodeGetCurrentOrder,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,qcur) +function __CVodeSetMaxStep(cvode_mem::CVODEMemPtr,hmax::realtype) + ccall((:CVodeSetMaxStep,libsundials_cvodes),Cint,(CVODEMemPtr,realtype),cvode_mem,hmax) end -function CVodeGetNumStabLimOrderReds(cvode_mem::Ptr{Void},nslred::Ptr{Clong}) - ccall((:CVodeGetNumStabLimOrderReds,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nslred) +function CVodeSetMaxStep(cvode_mem,hmax) + __CVodeSetMaxStep(convert(CVODEMemPtr,cvode_mem),hmax) end -function CVodeGetActualInitStep(cvode_mem::Ptr{Void},hinused::Vector{realtype}) - ccall((:CVodeGetActualInitStep,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,hinused) +function __CVodeSetStopTime(cvode_mem::CVODEMemPtr,tstop::realtype) + ccall((:CVodeSetStopTime,libsundials_cvodes),Cint,(CVODEMemPtr,realtype),cvode_mem,tstop) end -function CVodeGetLastStep(cvode_mem::Ptr{Void},hlast::Vector{realtype}) - ccall((:CVodeGetLastStep,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,hlast) +function CVodeSetStopTime(cvode_mem,tstop) + __CVodeSetStopTime(convert(CVODEMemPtr,cvode_mem),tstop) end -function CVodeGetCurrentStep(cvode_mem::Ptr{Void},hcur::Vector{realtype}) - ccall((:CVodeGetCurrentStep,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,hcur) +function __CVodeSetMaxErrTestFails(cvode_mem::CVODEMemPtr,maxnef::Cint) + ccall((:CVodeSetMaxErrTestFails,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,maxnef) end -function CVodeGetCurrentTime(cvode_mem::Ptr{Void},tcur::Vector{realtype}) - ccall((:CVodeGetCurrentTime,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,tcur) +function CVodeSetMaxErrTestFails(cvode_mem,maxnef) + __CVodeSetMaxErrTestFails(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxnef)) end -function CVodeGetTolScaleFactor(cvode_mem::Ptr{Void},tolsfac::Vector{realtype}) - ccall((:CVodeGetTolScaleFactor,libsundials_cvode),Cint,(Ptr{Void},Ptr{realtype}),cvode_mem,tolsfac) +function __CVodeSetMaxNonlinIters(cvode_mem::CVODEMemPtr,maxcor::Cint) + ccall((:CVodeSetMaxNonlinIters,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,maxcor) end -function CVodeGetErrWeights(cvode_mem::Ptr{Void},eweight::N_Vector) - ccall((:CVodeGetErrWeights,libsundials_cvode),Cint,(Ptr{Void},N_Vector),cvode_mem,eweight) +function CVodeSetMaxNonlinIters(cvode_mem,maxcor) + __CVodeSetMaxNonlinIters(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxcor)) end -function CVodeGetEstLocalErrors(cvode_mem::Ptr{Void},ele::N_Vector) - ccall((:CVodeGetEstLocalErrors,libsundials_cvode),Cint,(Ptr{Void},N_Vector),cvode_mem,ele) +function __CVodeSetMaxConvFails(cvode_mem::CVODEMemPtr,maxncf::Cint) + ccall((:CVodeSetMaxConvFails,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,maxncf) end -function CVodeGetNumGEvals(cvode_mem::Ptr{Void},ngevals::Ptr{Clong}) - ccall((:CVodeGetNumGEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,ngevals) +function CVodeSetMaxConvFails(cvode_mem,maxncf) + __CVodeSetMaxConvFails(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxncf)) end -function CVodeGetRootInfo(cvode_mem::Ptr{Void},rootsfound::Ptr{Cint}) - ccall((:CVodeGetRootInfo,libsundials_cvode),Cint,(Ptr{Void},Ptr{Cint}),cvode_mem,rootsfound) +function __CVodeSetNonlinConvCoef(cvode_mem::CVODEMemPtr,nlscoef::realtype) + ccall((:CVodeSetNonlinConvCoef,libsundials_cvodes),Cint,(CVODEMemPtr,realtype),cvode_mem,nlscoef) end -function CVodeGetIntegratorStats(cvode_mem::Ptr{Void},nsteps::Ptr{Clong},nfevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Vector{realtype},hlast::Vector{realtype},hcur::Vector{realtype},tcur::Vector{realtype}) - ccall((:CVodeGetIntegratorStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),cvode_mem,nsteps,nfevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) +function CVodeSetNonlinConvCoef(cvode_mem,nlscoef) + __CVodeSetNonlinConvCoef(convert(CVODEMemPtr,cvode_mem),nlscoef) end -function CVodeGetNumNonlinSolvIters(cvode_mem::Ptr{Void},nniters::Ptr{Clong}) - ccall((:CVodeGetNumNonlinSolvIters,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nniters) +function __CVodeSetIterType(cvode_mem::CVODEMemPtr,iter::Cint) + ccall((:CVodeSetIterType,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,iter) end -function CVodeGetNumNonlinSolvConvFails(cvode_mem::Ptr{Void},nncfails::Ptr{Clong}) - ccall((:CVodeGetNumNonlinSolvConvFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nncfails) +function CVodeSetIterType(cvode_mem,iter) + __CVodeSetIterType(convert(CVODEMemPtr,cvode_mem),convert(Cint,iter)) end -function CVodeGetNonlinSolvStats(cvode_mem::Ptr{Void},nniters::Ptr{Clong},nncfails::Ptr{Clong}) - ccall((:CVodeGetNonlinSolvStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,nniters,nncfails) +function __CVodeSetRootDirection(cvode_mem::CVODEMemPtr,rootdir::Ptr{Cint}) + ccall((:CVodeSetRootDirection,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Cint}),cvode_mem,rootdir) end -function CVodeGetReturnFlagName(flag::Int) - ccall((:CVodeGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +function CVodeSetRootDirection(cvode_mem,rootdir) + __CVodeSetRootDirection(convert(CVODEMemPtr,cvode_mem),pointer(rootdir)) end -function CVodeGetQuadNumRhsEvals(cvode_mem::Ptr{Void},nfQevals::Ptr{Clong}) - ccall((:CVodeGetQuadNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfQevals) +function __CVodeSetNoInactiveRootWarn(cvode_mem::CVODEMemPtr) + ccall((:CVodeSetNoInactiveRootWarn,libsundials_cvodes),Cint,(CVODEMemPtr,),cvode_mem) end -function CVodeGetQuadNumErrTestFails(cvode_mem::Ptr{Void},nQetfails::Ptr{Clong}) - ccall((:CVodeGetQuadNumErrTestFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nQetfails) +function CVodeSetNoInactiveRootWarn(cvode_mem) + __CVodeSetNoInactiveRootWarn(convert(CVODEMemPtr,cvode_mem)) end -function CVodeGetQuadErrWeights(cvode_mem::Ptr{Void},eQweight::N_Vector) - ccall((:CVodeGetQuadErrWeights,libsundials_cvode),Cint,(Ptr{Void},N_Vector),cvode_mem,eQweight) +function __CVodeSetQuadErrCon(cvode_mem::CVODEMemPtr,errconQ::Cint) + ccall((:CVodeSetQuadErrCon,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,errconQ) end -function CVodeGetQuadStats(cvode_mem::Ptr{Void},nfQevals::Ptr{Clong},nQetfails::Ptr{Clong}) - ccall((:CVodeGetQuadStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,nfQevals,nQetfails) +function CVodeSetQuadErrCon(cvode_mem,errconQ) + __CVodeSetQuadErrCon(convert(CVODEMemPtr,cvode_mem),convert(Cint,errconQ)) end -function CVodeGetSensNumRhsEvals(cvode_mem::Ptr{Void},nfSevals::Ptr{Clong}) - ccall((:CVodeGetSensNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfSevals) +function __CVodeSetSensDQMethod(cvode_mem::CVODEMemPtr,DQtype::Cint,DQrhomax::realtype) + ccall((:CVodeSetSensDQMethod,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype),cvode_mem,DQtype,DQrhomax) end -function CVodeGetNumRhsEvalsSens(cvode_mem::Ptr{Void},nfevalsS::Ptr{Clong}) - ccall((:CVodeGetNumRhsEvalsSens,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevalsS) +function CVodeSetSensDQMethod(cvode_mem,DQtype,DQrhomax) + __CVodeSetSensDQMethod(convert(CVODEMemPtr,cvode_mem),convert(Cint,DQtype),DQrhomax) end -function CVodeGetSensNumErrTestFails(cvode_mem::Ptr{Void},nSetfails::Ptr{Clong}) - ccall((:CVodeGetSensNumErrTestFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nSetfails) +function __CVodeSetSensErrCon(cvode_mem::CVODEMemPtr,errconS::Cint) + ccall((:CVodeSetSensErrCon,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,errconS) end -function CVodeGetSensNumLinSolvSetups(cvode_mem::Ptr{Void},nlinsetupsS::Ptr{Clong}) - ccall((:CVodeGetSensNumLinSolvSetups,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nlinsetupsS) +function CVodeSetSensErrCon(cvode_mem,errconS) + __CVodeSetSensErrCon(convert(CVODEMemPtr,cvode_mem),convert(Cint,errconS)) end -function CVodeGetSensErrWeights(cvode_mem::Ptr{Void},eSweight::Ptr{N_Vector}) - ccall((:CVodeGetSensErrWeights,libsundials_cvode),Cint,(Ptr{Void},Ptr{N_Vector}),cvode_mem,eSweight) +function __CVodeSetSensMaxNonlinIters(cvode_mem::CVODEMemPtr,maxcorS::Cint) + ccall((:CVodeSetSensMaxNonlinIters,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,maxcorS) end -function CVodeGetSensStats(cvode_mem::Ptr{Void},nfSevals::Ptr{Clong},nfevalsS::Ptr{Clong},nSetfails::Ptr{Clong},nlinsetupsS::Ptr{Clong}) - ccall((:CVodeGetSensStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong}),cvode_mem,nfSevals,nfevalsS,nSetfails,nlinsetupsS) +function CVodeSetSensMaxNonlinIters(cvode_mem,maxcorS) + __CVodeSetSensMaxNonlinIters(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxcorS)) end -function CVodeGetSensNumNonlinSolvIters(cvode_mem::Ptr{Void},nSniters::Ptr{Clong}) - ccall((:CVodeGetSensNumNonlinSolvIters,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nSniters) +function __CVodeSetSensParams(cvode_mem::CVODEMemPtr,p::Ptr{realtype},pbar::Ptr{realtype},plist::Ptr{Cint}) + ccall((:CVodeSetSensParams,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype},Ptr{realtype},Ptr{Cint}),cvode_mem,p,pbar,plist) end -function CVodeGetSensNumNonlinSolvConvFails(cvode_mem::Ptr{Void},nSncfails::Ptr{Clong}) - ccall((:CVodeGetSensNumNonlinSolvConvFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nSncfails) +function CVodeSetSensParams(cvode_mem,p,pbar,plist) + __CVodeSetSensParams(convert(CVODEMemPtr,cvode_mem),pointer(p),pointer(pbar),pointer(plist)) end -function CVodeGetStgrSensNumNonlinSolvIters(cvode_mem::Ptr{Void},nSTGR1niters::Ptr{Clong}) - ccall((:CVodeGetStgrSensNumNonlinSolvIters,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nSTGR1niters) +function __CVodeSetQuadSensErrCon(cvode_mem::CVODEMemPtr,errconQS::Cint) + ccall((:CVodeSetQuadSensErrCon,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,errconQS) end -function CVodeGetStgrSensNumNonlinSolvConvFails(cvode_mem::Ptr{Void},nSTGR1ncfails::Ptr{Clong}) - ccall((:CVodeGetStgrSensNumNonlinSolvConvFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nSTGR1ncfails) +function CVodeSetQuadSensErrCon(cvode_mem,errconQS) + __CVodeSetQuadSensErrCon(convert(CVODEMemPtr,cvode_mem),convert(Cint,errconQS)) end -function CVodeGetSensNonlinSolvStats(cvode_mem::Ptr{Void},nSniters::Ptr{Clong},nSncfails::Ptr{Clong}) - ccall((:CVodeGetSensNonlinSolvStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,nSniters,nSncfails) +function __CVodeSensToggleOff(cvode_mem::CVODEMemPtr) + ccall((:CVodeSensToggleOff,libsundials_cvodes),Cint,(CVODEMemPtr,),cvode_mem) end -function CVodeGetQuadSensNumRhsEvals(cvode_mem::Ptr{Void},nfQSevals::Ptr{Clong}) - ccall((:CVodeGetQuadSensNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfQSevals) +function CVodeSensToggleOff(cvode_mem) + __CVodeSensToggleOff(convert(CVODEMemPtr,cvode_mem)) end -function CVodeGetQuadSensNumErrTestFails(cvode_mem::Ptr{Void},nQSetfails::Ptr{Clong}) - ccall((:CVodeGetQuadSensNumErrTestFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nQSetfails) +function __CVode(cvode_mem::CVODEMemPtr,tout::realtype,yout::N_Vector,tret::Ptr{realtype},itask::Cint) + ccall((:CVode,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,N_Vector,Ptr{realtype},Cint),cvode_mem,tout,yout,tret,itask) end -function CVodeGetQuadSensErrWeights(cvode_mem::Ptr{Void},eQSweight::Ptr{N_Vector}) - ccall((:CVodeGetQuadSensErrWeights,libsundials_cvode),Cint,(Ptr{Void},Ptr{N_Vector}),cvode_mem,eQSweight) +function CVode(cvode_mem,tout,yout,tret,itask) + __yout = convert(NVector,yout) + __CVode(convert(CVODEMemPtr,cvode_mem),tout,convert(N_Vector,__yout),pointer(tret),convert(Cint,itask)) end -function CVodeGetQuadSensStats(cvode_mem::Ptr{Void},nfQSevals::Ptr{Clong},nQSetfails::Ptr{Clong}) - ccall((:CVodeGetQuadSensStats,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,nfQSevals,nQSetfails) +function __CVodeGetDky(cvode_mem::CVODEMemPtr,t::realtype,k::Cint,dky::N_Vector) + ccall((:CVodeGetDky,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Cint,N_Vector),cvode_mem,t,k,dky) end -function CVodeAdjInit(cvode_mem::Ptr{Void},steps::Int,interp::Int) - ccall((:CVodeAdjInit,libsundials_cvode),Cint,(Ptr{Void},Clong,Cint),cvode_mem,steps,interp) +function CVodeGetDky(cvode_mem,t,k,dky) + __dky = convert(NVector,dky) + __CVodeGetDky(convert(CVODEMemPtr,cvode_mem),t,convert(Cint,k),convert(N_Vector,__dky)) end -function CVodeAdjReInit(cvode_mem::Ptr{Void}) - ccall((:CVodeAdjReInit,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) +function __CVodeGetQuad(cvode_mem::CVODEMemPtr,tret::Ptr{realtype},yQout::N_Vector) + ccall((:CVodeGetQuad,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype},N_Vector),cvode_mem,tret,yQout) end -function CVodeAdjFree(cvode_mem::Ptr{Void}) - ccall((:CVodeAdjFree,libsundials_cvode),Void,(Ptr{Void},),cvode_mem) +function CVodeGetQuad(cvode_mem,tret,yQout) + __yQout = convert(NVector,yQout) + __CVodeGetQuad(convert(CVODEMemPtr,cvode_mem),pointer(tret),convert(N_Vector,__yQout)) end -function CVodeCreateB(cvode_mem::Ptr{Void},lmmB::Int,iterB::Int,which::Ptr{Cint}) - ccall((:CVodeCreateB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint,Ptr{Cint}),cvode_mem,lmmB,iterB,which) +function __CVodeGetQuadDky(cvode_mem::CVODEMemPtr,t::realtype,k::Cint,dky::N_Vector) + ccall((:CVodeGetQuadDky,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Cint,N_Vector),cvode_mem,t,k,dky) end -function CVodeInitB(cvode_mem::Ptr{Void},which::Int,fB::CVRhsFnB,tB0::realtype,yB0::N_Vector) - ccall((:CVodeInitB,libsundials_cvode),Cint,(Ptr{Void},Cint,CVRhsFnB,realtype,N_Vector),cvode_mem,which,fB,tB0,yB0) +function CVodeGetQuadDky(cvode_mem,t,k,dky) + __dky = convert(NVector,dky) + __CVodeGetQuadDky(convert(CVODEMemPtr,cvode_mem),t,convert(Cint,k),convert(N_Vector,__dky)) end -function CVodeInitBS(cvode_mem::Ptr{Void},which::Int,fBs::CVRhsFnBS,tB0::realtype,yB0::N_Vector) - ccall((:CVodeInitBS,libsundials_cvode),Cint,(Ptr{Void},Cint,CVRhsFnBS,realtype,N_Vector),cvode_mem,which,fBs,tB0,yB0) +function __CVodeGetSens(cvode_mem::CVODEMemPtr,tret::Ptr{realtype},ySout::Ptr{N_Vector}) + ccall((:CVodeGetSens,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype},Ptr{N_Vector}),cvode_mem,tret,ySout) end -function CVodeReInitB(cvode_mem::Ptr{Void},which::Int,tB0::realtype,yB0::N_Vector) - ccall((:CVodeReInitB,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype,N_Vector),cvode_mem,which,tB0,yB0) +function CVodeGetSens(cvode_mem,tret,ySout) + __CVodeGetSens(convert(CVODEMemPtr,cvode_mem),pointer(tret),pointer(ySout)) end -function CVodeSStolerancesB(cvode_mem::Ptr{Void},which::Int,reltolB::realtype,abstolB::realtype) - ccall((:CVodeSStolerancesB,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype,realtype),cvode_mem,which,reltolB,abstolB) +function __CVodeGetSens1(cvode_mem::CVODEMemPtr,tret::Ptr{realtype},is::Cint,ySout::N_Vector) + ccall((:CVodeGetSens1,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype},Cint,N_Vector),cvode_mem,tret,is,ySout) end -function CVodeSVtolerancesB(cvode_mem::Ptr{Void},which::Int,reltolB::realtype,abstolB::N_Vector) - ccall((:CVodeSVtolerancesB,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype,N_Vector),cvode_mem,which,reltolB,abstolB) +function CVodeGetSens1(cvode_mem,tret,is,ySout) + __ySout = convert(NVector,ySout) + __CVodeGetSens1(convert(CVODEMemPtr,cvode_mem),pointer(tret),convert(Cint,is),convert(N_Vector,__ySout)) end -function CVodeQuadInitB(cvode_mem::Ptr{Void},which::Int,fQB::CVQuadRhsFnB,yQB0::N_Vector) - ccall((:CVodeQuadInitB,libsundials_cvode),Cint,(Ptr{Void},Cint,CVQuadRhsFnB,N_Vector),cvode_mem,which,fQB,yQB0) +function __CVodeGetSensDky(cvode_mem::CVODEMemPtr,t::realtype,k::Cint,dkyA::Ptr{N_Vector}) + ccall((:CVodeGetSensDky,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Cint,Ptr{N_Vector}),cvode_mem,t,k,dkyA) end -function CVodeQuadInitBS(cvode_mem::Ptr{Void},which::Int,fQBs::CVQuadRhsFnBS,yQB0::N_Vector) - ccall((:CVodeQuadInitBS,libsundials_cvode),Cint,(Ptr{Void},Cint,CVQuadRhsFnBS,N_Vector),cvode_mem,which,fQBs,yQB0) +function CVodeGetSensDky(cvode_mem,t,k,dkyA) + __CVodeGetSensDky(convert(CVODEMemPtr,cvode_mem),t,convert(Cint,k),pointer(dkyA)) end -function CVodeQuadReInitB(cvode_mem::Ptr{Void},which::Int,yQB0::N_Vector) - ccall((:CVodeQuadReInitB,libsundials_cvode),Cint,(Ptr{Void},Cint,N_Vector),cvode_mem,which,yQB0) +function __CVodeGetSensDky1(cvode_mem::CVODEMemPtr,t::realtype,k::Cint,is::Cint,dky::N_Vector) + ccall((:CVodeGetSensDky1,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Cint,Cint,N_Vector),cvode_mem,t,k,is,dky) end -function CVodeQuadSStolerancesB(cvode_mem::Ptr{Void},which::Int,reltolQB::realtype,abstolQB::realtype) - ccall((:CVodeQuadSStolerancesB,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype,realtype),cvode_mem,which,reltolQB,abstolQB) +function CVodeGetSensDky1(cvode_mem,t,k,is,dky) + __dky = convert(NVector,dky) + __CVodeGetSensDky1(convert(CVODEMemPtr,cvode_mem),t,convert(Cint,k),convert(Cint,is),convert(N_Vector,__dky)) end -function CVodeQuadSVtolerancesB(cvode_mem::Ptr{Void},which::Int,reltolQB::realtype,abstolQB::N_Vector) - ccall((:CVodeQuadSVtolerancesB,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype,N_Vector),cvode_mem,which,reltolQB,abstolQB) +function __CVodeGetQuadSens(cvode_mem::CVODEMemPtr,tret::Ptr{realtype},yQSout::Ptr{N_Vector}) + ccall((:CVodeGetQuadSens,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype},Ptr{N_Vector}),cvode_mem,tret,yQSout) end -function CVodeF(cvode_mem::Ptr{Void},tout::realtype,yout::N_Vector,tret::Vector{realtype},itask::Int,ncheckPtr::Ptr{Cint}) - ccall((:CVodeF,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector,Ptr{realtype},Cint,Ptr{Cint}),cvode_mem,tout,yout,tret,itask,ncheckPtr) +function CVodeGetQuadSens(cvode_mem,tret,yQSout) + __CVodeGetQuadSens(convert(CVODEMemPtr,cvode_mem),pointer(tret),pointer(yQSout)) end -function CVodeB(cvode_mem::Ptr{Void},tBout::realtype,itaskB::Int) - ccall((:CVodeB,libsundials_cvode),Cint,(Ptr{Void},realtype,Cint),cvode_mem,tBout,itaskB) +function __CVodeGetQuadSens1(cvode_mem::CVODEMemPtr,tret::Ptr{realtype},is::Cint,yQSout::N_Vector) + ccall((:CVodeGetQuadSens1,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype},Cint,N_Vector),cvode_mem,tret,is,yQSout) end -function CVodeSetAdjNoSensi(cvode_mem::Ptr{Void}) - ccall((:CVodeSetAdjNoSensi,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) +function CVodeGetQuadSens1(cvode_mem,tret,is,yQSout) + __yQSout = convert(NVector,yQSout) + __CVodeGetQuadSens1(convert(CVODEMemPtr,cvode_mem),pointer(tret),convert(Cint,is),convert(N_Vector,__yQSout)) end -function CVodeSetIterTypeB(cvode_mem::Ptr{Void},which::Int,iterB::Int) - ccall((:CVodeSetIterTypeB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,which,iterB) +function __CVodeGetQuadSensDky(cvode_mem::CVODEMemPtr,t::realtype,k::Cint,dkyQS_all::Ptr{N_Vector}) + ccall((:CVodeGetQuadSensDky,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Cint,Ptr{N_Vector}),cvode_mem,t,k,dkyQS_all) end -function CVodeSetUserDataB(cvode_mem::Ptr{Void},which::Int,user_dataB::Ptr{Void}) - ccall((:CVodeSetUserDataB,libsundials_cvode),Cint,(Ptr{Void},Cint,Ptr{Void}),cvode_mem,which,user_dataB) +function CVodeGetQuadSensDky(cvode_mem,t,k,dkyQS_all) + __CVodeGetQuadSensDky(convert(CVODEMemPtr,cvode_mem),t,convert(Cint,k),pointer(dkyQS_all)) end -function CVodeSetMaxOrdB(cvode_mem::Ptr{Void},which::Int,maxordB::Int) - ccall((:CVodeSetMaxOrdB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,which,maxordB) +function __CVodeGetQuadSensDky1(cvode_mem::CVODEMemPtr,t::realtype,k::Cint,is::Cint,dkyQS::N_Vector) + ccall((:CVodeGetQuadSensDky1,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Cint,Cint,N_Vector),cvode_mem,t,k,is,dkyQS) end -function CVodeSetMaxNumStepsB(cvode_mem::Ptr{Void},which::Int,mxstepsB::Int) - ccall((:CVodeSetMaxNumStepsB,libsundials_cvode),Cint,(Ptr{Void},Cint,Clong),cvode_mem,which,mxstepsB) +function CVodeGetQuadSensDky1(cvode_mem,t,k,is,dkyQS) + __dkyQS = convert(NVector,dkyQS) + __CVodeGetQuadSensDky1(convert(CVODEMemPtr,cvode_mem),t,convert(Cint,k),convert(Cint,is),convert(N_Vector,__dkyQS)) end -function CVodeSetStabLimDetB(cvode_mem::Ptr{Void},which::Int,stldetB::Int) - ccall((:CVodeSetStabLimDetB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,which,stldetB) +function __CVodeGetWorkSpace(cvode_mem::CVODEMemPtr,lenrw::Ptr{Clong},leniw::Ptr{Clong}) + ccall((:CVodeGetWorkSpace,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrw,leniw) end -function CVodeSetInitStepB(cvode_mem::Ptr{Void},which::Int,hinB::realtype) - ccall((:CVodeSetInitStepB,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype),cvode_mem,which,hinB) +function CVodeGetWorkSpace(cvode_mem,lenrw,leniw) + __CVodeGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrw),pointer(leniw)) end -function CVodeSetMinStepB(cvode_mem::Ptr{Void},which::Int,hminB::realtype) - ccall((:CVodeSetMinStepB,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype),cvode_mem,which,hminB) +function __CVodeGetNumSteps(cvode_mem::CVODEMemPtr,nsteps::Ptr{Clong}) + ccall((:CVodeGetNumSteps,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nsteps) end -function CVodeSetMaxStepB(cvode_mem::Ptr{Void},which::Int,hmaxB::realtype) - ccall((:CVodeSetMaxStepB,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype),cvode_mem,which,hmaxB) +function CVodeGetNumSteps(cvode_mem,nsteps) + __CVodeGetNumSteps(convert(CVODEMemPtr,cvode_mem),pointer(nsteps)) end -function CVodeSetQuadErrConB(cvode_mem::Ptr{Void},which::Int,errconQB::Int) - ccall((:CVodeSetQuadErrConB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,which,errconQB) +function __CVodeGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevals::Ptr{Clong}) + ccall((:CVodeGetNumRhsEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevals) end -function CVodeGetB(cvode_mem::Ptr{Void},which::Int,tBret::Vector{realtype},yB::N_Vector) - ccall((:CVodeGetB,libsundials_cvode),Cint,(Ptr{Void},Cint,Ptr{realtype},N_Vector),cvode_mem,which,tBret,yB) +function CVodeGetNumRhsEvals(cvode_mem,nfevals) + __CVodeGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevals)) end -function CVodeGetQuadB(cvode_mem::Ptr{Void},which::Int,tBret::Vector{realtype},qB::N_Vector) - ccall((:CVodeGetQuadB,libsundials_cvode),Cint,(Ptr{Void},Cint,Ptr{realtype},N_Vector),cvode_mem,which,tBret,qB) +function __CVodeGetNumLinSolvSetups(cvode_mem::CVODEMemPtr,nlinsetups::Ptr{Clong}) + ccall((:CVodeGetNumLinSolvSetups,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nlinsetups) end -function CVodeGetAdjCVodeBmem(cvode_mem::Ptr{Void},which::Int) - ccall((:CVodeGetAdjCVodeBmem,libsundials_cvode),Ptr{Void},(Ptr{Void},Cint),cvode_mem,which) +function CVodeGetNumLinSolvSetups(cvode_mem,nlinsetups) + __CVodeGetNumLinSolvSetups(convert(CVODEMemPtr,cvode_mem),pointer(nlinsetups)) end -function CVodeGetAdjY(cvode_mem::Ptr{Void},t::realtype,y::N_Vector) - ccall((:CVodeGetAdjY,libsundials_cvode),Cint,(Ptr{Void},realtype,N_Vector),cvode_mem,t,y) +function __CVodeGetNumErrTestFails(cvode_mem::CVODEMemPtr,netfails::Ptr{Clong}) + ccall((:CVodeGetNumErrTestFails,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,netfails) end -function CVodeGetAdjCheckPointsInfo(cvode_mem::Ptr{Void},ckpnt::Ptr{CVadjCheckPointRec}) - ccall((:CVodeGetAdjCheckPointsInfo,libsundials_cvode),Cint,(Ptr{Void},Ptr{CVadjCheckPointRec}),cvode_mem,ckpnt) +function CVodeGetNumErrTestFails(cvode_mem,netfails) + __CVodeGetNumErrTestFails(convert(CVODEMemPtr,cvode_mem),pointer(netfails)) end -function CVodeGetAdjDataPointHermite(cvode_mem::Ptr{Void},which::Int,t::Vector{realtype},y::N_Vector,yd::N_Vector) - ccall((:CVodeGetAdjDataPointHermite,libsundials_cvode),Cint,(Ptr{Void},Cint,Ptr{realtype},N_Vector,N_Vector),cvode_mem,which,t,y,yd) +function __CVodeGetLastOrder(cvode_mem::CVODEMemPtr,qlast::Ptr{Cint}) + ccall((:CVodeGetLastOrder,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Cint}),cvode_mem,qlast) end -function CVodeGetAdjDataPointPolynomial(cvode_mem::Ptr{Void},which::Int,t::Vector{realtype},order::Ptr{Cint},y::N_Vector) - ccall((:CVodeGetAdjDataPointPolynomial,libsundials_cvode),Cint,(Ptr{Void},Cint,Ptr{realtype},Ptr{Cint},N_Vector),cvode_mem,which,t,order,y) +function CVodeGetLastOrder(cvode_mem,qlast) + __CVodeGetLastOrder(convert(CVODEMemPtr,cvode_mem),pointer(qlast)) end -function CVodeGetAdjCurrentCheckPoint(cvode_mem::Ptr{Void},addr::Vector{Ptr{Void}}) - ccall((:CVodeGetAdjCurrentCheckPoint,libsundials_cvode),Cint,(Ptr{Void},Ptr{Ptr{Void}}),cvode_mem,addr) +function __CVodeGetCurrentOrder(cvode_mem::CVODEMemPtr,qcur::Ptr{Cint}) + ccall((:CVodeGetCurrentOrder,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Cint}),cvode_mem,qcur) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_direct.h + +function CVodeGetCurrentOrder(cvode_mem,qcur) + __CVodeGetCurrentOrder(convert(CVODEMemPtr,cvode_mem),pointer(qcur)) +end + +function __CVodeGetNumStabLimOrderReds(cvode_mem::CVODEMemPtr,nslred::Ptr{Clong}) + ccall((:CVodeGetNumStabLimOrderReds,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nslred) +end + +function CVodeGetNumStabLimOrderReds(cvode_mem,nslred) + __CVodeGetNumStabLimOrderReds(convert(CVODEMemPtr,cvode_mem),pointer(nslred)) +end + +function __CVodeGetActualInitStep(cvode_mem::CVODEMemPtr,hinused::Ptr{realtype}) + ccall((:CVodeGetActualInitStep,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,hinused) +end + +function CVodeGetActualInitStep(cvode_mem,hinused) + __CVodeGetActualInitStep(convert(CVODEMemPtr,cvode_mem),pointer(hinused)) +end + +function __CVodeGetLastStep(cvode_mem::CVODEMemPtr,hlast::Ptr{realtype}) + ccall((:CVodeGetLastStep,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,hlast) +end + +function CVodeGetLastStep(cvode_mem,hlast) + __CVodeGetLastStep(convert(CVODEMemPtr,cvode_mem),pointer(hlast)) +end + +function __CVodeGetCurrentStep(cvode_mem::CVODEMemPtr,hcur::Ptr{realtype}) + ccall((:CVodeGetCurrentStep,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,hcur) +end + +function CVodeGetCurrentStep(cvode_mem,hcur) + __CVodeGetCurrentStep(convert(CVODEMemPtr,cvode_mem),pointer(hcur)) +end + +function __CVodeGetCurrentTime(cvode_mem::CVODEMemPtr,tcur::Ptr{realtype}) + ccall((:CVodeGetCurrentTime,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,tcur) +end + +function CVodeGetCurrentTime(cvode_mem,tcur) + __CVodeGetCurrentTime(convert(CVODEMemPtr,cvode_mem),pointer(tcur)) +end + +function __CVodeGetTolScaleFactor(cvode_mem::CVODEMemPtr,tolsfac::Ptr{realtype}) + ccall((:CVodeGetTolScaleFactor,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{realtype}),cvode_mem,tolsfac) +end + +function CVodeGetTolScaleFactor(cvode_mem,tolsfac) + __CVodeGetTolScaleFactor(convert(CVODEMemPtr,cvode_mem),pointer(tolsfac)) +end + +function __CVodeGetErrWeights(cvode_mem::CVODEMemPtr,eweight::N_Vector) + ccall((:CVodeGetErrWeights,libsundials_cvodes),Cint,(CVODEMemPtr,N_Vector),cvode_mem,eweight) +end + +function CVodeGetErrWeights(cvode_mem,eweight) + __eweight = convert(NVector,eweight) + __CVodeGetErrWeights(convert(CVODEMemPtr,cvode_mem),convert(N_Vector,__eweight)) +end + +function __CVodeGetEstLocalErrors(cvode_mem::CVODEMemPtr,ele::N_Vector) + ccall((:CVodeGetEstLocalErrors,libsundials_cvodes),Cint,(CVODEMemPtr,N_Vector),cvode_mem,ele) +end + +function CVodeGetEstLocalErrors(cvode_mem,ele) + __ele = convert(NVector,ele) + __CVodeGetEstLocalErrors(convert(CVODEMemPtr,cvode_mem),convert(N_Vector,__ele)) +end + +function __CVodeGetNumGEvals(cvode_mem::CVODEMemPtr,ngevals::Ptr{Clong}) + ccall((:CVodeGetNumGEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,ngevals) +end + +function CVodeGetNumGEvals(cvode_mem,ngevals) + __CVodeGetNumGEvals(convert(CVODEMemPtr,cvode_mem),pointer(ngevals)) +end + +function __CVodeGetRootInfo(cvode_mem::CVODEMemPtr,rootsfound::Ptr{Cint}) + ccall((:CVodeGetRootInfo,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Cint}),cvode_mem,rootsfound) +end + +function CVodeGetRootInfo(cvode_mem,rootsfound) + __CVodeGetRootInfo(convert(CVODEMemPtr,cvode_mem),pointer(rootsfound)) +end + +function __CVodeGetIntegratorStats(cvode_mem::CVODEMemPtr,nsteps::Ptr{Clong},nfevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Ptr{realtype},hlast::Ptr{realtype},hcur::Ptr{realtype},tcur::Ptr{realtype}) + ccall((:CVodeGetIntegratorStats,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),cvode_mem,nsteps,nfevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) +end + +function CVodeGetIntegratorStats(cvode_mem,nsteps,nfevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) + __CVodeGetIntegratorStats(convert(CVODEMemPtr,cvode_mem),pointer(nsteps),pointer(nfevals),pointer(nlinsetups),pointer(netfails),pointer(qlast),pointer(qcur),pointer(hinused),pointer(hlast),pointer(hcur),pointer(tcur)) +end + +function __CVodeGetNumNonlinSolvIters(cvode_mem::CVODEMemPtr,nniters::Ptr{Clong}) + ccall((:CVodeGetNumNonlinSolvIters,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nniters) +end + +function CVodeGetNumNonlinSolvIters(cvode_mem,nniters) + __CVodeGetNumNonlinSolvIters(convert(CVODEMemPtr,cvode_mem),pointer(nniters)) +end + +function __CVodeGetNumNonlinSolvConvFails(cvode_mem::CVODEMemPtr,nncfails::Ptr{Clong}) + ccall((:CVodeGetNumNonlinSolvConvFails,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nncfails) +end + +function CVodeGetNumNonlinSolvConvFails(cvode_mem,nncfails) + __CVodeGetNumNonlinSolvConvFails(convert(CVODEMemPtr,cvode_mem),pointer(nncfails)) +end + +function __CVodeGetNonlinSolvStats(cvode_mem::CVODEMemPtr,nniters::Ptr{Clong},nncfails::Ptr{Clong}) + ccall((:CVodeGetNonlinSolvStats,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,nniters,nncfails) +end + +function CVodeGetNonlinSolvStats(cvode_mem,nniters,nncfails) + __CVodeGetNonlinSolvStats(convert(CVODEMemPtr,cvode_mem),pointer(nniters),pointer(nncfails)) +end + +function __CVodeGetReturnFlagName(flag::Clong) + ccall((:CVodeGetReturnFlagName,libsundials_cvodes),Ptr{UInt8},(Clong,),flag) +end + +function CVodeGetReturnFlagName(flag) + __CVodeGetReturnFlagName(convert(Clong,flag)) +end + +function __CVodeGetQuadNumRhsEvals(cvode_mem::CVODEMemPtr,nfQevals::Ptr{Clong}) + ccall((:CVodeGetQuadNumRhsEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfQevals) +end + +function CVodeGetQuadNumRhsEvals(cvode_mem,nfQevals) + __CVodeGetQuadNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfQevals)) +end + +function __CVodeGetQuadNumErrTestFails(cvode_mem::CVODEMemPtr,nQetfails::Ptr{Clong}) + ccall((:CVodeGetQuadNumErrTestFails,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nQetfails) +end + +function CVodeGetQuadNumErrTestFails(cvode_mem,nQetfails) + __CVodeGetQuadNumErrTestFails(convert(CVODEMemPtr,cvode_mem),pointer(nQetfails)) +end + +function __CVodeGetQuadErrWeights(cvode_mem::CVODEMemPtr,eQweight::N_Vector) + ccall((:CVodeGetQuadErrWeights,libsundials_cvodes),Cint,(CVODEMemPtr,N_Vector),cvode_mem,eQweight) +end + +function CVodeGetQuadErrWeights(cvode_mem,eQweight) + __eQweight = convert(NVector,eQweight) + __CVodeGetQuadErrWeights(convert(CVODEMemPtr,cvode_mem),convert(N_Vector,__eQweight)) +end + +function __CVodeGetQuadStats(cvode_mem::CVODEMemPtr,nfQevals::Ptr{Clong},nQetfails::Ptr{Clong}) + ccall((:CVodeGetQuadStats,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,nfQevals,nQetfails) +end + +function CVodeGetQuadStats(cvode_mem,nfQevals,nQetfails) + __CVodeGetQuadStats(convert(CVODEMemPtr,cvode_mem),pointer(nfQevals),pointer(nQetfails)) +end + +function __CVodeGetSensNumRhsEvals(cvode_mem::CVODEMemPtr,nfSevals::Ptr{Clong}) + ccall((:CVodeGetSensNumRhsEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfSevals) +end + +function CVodeGetSensNumRhsEvals(cvode_mem,nfSevals) + __CVodeGetSensNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfSevals)) +end + +function __CVodeGetNumRhsEvalsSens(cvode_mem::CVODEMemPtr,nfevalsS::Ptr{Clong}) + ccall((:CVodeGetNumRhsEvalsSens,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevalsS) +end + +function CVodeGetNumRhsEvalsSens(cvode_mem,nfevalsS) + __CVodeGetNumRhsEvalsSens(convert(CVODEMemPtr,cvode_mem),pointer(nfevalsS)) +end + +function __CVodeGetSensNumErrTestFails(cvode_mem::CVODEMemPtr,nSetfails::Ptr{Clong}) + ccall((:CVodeGetSensNumErrTestFails,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nSetfails) +end + +function CVodeGetSensNumErrTestFails(cvode_mem,nSetfails) + __CVodeGetSensNumErrTestFails(convert(CVODEMemPtr,cvode_mem),pointer(nSetfails)) +end + +function __CVodeGetSensNumLinSolvSetups(cvode_mem::CVODEMemPtr,nlinsetupsS::Ptr{Clong}) + ccall((:CVodeGetSensNumLinSolvSetups,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nlinsetupsS) +end + +function CVodeGetSensNumLinSolvSetups(cvode_mem,nlinsetupsS) + __CVodeGetSensNumLinSolvSetups(convert(CVODEMemPtr,cvode_mem),pointer(nlinsetupsS)) +end + +function __CVodeGetSensErrWeights(cvode_mem::CVODEMemPtr,eSweight::Ptr{N_Vector}) + ccall((:CVodeGetSensErrWeights,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{N_Vector}),cvode_mem,eSweight) +end + +function CVodeGetSensErrWeights(cvode_mem,eSweight) + __CVodeGetSensErrWeights(convert(CVODEMemPtr,cvode_mem),pointer(eSweight)) +end + +function __CVodeGetSensStats(cvode_mem::CVODEMemPtr,nfSevals::Ptr{Clong},nfevalsS::Ptr{Clong},nSetfails::Ptr{Clong},nlinsetupsS::Ptr{Clong}) + ccall((:CVodeGetSensStats,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong}),cvode_mem,nfSevals,nfevalsS,nSetfails,nlinsetupsS) +end + +function CVodeGetSensStats(cvode_mem,nfSevals,nfevalsS,nSetfails,nlinsetupsS) + __CVodeGetSensStats(convert(CVODEMemPtr,cvode_mem),pointer(nfSevals),pointer(nfevalsS),pointer(nSetfails),pointer(nlinsetupsS)) +end + +function __CVodeGetSensNumNonlinSolvIters(cvode_mem::CVODEMemPtr,nSniters::Ptr{Clong}) + ccall((:CVodeGetSensNumNonlinSolvIters,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nSniters) +end + +function CVodeGetSensNumNonlinSolvIters(cvode_mem,nSniters) + __CVodeGetSensNumNonlinSolvIters(convert(CVODEMemPtr,cvode_mem),pointer(nSniters)) +end + +function __CVodeGetSensNumNonlinSolvConvFails(cvode_mem::CVODEMemPtr,nSncfails::Ptr{Clong}) + ccall((:CVodeGetSensNumNonlinSolvConvFails,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nSncfails) +end + +function CVodeGetSensNumNonlinSolvConvFails(cvode_mem,nSncfails) + __CVodeGetSensNumNonlinSolvConvFails(convert(CVODEMemPtr,cvode_mem),pointer(nSncfails)) +end + +function __CVodeGetStgrSensNumNonlinSolvIters(cvode_mem::CVODEMemPtr,nSTGR1niters::Ptr{Clong}) + ccall((:CVodeGetStgrSensNumNonlinSolvIters,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nSTGR1niters) +end + +function CVodeGetStgrSensNumNonlinSolvIters(cvode_mem,nSTGR1niters) + __CVodeGetStgrSensNumNonlinSolvIters(convert(CVODEMemPtr,cvode_mem),pointer(nSTGR1niters)) +end + +function __CVodeGetStgrSensNumNonlinSolvConvFails(cvode_mem::CVODEMemPtr,nSTGR1ncfails::Ptr{Clong}) + ccall((:CVodeGetStgrSensNumNonlinSolvConvFails,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nSTGR1ncfails) +end + +function CVodeGetStgrSensNumNonlinSolvConvFails(cvode_mem,nSTGR1ncfails) + __CVodeGetStgrSensNumNonlinSolvConvFails(convert(CVODEMemPtr,cvode_mem),pointer(nSTGR1ncfails)) +end + +function __CVodeGetSensNonlinSolvStats(cvode_mem::CVODEMemPtr,nSniters::Ptr{Clong},nSncfails::Ptr{Clong}) + ccall((:CVodeGetSensNonlinSolvStats,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,nSniters,nSncfails) +end + +function CVodeGetSensNonlinSolvStats(cvode_mem,nSniters,nSncfails) + __CVodeGetSensNonlinSolvStats(convert(CVODEMemPtr,cvode_mem),pointer(nSniters),pointer(nSncfails)) +end + +function __CVodeGetQuadSensNumRhsEvals(cvode_mem::CVODEMemPtr,nfQSevals::Ptr{Clong}) + ccall((:CVodeGetQuadSensNumRhsEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfQSevals) +end + +function CVodeGetQuadSensNumRhsEvals(cvode_mem,nfQSevals) + __CVodeGetQuadSensNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfQSevals)) +end + +function __CVodeGetQuadSensNumErrTestFails(cvode_mem::CVODEMemPtr,nQSetfails::Ptr{Clong}) + ccall((:CVodeGetQuadSensNumErrTestFails,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nQSetfails) +end + +function CVodeGetQuadSensNumErrTestFails(cvode_mem,nQSetfails) + __CVodeGetQuadSensNumErrTestFails(convert(CVODEMemPtr,cvode_mem),pointer(nQSetfails)) +end + +function __CVodeGetQuadSensErrWeights(cvode_mem::CVODEMemPtr,eQSweight::Ptr{N_Vector}) + ccall((:CVodeGetQuadSensErrWeights,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{N_Vector}),cvode_mem,eQSweight) +end + +function CVodeGetQuadSensErrWeights(cvode_mem,eQSweight) + __CVodeGetQuadSensErrWeights(convert(CVODEMemPtr,cvode_mem),pointer(eQSweight)) +end + +function __CVodeGetQuadSensStats(cvode_mem::CVODEMemPtr,nfQSevals::Ptr{Clong},nQSetfails::Ptr{Clong}) + ccall((:CVodeGetQuadSensStats,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,nfQSevals,nQSetfails) +end + +function CVodeGetQuadSensStats(cvode_mem,nfQSevals,nQSetfails) + __CVodeGetQuadSensStats(convert(CVODEMemPtr,cvode_mem),pointer(nfQSevals),pointer(nQSetfails)) +end + +function __CVodeAdjInit(cvode_mem::CVODEMemPtr,steps::Clong,interp::Cint) + ccall((:CVodeAdjInit,libsundials_cvodes),Cint,(CVODEMemPtr,Clong,Cint),cvode_mem,steps,interp) +end + +function CVodeAdjInit(cvode_mem,steps,interp) + __CVodeAdjInit(convert(CVODEMemPtr,cvode_mem),convert(Clong,steps),convert(Cint,interp)) +end + +function __CVodeAdjReInit(cvode_mem::CVODEMemPtr) + ccall((:CVodeAdjReInit,libsundials_cvodes),Cint,(CVODEMemPtr,),cvode_mem) +end + +function CVodeAdjReInit(cvode_mem) + __CVodeAdjReInit(convert(CVODEMemPtr,cvode_mem)) +end + +function __CVodeAdjFree(cvode_mem::CVODEMemPtr) + ccall((:CVodeAdjFree,libsundials_cvodes),Void,(CVODEMemPtr,),cvode_mem) +end + +function CVodeAdjFree(cvode_mem) + __CVodeAdjFree(convert(CVODEMemPtr,cvode_mem)) +end + +function __CVodeCreateB(cvode_mem::CVODEMemPtr,lmmB::Cint,iterB::Cint,which::Ptr{Cint}) + ccall((:CVodeCreateB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint,Ptr{Cint}),cvode_mem,lmmB,iterB,which) +end + +function CVodeCreateB(cvode_mem,lmmB,iterB,which) + __CVodeCreateB(convert(CVODEMemPtr,cvode_mem),convert(Cint,lmmB),convert(Cint,iterB),pointer(which)) +end + +function __CVodeInitB(cvode_mem::CVODEMemPtr,which::Cint,fB::CVRhsFnB,tB0::realtype,yB0::N_Vector) + ccall((:CVodeInitB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,CVRhsFnB,realtype,N_Vector),cvode_mem,which,fB,tB0,yB0) +end + +function CVodeInitB(cvode_mem,which,fB,tB0,yB0) + __yB0 = convert(NVector,yB0) + __CVodeInitB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),fB,tB0,convert(N_Vector,__yB0)) +end + +function __CVodeInitBS(cvode_mem::CVODEMemPtr,which::Cint,fBs::CVRhsFnBS,tB0::realtype,yB0::N_Vector) + ccall((:CVodeInitBS,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,CVRhsFnBS,realtype,N_Vector),cvode_mem,which,fBs,tB0,yB0) +end + +function CVodeInitBS(cvode_mem,which,fBs,tB0,yB0) + __yB0 = convert(NVector,yB0) + __CVodeInitBS(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),fBs,tB0,convert(N_Vector,__yB0)) +end + +function __CVodeReInitB(cvode_mem::CVODEMemPtr,which::Cint,tB0::realtype,yB0::N_Vector) + ccall((:CVodeReInitB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype,N_Vector),cvode_mem,which,tB0,yB0) +end + +function CVodeReInitB(cvode_mem,which,tB0,yB0) + __yB0 = convert(NVector,yB0) + __CVodeReInitB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),tB0,convert(N_Vector,__yB0)) +end + +function __CVodeSStolerancesB(cvode_mem::CVODEMemPtr,which::Cint,reltolB::realtype,abstolB::realtype) + ccall((:CVodeSStolerancesB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype,realtype),cvode_mem,which,reltolB,abstolB) +end + +function CVodeSStolerancesB(cvode_mem,which,reltolB,abstolB) + __CVodeSStolerancesB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),reltolB,abstolB) +end + +function __CVodeSVtolerancesB(cvode_mem::CVODEMemPtr,which::Cint,reltolB::realtype,abstolB::N_Vector) + ccall((:CVodeSVtolerancesB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype,N_Vector),cvode_mem,which,reltolB,abstolB) +end + +function CVodeSVtolerancesB(cvode_mem,which,reltolB,abstolB) + __abstolB = convert(NVector,abstolB) + __CVodeSVtolerancesB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),reltolB,convert(N_Vector,__abstolB)) +end + +function __CVodeQuadInitB(cvode_mem::CVODEMemPtr,which::Cint,fQB::CVQuadRhsFnB,yQB0::N_Vector) + ccall((:CVodeQuadInitB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,CVQuadRhsFnB,N_Vector),cvode_mem,which,fQB,yQB0) +end + +function CVodeQuadInitB(cvode_mem,which,fQB,yQB0) + __yQB0 = convert(NVector,yQB0) + __CVodeQuadInitB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),fQB,convert(N_Vector,__yQB0)) +end + +function __CVodeQuadInitBS(cvode_mem::CVODEMemPtr,which::Cint,fQBs::CVQuadRhsFnBS,yQB0::N_Vector) + ccall((:CVodeQuadInitBS,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,CVQuadRhsFnBS,N_Vector),cvode_mem,which,fQBs,yQB0) +end + +function CVodeQuadInitBS(cvode_mem,which,fQBs,yQB0) + __yQB0 = convert(NVector,yQB0) + __CVodeQuadInitBS(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),fQBs,convert(N_Vector,__yQB0)) +end + +function __CVodeQuadReInitB(cvode_mem::CVODEMemPtr,which::Cint,yQB0::N_Vector) + ccall((:CVodeQuadReInitB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,N_Vector),cvode_mem,which,yQB0) +end + +function CVodeQuadReInitB(cvode_mem,which,yQB0) + __yQB0 = convert(NVector,yQB0) + __CVodeQuadReInitB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(N_Vector,__yQB0)) +end + +function __CVodeQuadSStolerancesB(cvode_mem::CVODEMemPtr,which::Cint,reltolQB::realtype,abstolQB::realtype) + ccall((:CVodeQuadSStolerancesB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype,realtype),cvode_mem,which,reltolQB,abstolQB) +end + +function CVodeQuadSStolerancesB(cvode_mem,which,reltolQB,abstolQB) + __CVodeQuadSStolerancesB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),reltolQB,abstolQB) +end + +function __CVodeQuadSVtolerancesB(cvode_mem::CVODEMemPtr,which::Cint,reltolQB::realtype,abstolQB::N_Vector) + ccall((:CVodeQuadSVtolerancesB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype,N_Vector),cvode_mem,which,reltolQB,abstolQB) +end + +function CVodeQuadSVtolerancesB(cvode_mem,which,reltolQB,abstolQB) + __abstolQB = convert(NVector,abstolQB) + __CVodeQuadSVtolerancesB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),reltolQB,convert(N_Vector,__abstolQB)) +end + +function __CVodeF(cvode_mem::CVODEMemPtr,tout::realtype,yout::N_Vector,tret::Ptr{realtype},itask::Cint,ncheckPtr::Ptr{Cint}) + ccall((:CVodeF,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,N_Vector,Ptr{realtype},Cint,Ptr{Cint}),cvode_mem,tout,yout,tret,itask,ncheckPtr) +end + +function CVodeF(cvode_mem,tout,yout,tret,itask,ncheckPtr) + __yout = convert(NVector,yout) + __CVodeF(convert(CVODEMemPtr,cvode_mem),tout,convert(N_Vector,__yout),pointer(tret),convert(Cint,itask),pointer(ncheckPtr)) +end + +function __CVodeB(cvode_mem::CVODEMemPtr,tBout::realtype,itaskB::Cint) + ccall((:CVodeB,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,Cint),cvode_mem,tBout,itaskB) +end + +function CVodeB(cvode_mem,tBout,itaskB) + __CVodeB(convert(CVODEMemPtr,cvode_mem),tBout,convert(Cint,itaskB)) +end + +function __CVodeSetAdjNoSensi(cvode_mem::CVODEMemPtr) + ccall((:CVodeSetAdjNoSensi,libsundials_cvodes),Cint,(CVODEMemPtr,),cvode_mem) +end + +function CVodeSetAdjNoSensi(cvode_mem) + __CVodeSetAdjNoSensi(convert(CVODEMemPtr,cvode_mem)) +end + +function __CVodeSetIterTypeB(cvode_mem::CVODEMemPtr,which::Cint,iterB::Cint) + ccall((:CVodeSetIterTypeB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,which,iterB) +end + +function CVodeSetIterTypeB(cvode_mem,which,iterB) + __CVodeSetIterTypeB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,iterB)) +end + +function __CVodeSetUserDataB(cvode_mem::CVODEMemPtr,which::Cint,user_dataB::Any) + ccall((:CVodeSetUserDataB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Any),cvode_mem,which,user_dataB) +end + +function CVodeSetUserDataB(cvode_mem,which,user_dataB) + __CVodeSetUserDataB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),user_dataB) +end + +function __CVodeSetMaxOrdB(cvode_mem::CVODEMemPtr,which::Cint,maxordB::Cint) + ccall((:CVodeSetMaxOrdB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,which,maxordB) +end + +function CVodeSetMaxOrdB(cvode_mem,which,maxordB) + __CVodeSetMaxOrdB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,maxordB)) +end + +function __CVodeSetMaxNumStepsB(cvode_mem::CVODEMemPtr,which::Cint,mxstepsB::Clong) + ccall((:CVodeSetMaxNumStepsB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Clong),cvode_mem,which,mxstepsB) +end + +function CVodeSetMaxNumStepsB(cvode_mem,which,mxstepsB) + __CVodeSetMaxNumStepsB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Clong,mxstepsB)) +end + +function __CVodeSetStabLimDetB(cvode_mem::CVODEMemPtr,which::Cint,stldetB::Cint) + ccall((:CVodeSetStabLimDetB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,which,stldetB) +end + +function CVodeSetStabLimDetB(cvode_mem,which,stldetB) + __CVodeSetStabLimDetB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,stldetB)) +end + +function __CVodeSetInitStepB(cvode_mem::CVODEMemPtr,which::Cint,hinB::realtype) + ccall((:CVodeSetInitStepB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype),cvode_mem,which,hinB) +end + +function CVodeSetInitStepB(cvode_mem,which,hinB) + __CVodeSetInitStepB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),hinB) +end + +function __CVodeSetMinStepB(cvode_mem::CVODEMemPtr,which::Cint,hminB::realtype) + ccall((:CVodeSetMinStepB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype),cvode_mem,which,hminB) +end + +function CVodeSetMinStepB(cvode_mem,which,hminB) + __CVodeSetMinStepB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),hminB) +end + +function __CVodeSetMaxStepB(cvode_mem::CVODEMemPtr,which::Cint,hmaxB::realtype) + ccall((:CVodeSetMaxStepB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype),cvode_mem,which,hmaxB) +end + +function CVodeSetMaxStepB(cvode_mem,which,hmaxB) + __CVodeSetMaxStepB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),hmaxB) +end + +function __CVodeSetQuadErrConB(cvode_mem::CVODEMemPtr,which::Cint,errconQB::Cint) + ccall((:CVodeSetQuadErrConB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,which,errconQB) +end + +function CVodeSetQuadErrConB(cvode_mem,which,errconQB) + __CVodeSetQuadErrConB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,errconQB)) +end + +function __CVodeGetB(cvode_mem::CVODEMemPtr,which::Cint,tBret::Ptr{realtype},yB::N_Vector) + ccall((:CVodeGetB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Ptr{realtype},N_Vector),cvode_mem,which,tBret,yB) +end + +function CVodeGetB(cvode_mem,which,tBret,yB) + __yB = convert(NVector,yB) + __CVodeGetB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),pointer(tBret),convert(N_Vector,__yB)) +end + +function __CVodeGetQuadB(cvode_mem::CVODEMemPtr,which::Cint,tBret::Ptr{realtype},qB::N_Vector) + ccall((:CVodeGetQuadB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Ptr{realtype},N_Vector),cvode_mem,which,tBret,qB) +end + +function CVodeGetQuadB(cvode_mem,which,tBret,qB) + __qB = convert(NVector,qB) + __CVodeGetQuadB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),pointer(tBret),convert(N_Vector,__qB)) +end + +function __CVodeGetAdjCVodeBmem(cvode_mem::CVODEMemPtr,which::Cint) + ccall((:CVodeGetAdjCVodeBmem,libsundials_cvodes),Ptr{Void},(CVODEMemPtr,Cint),cvode_mem,which) +end + +function CVodeGetAdjCVodeBmem(cvode_mem,which) + __CVodeGetAdjCVodeBmem(convert(CVODEMemPtr,cvode_mem),convert(Cint,which)) +end + +function __CVodeGetAdjY(cvode_mem::CVODEMemPtr,t::realtype,y::N_Vector) + ccall((:CVodeGetAdjY,libsundials_cvodes),Cint,(CVODEMemPtr,realtype,N_Vector),cvode_mem,t,y) +end + +function CVodeGetAdjY(cvode_mem,t,y) + __y = convert(NVector,y) + __CVodeGetAdjY(convert(CVODEMemPtr,cvode_mem),t,convert(N_Vector,__y)) +end + +function __CVodeGetAdjCheckPointsInfo(cvode_mem::CVODEMemPtr,ckpnt::Ptr{CVadjCheckPointRec}) + ccall((:CVodeGetAdjCheckPointsInfo,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{CVadjCheckPointRec}),cvode_mem,ckpnt) +end + +function CVodeGetAdjCheckPointsInfo(cvode_mem,ckpnt) + __CVodeGetAdjCheckPointsInfo(convert(CVODEMemPtr,cvode_mem),pointer(ckpnt)) +end + +function __CVodeGetAdjDataPointHermite(cvode_mem::CVODEMemPtr,which::Cint,t::Ptr{realtype},y::N_Vector,yd::N_Vector) + ccall((:CVodeGetAdjDataPointHermite,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Ptr{realtype},N_Vector,N_Vector),cvode_mem,which,t,y,yd) +end + +function CVodeGetAdjDataPointHermite(cvode_mem,which,t,y,yd) + __y = convert(NVector,y) + __yd = convert(NVector,yd) + __CVodeGetAdjDataPointHermite(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),pointer(t),convert(N_Vector,__y),convert(N_Vector,__yd)) +end + +function __CVodeGetAdjDataPointPolynomial(cvode_mem::CVODEMemPtr,which::Cint,t::Ptr{realtype},order::Ptr{Cint},y::N_Vector) + ccall((:CVodeGetAdjDataPointPolynomial,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Ptr{realtype},Ptr{Cint},N_Vector),cvode_mem,which,t,order,y) +end + +function CVodeGetAdjDataPointPolynomial(cvode_mem,which,t,order,y) + __y = convert(NVector,y) + __CVodeGetAdjDataPointPolynomial(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),pointer(t),pointer(order),convert(N_Vector,__y)) +end + +function __CVodeGetAdjCurrentCheckPoint(cvode_mem::CVODEMemPtr,addr::Ptr{Ptr{Void}}) + ccall((:CVodeGetAdjCurrentCheckPoint,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Ptr{Void}}),cvode_mem,addr) +end + +function CVodeGetAdjCurrentCheckPoint(cvode_mem,addr) + __CVodeGetAdjCurrentCheckPoint(convert(CVODEMemPtr,cvode_mem),pointer(addr)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_direct.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVDlsSetDenseJacFn(cvode_mem::Ptr{Void},jac::CVDlsDenseJacFn) - ccall((:CVDlsSetDenseJacFn,libsundials_cvode),Cint,(Ptr{Void},CVDlsDenseJacFn),cvode_mem,jac) +function __CVDlsSetDenseJacFn(cvode_mem::CVODEMemPtr,jac::CVDlsDenseJacFn) + ccall((:CVDlsSetDenseJacFn,libsundials_cvodes),Cint,(CVODEMemPtr,CVDlsDenseJacFn),cvode_mem,jac) +end + +function CVDlsSetDenseJacFn(cvode_mem,jac) + __CVDlsSetDenseJacFn(convert(CVODEMemPtr,cvode_mem),jac) +end + +function __CVDlsSetBandJacFn(cvode_mem::CVODEMemPtr,jac::CVDlsBandJacFn) + ccall((:CVDlsSetBandJacFn,libsundials_cvodes),Cint,(CVODEMemPtr,CVDlsBandJacFn),cvode_mem,jac) +end + +function CVDlsSetBandJacFn(cvode_mem,jac) + __CVDlsSetBandJacFn(convert(CVODEMemPtr,cvode_mem),jac) +end + +function __CVDlsGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:CVDlsGetWorkSpace,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +end + +function CVDlsGetWorkSpace(cvode_mem,lenrwLS,leniwLS) + __CVDlsGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwLS),pointer(leniwLS)) +end + +function __CVDlsGetNumJacEvals(cvode_mem::CVODEMemPtr,njevals::Ptr{Clong}) + ccall((:CVDlsGetNumJacEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,njevals) +end + +function CVDlsGetNumJacEvals(cvode_mem,njevals) + __CVDlsGetNumJacEvals(convert(CVODEMemPtr,cvode_mem),pointer(njevals)) +end + +function __CVDlsGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevalsLS::Ptr{Clong}) + ccall((:CVDlsGetNumRhsEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevalsLS) end -function CVDlsSetBandJacFn(cvode_mem::Ptr{Void},jac::CVDlsBandJacFn) - ccall((:CVDlsSetBandJacFn,libsundials_cvode),Cint,(Ptr{Void},CVDlsBandJacFn),cvode_mem,jac) +function CVDlsGetNumRhsEvals(cvode_mem,nfevalsLS) + __CVDlsGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevalsLS)) end -function CVDlsGetWorkSpace(cvode_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:CVDlsGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +function __CVDlsGetLastFlag(cvode_mem::CVODEMemPtr,flag::Ptr{Clong}) + ccall((:CVDlsGetLastFlag,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,flag) end -function CVDlsGetNumJacEvals(cvode_mem::Ptr{Void},njevals::Ptr{Clong}) - ccall((:CVDlsGetNumJacEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,njevals) +function CVDlsGetLastFlag(cvode_mem,flag) + __CVDlsGetLastFlag(convert(CVODEMemPtr,cvode_mem),pointer(flag)) end -function CVDlsGetNumRhsEvals(cvode_mem::Ptr{Void},nfevalsLS::Ptr{Clong}) - ccall((:CVDlsGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevalsLS) +function __CVDlsGetReturnFlagName(flag::Clong) + ccall((:CVDlsGetReturnFlagName,libsundials_cvodes),Ptr{UInt8},(Clong,),flag) end -function CVDlsGetLastFlag(cvode_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:CVDlsGetLastFlag,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,flag) +function CVDlsGetReturnFlagName(flag) + __CVDlsGetReturnFlagName(convert(Clong,flag)) end -function CVDlsGetReturnFlagName(flag::Int) - ccall((:CVDlsGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +function __CVDlsSetDenseJacFnB(cvode_mem::CVODEMemPtr,which::Cint,jacB::CVDlsDenseJacFnB) + ccall((:CVDlsSetDenseJacFnB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,CVDlsDenseJacFnB),cvode_mem,which,jacB) end -function CVDlsSetDenseJacFnB(cvode_mem::Ptr{Void},which::Int,jacB::CVDlsDenseJacFnB) - ccall((:CVDlsSetDenseJacFnB,libsundials_cvode),Cint,(Ptr{Void},Cint,CVDlsDenseJacFnB),cvode_mem,which,jacB) +function CVDlsSetDenseJacFnB(cvode_mem,which,jacB) + __CVDlsSetDenseJacFnB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),jacB) end -function CVDlsSetBandJacFnB(cvode_mem::Ptr{Void},which::Int,jacB::CVDlsBandJacFnB) - ccall((:CVDlsSetBandJacFnB,libsundials_cvode),Cint,(Ptr{Void},Cint,CVDlsBandJacFnB),cvode_mem,which,jacB) +function __CVDlsSetBandJacFnB(cvode_mem::CVODEMemPtr,which::Cint,jacB::CVDlsBandJacFnB) + ccall((:CVDlsSetBandJacFnB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,CVDlsBandJacFnB),cvode_mem,which,jacB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_spils.h + +function CVDlsSetBandJacFnB(cvode_mem,which,jacB) + __CVDlsSetBandJacFnB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),jacB) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_spils.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVSpilsSetPrecType(cvode_mem::Ptr{Void},pretype::Int) - ccall((:CVSpilsSetPrecType,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,pretype) + +function __CVSpilsSetPrecType(cvode_mem::CVODEMemPtr,pretype::Cint) + ccall((:CVSpilsSetPrecType,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,pretype) +end + +function CVSpilsSetPrecType(cvode_mem,pretype) + __CVSpilsSetPrecType(convert(CVODEMemPtr,cvode_mem),convert(Cint,pretype)) +end + +function __CVSpilsSetGSType(cvode_mem::CVODEMemPtr,gstype::Cint) + ccall((:CVSpilsSetGSType,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,gstype) +end + +function CVSpilsSetGSType(cvode_mem,gstype) + __CVSpilsSetGSType(convert(CVODEMemPtr,cvode_mem),convert(Cint,gstype)) +end + +function __CVSpilsSetMaxl(cvode_mem::CVODEMemPtr,maxl::Cint) + ccall((:CVSpilsSetMaxl,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,maxl) +end + +function CVSpilsSetMaxl(cvode_mem,maxl) + __CVSpilsSetMaxl(convert(CVODEMemPtr,cvode_mem),convert(Cint,maxl)) +end + +function __CVSpilsSetEpsLin(cvode_mem::CVODEMemPtr,eplifac::realtype) + ccall((:CVSpilsSetEpsLin,libsundials_cvodes),Cint,(CVODEMemPtr,realtype),cvode_mem,eplifac) +end + +function CVSpilsSetEpsLin(cvode_mem,eplifac) + __CVSpilsSetEpsLin(convert(CVODEMemPtr,cvode_mem),eplifac) +end + +function __CVSpilsSetPreconditioner(cvode_mem::CVODEMemPtr,pset::CVSpilsPrecSetupFn,psolve::CVSpilsPrecSolveFn) + ccall((:CVSpilsSetPreconditioner,libsundials_cvodes),Cint,(CVODEMemPtr,CVSpilsPrecSetupFn,CVSpilsPrecSolveFn),cvode_mem,pset,psolve) +end + +function CVSpilsSetPreconditioner(cvode_mem,pset,psolve) + __CVSpilsSetPreconditioner(convert(CVODEMemPtr,cvode_mem),pset,psolve) +end + +function __CVSpilsSetJacTimesVecFn(cvode_mem::CVODEMemPtr,jtv::CVSpilsJacTimesVecFn) + ccall((:CVSpilsSetJacTimesVecFn,libsundials_cvodes),Cint,(CVODEMemPtr,CVSpilsJacTimesVecFn),cvode_mem,jtv) +end + +function CVSpilsSetJacTimesVecFn(cvode_mem,jtv) + __CVSpilsSetJacTimesVecFn(convert(CVODEMemPtr,cvode_mem),jtv) +end + +function __CVSpilsGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:CVSpilsGetWorkSpace,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +end + +function CVSpilsGetWorkSpace(cvode_mem,lenrwLS,leniwLS) + __CVSpilsGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwLS),pointer(leniwLS)) +end + +function __CVSpilsGetNumPrecEvals(cvode_mem::CVODEMemPtr,npevals::Ptr{Clong}) + ccall((:CVSpilsGetNumPrecEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,npevals) +end + +function CVSpilsGetNumPrecEvals(cvode_mem,npevals) + __CVSpilsGetNumPrecEvals(convert(CVODEMemPtr,cvode_mem),pointer(npevals)) +end + +function __CVSpilsGetNumPrecSolves(cvode_mem::CVODEMemPtr,npsolves::Ptr{Clong}) + ccall((:CVSpilsGetNumPrecSolves,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,npsolves) +end + +function CVSpilsGetNumPrecSolves(cvode_mem,npsolves) + __CVSpilsGetNumPrecSolves(convert(CVODEMemPtr,cvode_mem),pointer(npsolves)) +end + +function __CVSpilsGetNumLinIters(cvode_mem::CVODEMemPtr,nliters::Ptr{Clong}) + ccall((:CVSpilsGetNumLinIters,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nliters) +end + +function CVSpilsGetNumLinIters(cvode_mem,nliters) + __CVSpilsGetNumLinIters(convert(CVODEMemPtr,cvode_mem),pointer(nliters)) +end + +function __CVSpilsGetNumConvFails(cvode_mem::CVODEMemPtr,nlcfails::Ptr{Clong}) + ccall((:CVSpilsGetNumConvFails,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nlcfails) +end + +function CVSpilsGetNumConvFails(cvode_mem,nlcfails) + __CVSpilsGetNumConvFails(convert(CVODEMemPtr,cvode_mem),pointer(nlcfails)) end -function CVSpilsSetGSType(cvode_mem::Ptr{Void},gstype::Int) - ccall((:CVSpilsSetGSType,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,gstype) +function __CVSpilsGetNumJtimesEvals(cvode_mem::CVODEMemPtr,njvevals::Ptr{Clong}) + ccall((:CVSpilsGetNumJtimesEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,njvevals) end -function CVSpilsSetMaxl(cvode_mem::Ptr{Void},maxl::Int) - ccall((:CVSpilsSetMaxl,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,maxl) +function CVSpilsGetNumJtimesEvals(cvode_mem,njvevals) + __CVSpilsGetNumJtimesEvals(convert(CVODEMemPtr,cvode_mem),pointer(njvevals)) end -function CVSpilsSetEpsLin(cvode_mem::Ptr{Void},eplifac::realtype) - ccall((:CVSpilsSetEpsLin,libsundials_cvode),Cint,(Ptr{Void},realtype),cvode_mem,eplifac) +function __CVSpilsGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevalsLS::Ptr{Clong}) + ccall((:CVSpilsGetNumRhsEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevalsLS) end -function CVSpilsSetPreconditioner(cvode_mem::Ptr{Void},pset::CVSpilsPrecSetupFn,psolve::CVSpilsPrecSolveFn) - ccall((:CVSpilsSetPreconditioner,libsundials_cvode),Cint,(Ptr{Void},CVSpilsPrecSetupFn,CVSpilsPrecSolveFn),cvode_mem,pset,psolve) +function CVSpilsGetNumRhsEvals(cvode_mem,nfevalsLS) + __CVSpilsGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevalsLS)) end -function CVSpilsSetJacTimesVecFn(cvode_mem::Ptr{Void},jtv::CVSpilsJacTimesVecFn) - ccall((:CVSpilsSetJacTimesVecFn,libsundials_cvode),Cint,(Ptr{Void},CVSpilsJacTimesVecFn),cvode_mem,jtv) +function __CVSpilsGetLastFlag(cvode_mem::CVODEMemPtr,flag::Ptr{Clong}) + ccall((:CVSpilsGetLastFlag,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,flag) end -function CVSpilsGetWorkSpace(cvode_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:CVSpilsGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +function CVSpilsGetLastFlag(cvode_mem,flag) + __CVSpilsGetLastFlag(convert(CVODEMemPtr,cvode_mem),pointer(flag)) end -function CVSpilsGetNumPrecEvals(cvode_mem::Ptr{Void},npevals::Ptr{Clong}) - ccall((:CVSpilsGetNumPrecEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,npevals) +function __CVSpilsGetReturnFlagName(flag::Clong) + ccall((:CVSpilsGetReturnFlagName,libsundials_cvodes),Ptr{UInt8},(Clong,),flag) end -function CVSpilsGetNumPrecSolves(cvode_mem::Ptr{Void},npsolves::Ptr{Clong}) - ccall((:CVSpilsGetNumPrecSolves,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,npsolves) +function CVSpilsGetReturnFlagName(flag) + __CVSpilsGetReturnFlagName(convert(Clong,flag)) end -function CVSpilsGetNumLinIters(cvode_mem::Ptr{Void},nliters::Ptr{Clong}) - ccall((:CVSpilsGetNumLinIters,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nliters) +function __CVSpilsSetPrecTypeB(cvode_mem::CVODEMemPtr,which::Cint,pretypeB::Cint) + ccall((:CVSpilsSetPrecTypeB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,which,pretypeB) end -function CVSpilsGetNumConvFails(cvode_mem::Ptr{Void},nlcfails::Ptr{Clong}) - ccall((:CVSpilsGetNumConvFails,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nlcfails) +function CVSpilsSetPrecTypeB(cvode_mem,which,pretypeB) + __CVSpilsSetPrecTypeB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,pretypeB)) end -function CVSpilsGetNumJtimesEvals(cvode_mem::Ptr{Void},njvevals::Ptr{Clong}) - ccall((:CVSpilsGetNumJtimesEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,njvevals) +function __CVSpilsSetGSTypeB(cvode_mem::CVODEMemPtr,which::Cint,gstypeB::Cint) + ccall((:CVSpilsSetGSTypeB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,which,gstypeB) end -function CVSpilsGetNumRhsEvals(cvode_mem::Ptr{Void},nfevalsLS::Ptr{Clong}) - ccall((:CVSpilsGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevalsLS) +function CVSpilsSetGSTypeB(cvode_mem,which,gstypeB) + __CVSpilsSetGSTypeB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,gstypeB)) end -function CVSpilsGetLastFlag(cvode_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:CVSpilsGetLastFlag,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,flag) +function __CVSpilsSetEpslinB(cvode_mem::CVODEMemPtr,which::Cint,eplifacB::realtype) + ccall((:CVSpilsSetEpslinB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,realtype),cvode_mem,which,eplifacB) end -function CVSpilsGetReturnFlagName(flag::Int) - ccall((:CVSpilsGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +function CVSpilsSetEpslinB(cvode_mem,which,eplifacB) + __CVSpilsSetEpslinB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),eplifacB) end -function CVSpilsSetPrecTypeB(cvode_mem::Ptr{Void},which::Int,pretypeB::Int) - ccall((:CVSpilsSetPrecTypeB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,which,pretypeB) +function __CVSpilsSetMaxlB(cvode_mem::CVODEMemPtr,which::Cint,maxlB::Cint) + ccall((:CVSpilsSetMaxlB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,which,maxlB) end -function CVSpilsSetGSTypeB(cvode_mem::Ptr{Void},which::Int,gstypeB::Int) - ccall((:CVSpilsSetGSTypeB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,which,gstypeB) +function CVSpilsSetMaxlB(cvode_mem,which,maxlB) + __CVSpilsSetMaxlB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,maxlB)) end -function CVSpilsSetEpslinB(cvode_mem::Ptr{Void},which::Int,eplifacB::realtype) - ccall((:CVSpilsSetEpslinB,libsundials_cvode),Cint,(Ptr{Void},Cint,realtype),cvode_mem,which,eplifacB) +function __CVSpilsSetPreconditionerB(cvode_mem::CVODEMemPtr,which::Cint,psetB::CVSpilsPrecSetupFnB,psolveB::CVSpilsPrecSolveFnB) + ccall((:CVSpilsSetPreconditionerB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,CVSpilsPrecSetupFnB,CVSpilsPrecSolveFnB),cvode_mem,which,psetB,psolveB) end -function CVSpilsSetMaxlB(cvode_mem::Ptr{Void},which::Int,maxlB::Int) - ccall((:CVSpilsSetMaxlB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,which,maxlB) +function CVSpilsSetPreconditionerB(cvode_mem,which,psetB,psolveB) + __CVSpilsSetPreconditionerB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),psetB,psolveB) end -function CVSpilsSetPreconditionerB(cvode_mem::Ptr{Void},which::Int,psetB::CVSpilsPrecSetupFnB,psolveB::CVSpilsPrecSolveFnB) - ccall((:CVSpilsSetPreconditionerB,libsundials_cvode),Cint,(Ptr{Void},Cint,CVSpilsPrecSetupFnB,CVSpilsPrecSolveFnB),cvode_mem,which,psetB,psolveB) +function __CVSpilsSetJacTimesVecFnB(cvode_mem::CVODEMemPtr,which::Cint,jtvB::CVSpilsJacTimesVecFnB) + ccall((:CVSpilsSetJacTimesVecFnB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,CVSpilsJacTimesVecFnB),cvode_mem,which,jtvB) end -function CVSpilsSetJacTimesVecFnB(cvode_mem::Ptr{Void},which::Int,jtvB::CVSpilsJacTimesVecFnB) - ccall((:CVSpilsSetJacTimesVecFnB,libsundials_cvode),Cint,(Ptr{Void},Cint,CVSpilsJacTimesVecFnB),cvode_mem,which,jtvB) +function CVSpilsSetJacTimesVecFnB(cvode_mem,which,jtvB) + __CVSpilsSetJacTimesVecFnB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),jtvB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_band.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_band.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVBand(cvode_mem::Ptr{Void},N::Int,mupper::Int,mlower::Int) - ccall((:CVBand,libsundials_cvode),Cint,(Ptr{Void},Clong,Clong,Clong),cvode_mem,N,mupper,mlower) + +function __CVBand(cvode_mem::CVODEMemPtr,N::Clong,mupper::Clong,mlower::Clong) + ccall((:CVBand,libsundials_cvodes),Cint,(CVODEMemPtr,Clong,Clong,Clong),cvode_mem,N,mupper,mlower) +end + +function CVBand(cvode_mem,N,mupper,mlower) + __CVBand(convert(CVODEMemPtr,cvode_mem),convert(Clong,N),convert(Clong,mupper),convert(Clong,mlower)) end -function CVBandB(cvode_mem::Ptr{Void},which::Int,nB::Int,mupperB::Int,mlowerB::Int) - ccall((:CVBandB,libsundials_cvode),Cint,(Ptr{Void},Cint,Clong,Clong,Clong),cvode_mem,which,nB,mupperB,mlowerB) +function __CVBandB(cvode_mem::CVODEMemPtr,which::Cint,nB::Clong,mupperB::Clong,mlowerB::Clong) + ccall((:CVBandB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Clong,Clong,Clong),cvode_mem,which,nB,mupperB,mlowerB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_bandpre.h + +function CVBandB(cvode_mem,which,nB,mupperB,mlowerB) + __CVBandB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Clong,nB),convert(Clong,mupperB),convert(Clong,mlowerB)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_bandpre.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVBandPrecInit(cvode_mem::Ptr{Void},N::Int,mu::Int,ml::Int) - ccall((:CVBandPrecInit,libsundials_cvode),Cint,(Ptr{Void},Clong,Clong,Clong),cvode_mem,N,mu,ml) + +function __CVBandPrecInit(cvode_mem::CVODEMemPtr,N::Clong,mu::Clong,ml::Clong) + ccall((:CVBandPrecInit,libsundials_cvodes),Cint,(CVODEMemPtr,Clong,Clong,Clong),cvode_mem,N,mu,ml) +end + +function CVBandPrecInit(cvode_mem,N,mu,ml) + __CVBandPrecInit(convert(CVODEMemPtr,cvode_mem),convert(Clong,N),convert(Clong,mu),convert(Clong,ml)) +end + +function __CVBandPrecGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:CVBandPrecGetWorkSpace,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +end + +function CVBandPrecGetWorkSpace(cvode_mem,lenrwLS,leniwLS) + __CVBandPrecGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwLS),pointer(leniwLS)) end -function CVBandPrecGetWorkSpace(cvode_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:CVBandPrecGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +function __CVBandPrecGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevalsBP::Ptr{Clong}) + ccall((:CVBandPrecGetNumRhsEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevalsBP) end -function CVBandPrecGetNumRhsEvals(cvode_mem::Ptr{Void},nfevalsBP::Ptr{Clong}) - ccall((:CVBandPrecGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevalsBP) +function CVBandPrecGetNumRhsEvals(cvode_mem,nfevalsBP) + __CVBandPrecGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevalsBP)) end -function CVBandPrecInitB(cvode_mem::Ptr{Void},which::Int,nB::Int,muB::Int,mlB::Int) - ccall((:CVBandPrecInitB,libsundials_cvode),Cint,(Ptr{Void},Cint,Clong,Clong,Clong),cvode_mem,which,nB,muB,mlB) +function __CVBandPrecInitB(cvode_mem::CVODEMemPtr,which::Cint,nB::Clong,muB::Clong,mlB::Clong) + ccall((:CVBandPrecInitB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Clong,Clong,Clong),cvode_mem,which,nB,muB,mlB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_bbdpre.h + +function CVBandPrecInitB(cvode_mem,which,nB,muB,mlB) + __CVBandPrecInitB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Clong,nB),convert(Clong,muB),convert(Clong,mlB)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_bbdpre.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVBBDPrecInit(cvode_mem::Ptr{Void},Nlocal::Int,mudq::Int,mldq::Int,mukeep::Int,mlkeep::Int,dqrely::realtype,gloc::CVLocalFn,cfn::CVCommFn) - ccall((:CVBBDPrecInit,libsundials_cvode),Cint,(Ptr{Void},Clong,Clong,Clong,Clong,Clong,realtype,CVLocalFn,CVCommFn),cvode_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dqrely,gloc,cfn) + +function __CVBBDPrecInit(cvode_mem::CVODEMemPtr,Nlocal::Clong,mudq::Clong,mldq::Clong,mukeep::Clong,mlkeep::Clong,dqrely::realtype,gloc::CVLocalFn,cfn::CVCommFn) + ccall((:CVBBDPrecInit,libsundials_cvodes),Cint,(CVODEMemPtr,Clong,Clong,Clong,Clong,Clong,realtype,CVLocalFn,CVCommFn),cvode_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dqrely,gloc,cfn) +end + +function CVBBDPrecInit(cvode_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dqrely,gloc,cfn) + __CVBBDPrecInit(convert(CVODEMemPtr,cvode_mem),convert(Clong,Nlocal),convert(Clong,mudq),convert(Clong,mldq),convert(Clong,mukeep),convert(Clong,mlkeep),dqrely,gloc,cfn) +end + +function __CVBBDPrecReInit(cvode_mem::CVODEMemPtr,mudq::Clong,mldq::Clong,dqrely::realtype) + ccall((:CVBBDPrecReInit,libsundials_cvodes),Cint,(CVODEMemPtr,Clong,Clong,realtype),cvode_mem,mudq,mldq,dqrely) +end + +function CVBBDPrecReInit(cvode_mem,mudq,mldq,dqrely) + __CVBBDPrecReInit(convert(CVODEMemPtr,cvode_mem),convert(Clong,mudq),convert(Clong,mldq),dqrely) +end + +function __CVBBDPrecGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwBBDP::Ptr{Clong},leniwBBDP::Ptr{Clong}) + ccall((:CVBBDPrecGetWorkSpace,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwBBDP,leniwBBDP) +end + +function CVBBDPrecGetWorkSpace(cvode_mem,lenrwBBDP,leniwBBDP) + __CVBBDPrecGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwBBDP),pointer(leniwBBDP)) +end + +function __CVBBDPrecGetNumGfnEvals(cvode_mem::CVODEMemPtr,ngevalsBBDP::Ptr{Clong}) + ccall((:CVBBDPrecGetNumGfnEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,ngevalsBBDP) end -function CVBBDPrecReInit(cvode_mem::Ptr{Void},mudq::Int,mldq::Int,dqrely::realtype) - ccall((:CVBBDPrecReInit,libsundials_cvode),Cint,(Ptr{Void},Clong,Clong,realtype),cvode_mem,mudq,mldq,dqrely) +function CVBBDPrecGetNumGfnEvals(cvode_mem,ngevalsBBDP) + __CVBBDPrecGetNumGfnEvals(convert(CVODEMemPtr,cvode_mem),pointer(ngevalsBBDP)) end -function CVBBDPrecGetWorkSpace(cvode_mem::Ptr{Void},lenrwBBDP::Ptr{Clong},leniwBBDP::Ptr{Clong}) - ccall((:CVBBDPrecGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwBBDP,leniwBBDP) +function __CVBBDPrecInitB(cvode_mem::CVODEMemPtr,which::Cint,NlocalB::Clong,mudqB::Clong,mldqB::Clong,mukeepB::Clong,mlkeepB::Clong,dqrelyB::realtype,glocB::CVLocalFnB,cfnB::CVCommFnB) + ccall((:CVBBDPrecInitB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Clong,Clong,Clong,Clong,Clong,realtype,CVLocalFnB,CVCommFnB),cvode_mem,which,NlocalB,mudqB,mldqB,mukeepB,mlkeepB,dqrelyB,glocB,cfnB) end -function CVBBDPrecGetNumGfnEvals(cvode_mem::Ptr{Void},ngevalsBBDP::Ptr{Clong}) - ccall((:CVBBDPrecGetNumGfnEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,ngevalsBBDP) +function CVBBDPrecInitB(cvode_mem,which,NlocalB,mudqB,mldqB,mukeepB,mlkeepB,dqrelyB,glocB,cfnB) + __CVBBDPrecInitB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Clong,NlocalB),convert(Clong,mudqB),convert(Clong,mldqB),convert(Clong,mukeepB),convert(Clong,mlkeepB),dqrelyB,glocB,cfnB) end -function CVBBDPrecInitB(cvode_mem::Ptr{Void},which::Int,NlocalB::Int,mudqB::Int,mldqB::Int,mukeepB::Int,mlkeepB::Int,dqrelyB::realtype,glocB::CVLocalFnB,cfnB::CVCommFnB) - ccall((:CVBBDPrecInitB,libsundials_cvode),Cint,(Ptr{Void},Cint,Clong,Clong,Clong,Clong,Clong,realtype,CVLocalFnB,CVCommFnB),cvode_mem,which,NlocalB,mudqB,mldqB,mukeepB,mlkeepB,dqrelyB,glocB,cfnB) +function __CVBBDPrecReInitB(cvode_mem::CVODEMemPtr,which::Cint,mudqB::Clong,mldqB::Clong,dqrelyB::realtype) + ccall((:CVBBDPrecReInitB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Clong,Clong,realtype),cvode_mem,which,mudqB,mldqB,dqrelyB) end -function CVBBDPrecReInitB(cvode_mem::Ptr{Void},which::Int,mudqB::Int,mldqB::Int,dqrelyB::realtype) - ccall((:CVBBDPrecReInitB,libsundials_cvode),Cint,(Ptr{Void},Cint,Clong,Clong,realtype),cvode_mem,which,mudqB,mldqB,dqrelyB) +function CVBBDPrecReInitB(cvode_mem,which,mudqB,mldqB,dqrelyB) + __CVBBDPrecReInitB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Clong,mudqB),convert(Clong,mldqB),dqrelyB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_dense.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_dense.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVDense(cvode_mem::Ptr{Void},N::Int) - ccall((:CVDense,libsundials_cvode),Cint,(Ptr{Void},Clong),cvode_mem,N) + +function __CVDense(cvode_mem::CVODEMemPtr,N::Clong) + ccall((:CVDense,libsundials_cvodes),Cint,(CVODEMemPtr,Clong),cvode_mem,N) +end + +function CVDense(cvode_mem,N) + __CVDense(convert(CVODEMemPtr,cvode_mem),convert(Clong,N)) end -function CVDenseB(cvode_mem::Ptr{Void},which::Int,nB::Int) - ccall((:CVDenseB,libsundials_cvode),Cint,(Ptr{Void},Cint,Clong),cvode_mem,which,nB) +function __CVDenseB(cvode_mem::CVODEMemPtr,which::Cint,nB::Clong) + ccall((:CVDenseB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Clong),cvode_mem,which,nB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_diag.h + +function CVDenseB(cvode_mem,which,nB) + __CVDenseB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Clong,nB)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_diag.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVDiag(cvode_mem::Ptr{Void}) - ccall((:CVDiag,libsundials_cvode),Cint,(Ptr{Void},),cvode_mem) + +function __CVDiag(cvode_mem::CVODEMemPtr) + ccall((:CVDiag,libsundials_cvodes),Cint,(CVODEMemPtr,),cvode_mem) end -function CVDiagGetWorkSpace(cvode_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:CVDiagGetWorkSpace,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) +function CVDiag(cvode_mem) + __CVDiag(convert(CVODEMemPtr,cvode_mem)) end -function CVDiagGetNumRhsEvals(cvode_mem::Ptr{Void},nfevalsLS::Ptr{Clong}) - ccall((:CVDiagGetNumRhsEvals,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,nfevalsLS) +function __CVDiagGetWorkSpace(cvode_mem::CVODEMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:CVDiagGetWorkSpace,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong},Ptr{Clong}),cvode_mem,lenrwLS,leniwLS) end -function CVDiagGetLastFlag(cvode_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:CVDiagGetLastFlag,libsundials_cvode),Cint,(Ptr{Void},Ptr{Clong}),cvode_mem,flag) +function CVDiagGetWorkSpace(cvode_mem,lenrwLS,leniwLS) + __CVDiagGetWorkSpace(convert(CVODEMemPtr,cvode_mem),pointer(lenrwLS),pointer(leniwLS)) end -function CVDiagGetReturnFlagName(flag::Int) - ccall((:CVDiagGetReturnFlagName,libsundials_cvode),Ptr{UInt8},(Clong,),flag) +function __CVDiagGetNumRhsEvals(cvode_mem::CVODEMemPtr,nfevalsLS::Ptr{Clong}) + ccall((:CVDiagGetNumRhsEvals,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,nfevalsLS) end -function CVDiagB(cvode_mem::Ptr{Void},which::Int) - ccall((:CVDiagB,libsundials_cvode),Cint,(Ptr{Void},Cint),cvode_mem,which) +function CVDiagGetNumRhsEvals(cvode_mem,nfevalsLS) + __CVDiagGetNumRhsEvals(convert(CVODEMemPtr,cvode_mem),pointer(nfevalsLS)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_impl.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function cvEwtSet(ycur::N_Vector,weight::N_Vector,data::Ptr{Void}) - ccall((:cvEwtSet,libsundials_cvode),Cint,(N_Vector,N_Vector,Ptr{Void}),ycur,weight,data) +function __CVDiagGetLastFlag(cvode_mem::CVODEMemPtr,flag::Ptr{Clong}) + ccall((:CVDiagGetLastFlag,libsundials_cvodes),Cint,(CVODEMemPtr,Ptr{Clong}),cvode_mem,flag) end -function cvErrHandler(error_code::Int,_module::Ptr{UInt8},_function::Ptr{UInt8},msg::Ptr{UInt8},data::Ptr{Void}) - ccall((:cvErrHandler,libsundials_cvode),Void,(Cint,Ptr{UInt8},Ptr{UInt8},Ptr{UInt8},Ptr{Void}),error_code,_module,_function,msg,data) +function CVDiagGetLastFlag(cvode_mem,flag) + __CVDiagGetLastFlag(convert(CVODEMemPtr,cvode_mem),pointer(flag)) end -function cvSensRhsWrapper(cv_mem::CVodeMem,time::realtype,ycur::N_Vector,fcur::N_Vector,yScur::Ptr{N_Vector},fScur::Ptr{N_Vector},temp1::N_Vector,temp2::N_Vector) - ccall((:cvSensRhsWrapper,libsundials_cvode),Cint,(CVodeMem,realtype,N_Vector,N_Vector,Ptr{N_Vector},Ptr{N_Vector},N_Vector,N_Vector),cv_mem,time,ycur,fcur,yScur,fScur,temp1,temp2) +function __CVDiagGetReturnFlagName(flag::Clong) + ccall((:CVDiagGetReturnFlagName,libsundials_cvodes),Ptr{UInt8},(Clong,),flag) end -function cvSensRhs1Wrapper(cv_mem::CVodeMem,time::realtype,ycur::N_Vector,fcur::N_Vector,is::Int,yScur::N_Vector,fScur::N_Vector,temp1::N_Vector,temp2::N_Vector) - ccall((:cvSensRhs1Wrapper,libsundials_cvode),Cint,(CVodeMem,realtype,N_Vector,N_Vector,Cint,N_Vector,N_Vector,N_Vector,N_Vector),cv_mem,time,ycur,fcur,is,yScur,fScur,temp1,temp2) +function CVDiagGetReturnFlagName(flag) + __CVDiagGetReturnFlagName(convert(Clong,flag)) end -function cvSensRhsInternalDQ(Ns::Int,t::realtype,y::N_Vector,ydot::N_Vector,yS::Ptr{N_Vector},ySdot::Ptr{N_Vector},fS_data::Ptr{Void},tempv::N_Vector,ftemp::N_Vector) - ccall((:cvSensRhsInternalDQ,libsundials_cvode),Cint,(Cint,realtype,N_Vector,N_Vector,Ptr{N_Vector},Ptr{N_Vector},Ptr{Void},N_Vector,N_Vector),Ns,t,y,ydot,yS,ySdot,fS_data,tempv,ftemp) +function __CVDiagB(cvode_mem::CVODEMemPtr,which::Cint) + ccall((:CVDiagB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint),cvode_mem,which) end -function cvSensRhs1InternalDQ(Ns::Int,t::realtype,y::N_Vector,ydot::N_Vector,is::Int,yS::N_Vector,ySdot::N_Vector,fS_data::Ptr{Void},tempv::N_Vector,ftemp::N_Vector) - ccall((:cvSensRhs1InternalDQ,libsundials_cvode),Cint,(Cint,realtype,N_Vector,N_Vector,Cint,N_Vector,N_Vector,Ptr{Void},N_Vector,N_Vector),Ns,t,y,ydot,is,yS,ySdot,fS_data,tempv,ftemp) +function CVDiagB(cvode_mem,which) + __CVDiagB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_spbcgs.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_impl.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_spbcgs.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVSpbcg(cvode_mem::Ptr{Void},pretype::Int,maxl::Int) - ccall((:CVSpbcg,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,pretype,maxl) + +function __CVSpbcg(cvode_mem::CVODEMemPtr,pretype::Cint,maxl::Cint) + ccall((:CVSpbcg,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,pretype,maxl) +end + +function CVSpbcg(cvode_mem,pretype,maxl) + __CVSpbcg(convert(CVODEMemPtr,cvode_mem),convert(Cint,pretype),convert(Cint,maxl)) end -function CVSpbcgB(cvode_mem::Ptr{Void},which::Int,pretypeB::Int,maxlB::Int) - ccall((:CVSpbcgB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint,Cint),cvode_mem,which,pretypeB,maxlB) +function __CVSpbcgB(cvode_mem::CVODEMemPtr,which::Cint,pretypeB::Cint,maxlB::Cint) + ccall((:CVSpbcgB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint,Cint),cvode_mem,which,pretypeB,maxlB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_spgmr.h + +function CVSpbcgB(cvode_mem,which,pretypeB,maxlB) + __CVSpbcgB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,pretypeB),convert(Cint,maxlB)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_spgmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVSpgmr(cvode_mem::Ptr{Void},pretype::Int,maxl::Int) - ccall((:CVSpgmr,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,pretype,maxl) + +function __CVSpgmr(cvode_mem::CVODEMemPtr,pretype::Cint,maxl::Cint) + ccall((:CVSpgmr,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,pretype,maxl) +end + +function CVSpgmr(cvode_mem,pretype,maxl) + __CVSpgmr(convert(CVODEMemPtr,cvode_mem),convert(Cint,pretype),convert(Cint,maxl)) +end + +function __CVSpgmrB(cvode_mem::CVODEMemPtr,which::Cint,pretypeB::Cint,maxlB::Cint) + ccall((:CVSpgmrB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint,Cint),cvode_mem,which,pretypeB,maxlB) end -function CVSpgmrB(cvode_mem::Ptr{Void},which::Int,pretypeB::Int,maxlB::Int) - ccall((:CVSpgmrB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint,Cint),cvode_mem,which,pretypeB,maxlB) +function CVSpgmrB(cvode_mem,which,pretypeB,maxlB) + __CVSpgmrB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,pretypeB),convert(Cint,maxlB)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/cvodes/cvodes_sptfqmr.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/cvodes/cvodes_sptfqmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function CVSptfqmr(cvode_mem::Ptr{Void},pretype::Int,maxl::Int) - ccall((:CVSptfqmr,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint),cvode_mem,pretype,maxl) + +function __CVSptfqmr(cvode_mem::CVODEMemPtr,pretype::Cint,maxl::Cint) + ccall((:CVSptfqmr,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint),cvode_mem,pretype,maxl) +end + +function CVSptfqmr(cvode_mem,pretype,maxl) + __CVSptfqmr(convert(CVODEMemPtr,cvode_mem),convert(Cint,pretype),convert(Cint,maxl)) +end + +function __CVSptfqmrB(cvode_mem::CVODEMemPtr,which::Cint,pretypeB::Cint,maxlB::Cint) + ccall((:CVSptfqmrB,libsundials_cvodes),Cint,(CVODEMemPtr,Cint,Cint,Cint),cvode_mem,which,pretypeB,maxlB) end -function CVSptfqmrB(cvode_mem::Ptr{Void},which::Int,pretypeB::Int,maxlB::Int) - ccall((:CVSptfqmrB,libsundials_cvode),Cint,(Ptr{Void},Cint,Cint,Cint),cvode_mem,which,pretypeB,maxlB) +function CVSptfqmrB(cvode_mem,which,pretypeB,maxlB) + __CVSptfqmrB(convert(CVODEMemPtr,cvode_mem),convert(Cint,which),convert(Cint,pretypeB),convert(Cint,maxlB)) end diff --git a/src/handle.jl b/src/handle.jl new file mode 100644 index 00000000..1d7e4f2c --- /dev/null +++ b/src/handle.jl @@ -0,0 +1,58 @@ +################################################################## +# +# Pointers to Sundials objects +# +################################################################## + +""" + Base type for dummy placeholders that help to + providing typed pointers for Sundials objects + (KINSOL, CVODE, IDA). + + See `Handle`. +""" +abstract AbstractSundialsObject + +immutable CVODEMem <: AbstractSundialsObject end +typealias CVODEMemPtr Ptr{CVODEMem} + +immutable IDAMem <: AbstractSundialsObject end +typealias IDAMemPtr Ptr{IDAMem} + +immutable KINMem <: AbstractSundialsObject end +typealias KINMemPtr Ptr{KINMem} + +""" + Handle for Sundials objects (CVODE, IDA, KIN). + + Wraps the reference to the pointer to the Sundials object. + Manages automatic destruction of the referenced objects when it is + no longer in use. +""" +immutable Handle{T <: AbstractSundialsObject} + ptr_ref::Ref{Ptr{T}} # pointer to a pointer + + @compat function (::Type{Handle}){T}(ptr::Ptr{T}) + h = new{T}(Ref{Ptr{T}}(ptr)) + finalizer(h.ptr_ref, release_handle) + return h + end +end + +Base.convert{T}(::Type{Ptr{T}}, h::Handle{T}) = h.ptr_ref[] +Base.convert{T}(::Type{Ptr{Ptr{T}}}, h::Handle{T}) = convert(Ptr{Ptr{T}}, h.ptr_ref[]) + +release_handle{T}(ptr_ref::Ref{Ptr{T}}) = throw(MethodError("Freeing objects of type $T not supported")) +release_handle(ptr_ref::Ref{Ptr{KINMem}}) = KINSOLFree(ptr_ref) +release_handle(ptr_ref::Ref{Ptr{CVODEMem}}) = CVodeFree(ptr_ref) +release_handle(ptr_ref::Ref{Ptr{IDAMem}}) = IDAFree(ptr_ref) + +################################################################## +# +# Convenience typealiases for Sundials handles +# +################################################################## + +typealias CVODEh Handle{CVODEMem} +typealias KINh Handle{KINMem} +typealias IDAh Handle{IDAMem} diff --git a/src/ida.jl b/src/ida.jl index 5f56b3cf..03bcddfb 100644 --- a/src/ida.jl +++ b/src/ida.jl @@ -1,680 +1,748 @@ -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 + function IDACreate() - ccall((:IDACreate,libsundials_ida),Ptr{Void},()) + ccall((:IDACreate,libsundials_ida),IDAMemPtr,()) end -function IDASetErrHandlerFn(ida_mem::Ptr{Void},ehfun::IDAErrHandlerFn,eh_data::Ptr{Void}) - ccall((:IDASetErrHandlerFn,libsundials_ida),Cint,(Ptr{Void},IDAErrHandlerFn,Ptr{Void}),ida_mem,ehfun,eh_data) +function __IDASetErrHandlerFn(ida_mem::IDAMemPtr,ehfun::IDAErrHandlerFn,eh_data::Ptr{Void}) + ccall((:IDASetErrHandlerFn,libsundials_ida),Cint,(IDAMemPtr,IDAErrHandlerFn,Ptr{Void}),ida_mem,ehfun,eh_data) end -function IDASetErrFile(ida_mem::Ptr{Void},errfp::Ptr{Void}) - ccall((:IDASetErrFile,libsundials_ida),Cint,(Ptr{Void},Ptr{Void}),ida_mem,errfp) +function IDASetErrHandlerFn(ida_mem,ehfun,eh_data) + __IDASetErrHandlerFn(convert(IDAMemPtr,ida_mem),ehfun,pointer(eh_data)) end -function IDASetUserData(ida_mem::Ptr{Void},user_data::Ptr{Void}) - ccall((:IDASetUserData,libsundials_ida),Cint,(Ptr{Void},Ptr{Void}),ida_mem,user_data) +function __IDASetErrFile(ida_mem::IDAMemPtr,errfp::Ptr{FILE}) + ccall((:IDASetErrFile,libsundials_ida),Cint,(IDAMemPtr,Ptr{FILE}),ida_mem,errfp) end -function IDASetMaxOrd(ida_mem::Ptr{Void},maxord::Int) - ccall((:IDASetMaxOrd,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxord) +function IDASetErrFile(ida_mem,errfp) + __IDASetErrFile(convert(IDAMemPtr,ida_mem),errfp) end -function IDASetMaxNumSteps(ida_mem::Ptr{Void},mxsteps::Int) - ccall((:IDASetMaxNumSteps,libsundials_ida),Cint,(Ptr{Void},Clong),ida_mem,mxsteps) +function __IDASetUserData(ida_mem::IDAMemPtr,user_data::Any) + ccall((:IDASetUserData,libsundials_ida),Cint,(IDAMemPtr,Any),ida_mem,user_data) end -function IDASetInitStep(ida_mem::Ptr{Void},hin::realtype) - ccall((:IDASetInitStep,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,hin) +function IDASetUserData(ida_mem,user_data) + __IDASetUserData(convert(IDAMemPtr,ida_mem),user_data) end -function IDASetMaxStep(ida_mem::Ptr{Void},hmax::realtype) - ccall((:IDASetMaxStep,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,hmax) +function __IDASetMaxOrd(ida_mem::IDAMemPtr,maxord::Cint) + ccall((:IDASetMaxOrd,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxord) end -function IDASetStopTime(ida_mem::Ptr{Void},tstop::realtype) - ccall((:IDASetStopTime,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,tstop) +function IDASetMaxOrd(ida_mem,maxord) + __IDASetMaxOrd(convert(IDAMemPtr,ida_mem),convert(Cint,maxord)) end -function IDASetNonlinConvCoef(ida_mem::Ptr{Void},epcon::realtype) - ccall((:IDASetNonlinConvCoef,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,epcon) +function __IDASetMaxNumSteps(ida_mem::IDAMemPtr,mxsteps::Clong) + ccall((:IDASetMaxNumSteps,libsundials_ida),Cint,(IDAMemPtr,Clong),ida_mem,mxsteps) end -function IDASetMaxErrTestFails(ida_mem::Ptr{Void},maxnef::Int) - ccall((:IDASetMaxErrTestFails,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnef) +function IDASetMaxNumSteps(ida_mem,mxsteps) + __IDASetMaxNumSteps(convert(IDAMemPtr,ida_mem),convert(Clong,mxsteps)) end -function IDASetMaxNonlinIters(ida_mem::Ptr{Void},maxcor::Int) - ccall((:IDASetMaxNonlinIters,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxcor) +function __IDASetInitStep(ida_mem::IDAMemPtr,hin::realtype) + ccall((:IDASetInitStep,libsundials_ida),Cint,(IDAMemPtr,realtype),ida_mem,hin) end -function IDASetMaxConvFails(ida_mem::Ptr{Void},maxncf::Int) - ccall((:IDASetMaxConvFails,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxncf) +function IDASetInitStep(ida_mem,hin) + __IDASetInitStep(convert(IDAMemPtr,ida_mem),hin) end -function IDASetSuppressAlg(ida_mem::Ptr{Void},suppressalg::Int) - ccall((:IDASetSuppressAlg,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,suppressalg) +function __IDASetMaxStep(ida_mem::IDAMemPtr,hmax::realtype) + ccall((:IDASetMaxStep,libsundials_ida),Cint,(IDAMemPtr,realtype),ida_mem,hmax) end -function IDASetId(ida_mem::Ptr{Void},id::N_Vector) - ccall((:IDASetId,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,id) +function IDASetMaxStep(ida_mem,hmax) + __IDASetMaxStep(convert(IDAMemPtr,ida_mem),hmax) end -function IDASetConstraints(ida_mem::Ptr{Void},constraints::N_Vector) - ccall((:IDASetConstraints,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,constraints) +function __IDASetStopTime(ida_mem::IDAMemPtr,tstop::realtype) + ccall((:IDASetStopTime,libsundials_ida),Cint,(IDAMemPtr,realtype),ida_mem,tstop) end -function IDASetRootDirection(ida_mem::Ptr{Void},rootdir::Ptr{Cint}) - ccall((:IDASetRootDirection,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,rootdir) +function IDASetStopTime(ida_mem,tstop) + __IDASetStopTime(convert(IDAMemPtr,ida_mem),tstop) end -function IDASetNoInactiveRootWarn(ida_mem::Ptr{Void}) - ccall((:IDASetNoInactiveRootWarn,libsundials_ida),Cint,(Ptr{Void},),ida_mem) +function __IDASetNonlinConvCoef(ida_mem::IDAMemPtr,epcon::realtype) + ccall((:IDASetNonlinConvCoef,libsundials_ida),Cint,(IDAMemPtr,realtype),ida_mem,epcon) end -function IDAInit(ida_mem::Ptr{Void},res::IDAResFn,t0::realtype,yy0::N_Vector,yp0::N_Vector) - ccall((:IDAInit,libsundials_ida),Cint,(Ptr{Void},IDAResFn,realtype,N_Vector,N_Vector),ida_mem,res,t0,yy0,yp0) +function IDASetNonlinConvCoef(ida_mem,epcon) + __IDASetNonlinConvCoef(convert(IDAMemPtr,ida_mem),epcon) end -function IDAReInit(ida_mem::Ptr{Void},t0::realtype,yy0::N_Vector,yp0::N_Vector) - ccall((:IDAReInit,libsundials_ida),Cint,(Ptr{Void},realtype,N_Vector,N_Vector),ida_mem,t0,yy0,yp0) +function __IDASetMaxErrTestFails(ida_mem::IDAMemPtr,maxnef::Cint) + ccall((:IDASetMaxErrTestFails,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxnef) end -function IDASStolerances(ida_mem::Ptr{Void},reltol::realtype,abstol::realtype) - ccall((:IDASStolerances,libsundials_ida),Cint,(Ptr{Void},realtype,realtype),ida_mem,reltol,abstol) +function IDASetMaxErrTestFails(ida_mem,maxnef) + __IDASetMaxErrTestFails(convert(IDAMemPtr,ida_mem),convert(Cint,maxnef)) end -function IDASVtolerances(ida_mem::Ptr{Void},reltol::realtype,abstol::N_Vector) - ccall((:IDASVtolerances,libsundials_ida),Cint,(Ptr{Void},realtype,N_Vector),ida_mem,reltol,abstol) +function __IDASetMaxNonlinIters(ida_mem::IDAMemPtr,maxcor::Cint) + ccall((:IDASetMaxNonlinIters,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxcor) end -function IDAWFtolerances(ida_mem::Ptr{Void},efun::IDAEwtFn) - ccall((:IDAWFtolerances,libsundials_ida),Cint,(Ptr{Void},IDAEwtFn),ida_mem,efun) +function IDASetMaxNonlinIters(ida_mem,maxcor) + __IDASetMaxNonlinIters(convert(IDAMemPtr,ida_mem),convert(Cint,maxcor)) end -function IDASetNonlinConvCoefIC(ida_mem::Ptr{Void},epiccon::realtype) - ccall((:IDASetNonlinConvCoefIC,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,epiccon) +function __IDASetMaxConvFails(ida_mem::IDAMemPtr,maxncf::Cint) + ccall((:IDASetMaxConvFails,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxncf) end -function IDASetMaxNumStepsIC(ida_mem::Ptr{Void},maxnh::Int) - ccall((:IDASetMaxNumStepsIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnh) +function IDASetMaxConvFails(ida_mem,maxncf) + __IDASetMaxConvFails(convert(IDAMemPtr,ida_mem),convert(Cint,maxncf)) end -function IDASetMaxNumJacsIC(ida_mem::Ptr{Void},maxnj::Int) - ccall((:IDASetMaxNumJacsIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnj) +function __IDASetSuppressAlg(ida_mem::IDAMemPtr,suppressalg::Cint) + ccall((:IDASetSuppressAlg,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,suppressalg) end -function IDASetMaxNumItersIC(ida_mem::Ptr{Void},maxnit::Int) - ccall((:IDASetMaxNumItersIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnit) +function IDASetSuppressAlg(ida_mem,suppressalg) + __IDASetSuppressAlg(convert(IDAMemPtr,ida_mem),convert(Cint,suppressalg)) end -function IDASetLineSearchOffIC(ida_mem::Ptr{Void},lsoff::Int) - ccall((:IDASetLineSearchOffIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,lsoff) +function __IDASetId(ida_mem::IDAMemPtr,id::N_Vector) + ccall((:IDASetId,libsundials_ida),Cint,(IDAMemPtr,N_Vector),ida_mem,id) end -function IDASetStepToleranceIC(ida_mem::Ptr{Void},steptol::realtype) - ccall((:IDASetStepToleranceIC,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,steptol) +function IDASetId(ida_mem,id) + __id = convert(NVector,id) + __IDASetId(convert(IDAMemPtr,ida_mem),convert(N_Vector,__id)) end -function IDARootInit(ida_mem::Ptr{Void},nrtfn::Int,g::IDARootFn) - ccall((:IDARootInit,libsundials_ida),Cint,(Ptr{Void},Cint,IDARootFn),ida_mem,nrtfn,g) +function __IDASetConstraints(ida_mem::IDAMemPtr,constraints::N_Vector) + ccall((:IDASetConstraints,libsundials_ida),Cint,(IDAMemPtr,N_Vector),ida_mem,constraints) end -function IDACalcIC(ida_mem::Ptr{Void},icopt::Int,tout1::realtype) - ccall((:IDACalcIC,libsundials_ida),Cint,(Ptr{Void},Cint,realtype),ida_mem,icopt,tout1) +function IDASetConstraints(ida_mem,constraints) + __constraints = convert(NVector,constraints) + __IDASetConstraints(convert(IDAMemPtr,ida_mem),convert(N_Vector,__constraints)) end -function IDASolve(ida_mem::Ptr{Void},tout::realtype,tret::Vector{realtype},yret::N_Vector,ypret::N_Vector,itask::Int) - ccall((:IDASolve,libsundials_ida),Cint,(Ptr{Void},realtype,Ptr{realtype},N_Vector,N_Vector,Cint),ida_mem,tout,tret,yret,ypret,itask) +function __IDASetRootDirection(ida_mem::IDAMemPtr,rootdir::Ptr{Cint}) + ccall((:IDASetRootDirection,libsundials_ida),Cint,(IDAMemPtr,Ptr{Cint}),ida_mem,rootdir) end -function IDAGetDky(ida_mem::Ptr{Void},t::realtype,k::Int,dky::N_Vector) - ccall((:IDAGetDky,libsundials_ida),Cint,(Ptr{Void},realtype,Cint,N_Vector),ida_mem,t,k,dky) +function IDASetRootDirection(ida_mem,rootdir) + __IDASetRootDirection(convert(IDAMemPtr,ida_mem),pointer(rootdir)) end -function IDAGetWorkSpace(ida_mem::Ptr{Void},lenrw::Ptr{Clong},leniw::Ptr{Clong}) - ccall((:IDAGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrw,leniw) +function __IDASetNoInactiveRootWarn(ida_mem::IDAMemPtr) + ccall((:IDASetNoInactiveRootWarn,libsundials_ida),Cint,(IDAMemPtr,),ida_mem) end -function IDAGetNumSteps(ida_mem::Ptr{Void},nsteps::Ptr{Clong}) - ccall((:IDAGetNumSteps,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nsteps) +function IDASetNoInactiveRootWarn(ida_mem) + __IDASetNoInactiveRootWarn(convert(IDAMemPtr,ida_mem)) end -function IDAGetNumResEvals(ida_mem::Ptr{Void},nrevals::Ptr{Clong}) - ccall((:IDAGetNumResEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nrevals) +function __IDAInit(ida_mem::IDAMemPtr,res::IDAResFn,t0::realtype,yy0::N_Vector,yp0::N_Vector) + ccall((:IDAInit,libsundials_ida),Cint,(IDAMemPtr,IDAResFn,realtype,N_Vector,N_Vector),ida_mem,res,t0,yy0,yp0) end -function IDAGetNumLinSolvSetups(ida_mem::Ptr{Void},nlinsetups::Ptr{Clong}) - ccall((:IDAGetNumLinSolvSetups,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nlinsetups) +function IDAInit(ida_mem,res,t0,yy0,yp0) + __yy0 = convert(NVector,yy0) + __yp0 = convert(NVector,yp0) + __IDAInit(convert(IDAMemPtr,ida_mem),IDAResFn_wrapper(res),t0,convert(N_Vector,__yy0),convert(N_Vector,__yp0)) end -function IDAGetNumErrTestFails(ida_mem::Ptr{Void},netfails::Ptr{Clong}) - ccall((:IDAGetNumErrTestFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,netfails) +function __IDAReInit(ida_mem::IDAMemPtr,t0::realtype,yy0::N_Vector,yp0::N_Vector) + ccall((:IDAReInit,libsundials_ida),Cint,(IDAMemPtr,realtype,N_Vector,N_Vector),ida_mem,t0,yy0,yp0) end -function IDAGetNumBacktrackOps(ida_mem::Ptr{Void},nbacktr::Ptr{Clong}) - ccall((:IDAGetNumBacktrackOps,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nbacktr) +function IDAReInit(ida_mem,t0,yy0,yp0) + __yy0 = convert(NVector,yy0) + __yp0 = convert(NVector,yp0) + __IDAReInit(convert(IDAMemPtr,ida_mem),t0,convert(N_Vector,__yy0),convert(N_Vector,__yp0)) end -function IDAGetConsistentIC(ida_mem::Ptr{Void},yy0_mod::N_Vector,yp0_mod::N_Vector) - ccall((:IDAGetConsistentIC,libsundials_ida),Cint,(Ptr{Void},N_Vector,N_Vector),ida_mem,yy0_mod,yp0_mod) +function __IDASStolerances(ida_mem::IDAMemPtr,reltol::realtype,abstol::realtype) + ccall((:IDASStolerances,libsundials_ida),Cint,(IDAMemPtr,realtype,realtype),ida_mem,reltol,abstol) end -function IDAGetLastOrder(ida_mem::Ptr{Void},klast::Ptr{Cint}) - ccall((:IDAGetLastOrder,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,klast) +function IDASStolerances(ida_mem,reltol,abstol) + __IDASStolerances(convert(IDAMemPtr,ida_mem),reltol,abstol) end -function IDAGetCurrentOrder(ida_mem::Ptr{Void},kcur::Ptr{Cint}) - ccall((:IDAGetCurrentOrder,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,kcur) +function __IDASVtolerances(ida_mem::IDAMemPtr,reltol::realtype,abstol::N_Vector) + ccall((:IDASVtolerances,libsundials_ida),Cint,(IDAMemPtr,realtype,N_Vector),ida_mem,reltol,abstol) end -function IDAGetActualInitStep(ida_mem::Ptr{Void},hinused::Vector{realtype}) - ccall((:IDAGetActualInitStep,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,hinused) +function IDASVtolerances(ida_mem,reltol,abstol) + __abstol = convert(NVector,abstol) + __IDASVtolerances(convert(IDAMemPtr,ida_mem),reltol,convert(N_Vector,__abstol)) end -function IDAGetLastStep(ida_mem::Ptr{Void},hlast::Vector{realtype}) - ccall((:IDAGetLastStep,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,hlast) +function __IDAWFtolerances(ida_mem::IDAMemPtr,efun::IDAEwtFn) + ccall((:IDAWFtolerances,libsundials_ida),Cint,(IDAMemPtr,IDAEwtFn),ida_mem,efun) end -function IDAGetCurrentStep(ida_mem::Ptr{Void},hcur::Vector{realtype}) - ccall((:IDAGetCurrentStep,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,hcur) +function IDAWFtolerances(ida_mem,efun) + __IDAWFtolerances(convert(IDAMemPtr,ida_mem),efun) end -function IDAGetCurrentTime(ida_mem::Ptr{Void},tcur::Vector{realtype}) - ccall((:IDAGetCurrentTime,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,tcur) +function __IDASetNonlinConvCoefIC(ida_mem::IDAMemPtr,epiccon::realtype) + ccall((:IDASetNonlinConvCoefIC,libsundials_ida),Cint,(IDAMemPtr,realtype),ida_mem,epiccon) end -function IDAGetTolScaleFactor(ida_mem::Ptr{Void},tolsfact::Vector{realtype}) - ccall((:IDAGetTolScaleFactor,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,tolsfact) +function IDASetNonlinConvCoefIC(ida_mem,epiccon) + __IDASetNonlinConvCoefIC(convert(IDAMemPtr,ida_mem),epiccon) end -function IDAGetErrWeights(ida_mem::Ptr{Void},eweight::N_Vector) - ccall((:IDAGetErrWeights,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,eweight) +function __IDASetMaxNumStepsIC(ida_mem::IDAMemPtr,maxnh::Cint) + ccall((:IDASetMaxNumStepsIC,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxnh) end -function IDAGetEstLocalErrors(ida_mem::Ptr{Void},ele::N_Vector) - ccall((:IDAGetEstLocalErrors,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,ele) +function IDASetMaxNumStepsIC(ida_mem,maxnh) + __IDASetMaxNumStepsIC(convert(IDAMemPtr,ida_mem),convert(Cint,maxnh)) end -function IDAGetNumGEvals(ida_mem::Ptr{Void},ngevals::Ptr{Clong}) - ccall((:IDAGetNumGEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,ngevals) +function __IDASetMaxNumJacsIC(ida_mem::IDAMemPtr,maxnj::Cint) + ccall((:IDASetMaxNumJacsIC,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxnj) end -function IDAGetRootInfo(ida_mem::Ptr{Void},rootsfound::Ptr{Cint}) - ccall((:IDAGetRootInfo,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,rootsfound) +function IDASetMaxNumJacsIC(ida_mem,maxnj) + __IDASetMaxNumJacsIC(convert(IDAMemPtr,ida_mem),convert(Cint,maxnj)) end -function IDAGetIntegratorStats(ida_mem::Ptr{Void},nsteps::Ptr{Clong},nrevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Vector{realtype},hlast::Vector{realtype},hcur::Vector{realtype},tcur::Vector{realtype}) - ccall((:IDAGetIntegratorStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),ida_mem,nsteps,nrevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) +function __IDASetMaxNumItersIC(ida_mem::IDAMemPtr,maxnit::Cint) + ccall((:IDASetMaxNumItersIC,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxnit) end -function IDAGetNumNonlinSolvIters(ida_mem::Ptr{Void},nniters::Ptr{Clong}) - ccall((:IDAGetNumNonlinSolvIters,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nniters) +function IDASetMaxNumItersIC(ida_mem,maxnit) + __IDASetMaxNumItersIC(convert(IDAMemPtr,ida_mem),convert(Cint,maxnit)) end -function IDAGetNumNonlinSolvConvFails(ida_mem::Ptr{Void},nncfails::Ptr{Clong}) - ccall((:IDAGetNumNonlinSolvConvFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nncfails) +function __IDASetLineSearchOffIC(ida_mem::IDAMemPtr,lsoff::Cint) + ccall((:IDASetLineSearchOffIC,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,lsoff) end -function IDAGetNonlinSolvStats(ida_mem::Ptr{Void},nniters::Ptr{Clong},nncfails::Ptr{Clong}) - ccall((:IDAGetNonlinSolvStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,nniters,nncfails) +function IDASetLineSearchOffIC(ida_mem,lsoff) + __IDASetLineSearchOffIC(convert(IDAMemPtr,ida_mem),convert(Cint,lsoff)) end -function IDAGetReturnFlagName(flag::Int) - ccall((:IDAGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) +function __IDASetStepToleranceIC(ida_mem::IDAMemPtr,steptol::realtype) + ccall((:IDASetStepToleranceIC,libsundials_ida),Cint,(IDAMemPtr,realtype),ida_mem,steptol) end -function IDAFree(ida_mem::Vector{Ptr{Void}}) - ccall((:IDAFree,libsundials_ida),Void,(Ptr{Ptr{Void}},),ida_mem) +function IDASetStepToleranceIC(ida_mem,steptol) + __IDASetStepToleranceIC(convert(IDAMemPtr,ida_mem),steptol) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida_direct.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function __IDARootInit(ida_mem::IDAMemPtr,nrtfn::Cint,g::IDARootFn) + ccall((:IDARootInit,libsundials_ida),Cint,(IDAMemPtr,Cint,IDARootFn),ida_mem,nrtfn,g) +end -function IDADlsSetDenseJacFn(ida_mem::Ptr{Void},jac::IDADlsDenseJacFn) - ccall((:IDADlsSetDenseJacFn,libsundials_ida),Cint,(Ptr{Void},IDADlsDenseJacFn),ida_mem,jac) +function IDARootInit(ida_mem,nrtfn,g) + __IDARootInit(convert(IDAMemPtr,ida_mem),convert(Cint,nrtfn),IDARootFn_wrapper(g)) end -function IDADlsSetBandJacFn(ida_mem::Ptr{Void},jac::IDADlsBandJacFn) - ccall((:IDADlsSetBandJacFn,libsundials_ida),Cint,(Ptr{Void},IDADlsBandJacFn),ida_mem,jac) +function __IDACalcIC(ida_mem::IDAMemPtr,icopt::Cint,tout1::realtype) + ccall((:IDACalcIC,libsundials_ida),Cint,(IDAMemPtr,Cint,realtype),ida_mem,icopt,tout1) end -function IDADlsGetWorkSpace(ida_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:IDADlsGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrwLS,leniwLS) +function IDACalcIC(ida_mem,icopt,tout1) + __IDACalcIC(convert(IDAMemPtr,ida_mem),convert(Cint,icopt),tout1) end -function IDADlsGetNumJacEvals(ida_mem::Ptr{Void},njevals::Ptr{Clong}) - ccall((:IDADlsGetNumJacEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,njevals) +function __IDASolve(ida_mem::IDAMemPtr,tout::realtype,tret::Ptr{realtype},yret::N_Vector,ypret::N_Vector,itask::Cint) + ccall((:IDASolve,libsundials_ida),Cint,(IDAMemPtr,realtype,Ptr{realtype},N_Vector,N_Vector,Cint),ida_mem,tout,tret,yret,ypret,itask) end -function IDADlsGetNumResEvals(ida_mem::Ptr{Void},nfevalsLS::Ptr{Clong}) - ccall((:IDADlsGetNumResEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nfevalsLS) +function IDASolve(ida_mem,tout,tret,yret,ypret,itask) + __yret = convert(NVector,yret) + __ypret = convert(NVector,ypret) + __IDASolve(convert(IDAMemPtr,ida_mem),tout,pointer(tret),convert(N_Vector,__yret),convert(N_Vector,__ypret),convert(Cint,itask)) end -function IDADlsGetLastFlag(ida_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:IDADlsGetLastFlag,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,flag) +function __IDAGetDky(ida_mem::IDAMemPtr,t::realtype,k::Cint,dky::N_Vector) + ccall((:IDAGetDky,libsundials_ida),Cint,(IDAMemPtr,realtype,Cint,N_Vector),ida_mem,t,k,dky) end -function IDADlsGetReturnFlagName(flag::Int) - ccall((:IDADlsGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) +function IDAGetDky(ida_mem,t,k,dky) + __dky = convert(NVector,dky) + __IDAGetDky(convert(IDAMemPtr,ida_mem),t,convert(Cint,k),convert(N_Vector,__dky)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida_spils.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function __IDAGetWorkSpace(ida_mem::IDAMemPtr,lenrw::Ptr{Clong},leniw::Ptr{Clong}) + ccall((:IDAGetWorkSpace,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,lenrw,leniw) +end -function IDASpilsSetPreconditioner(ida_mem::Ptr{Void},pset::IDASpilsPrecSetupFn,psolve::IDASpilsPrecSolveFn) - ccall((:IDASpilsSetPreconditioner,libsundials_ida),Cint,(Ptr{Void},IDASpilsPrecSetupFn,IDASpilsPrecSolveFn),ida_mem,pset,psolve) +function IDAGetWorkSpace(ida_mem,lenrw,leniw) + __IDAGetWorkSpace(convert(IDAMemPtr,ida_mem),pointer(lenrw),pointer(leniw)) end -function IDASpilsSetJacTimesVecFn(ida_mem::Ptr{Void},jtv::IDASpilsJacTimesVecFn) - ccall((:IDASpilsSetJacTimesVecFn,libsundials_ida),Cint,(Ptr{Void},IDASpilsJacTimesVecFn),ida_mem,jtv) +function __IDAGetNumSteps(ida_mem::IDAMemPtr,nsteps::Ptr{Clong}) + ccall((:IDAGetNumSteps,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nsteps) end -function IDASpilsSetGSType(ida_mem::Ptr{Void},gstype::Int) - ccall((:IDASpilsSetGSType,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,gstype) +function IDAGetNumSteps(ida_mem,nsteps) + __IDAGetNumSteps(convert(IDAMemPtr,ida_mem),pointer(nsteps)) end -function IDASpilsSetMaxRestarts(ida_mem::Ptr{Void},maxrs::Int) - ccall((:IDASpilsSetMaxRestarts,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxrs) +function __IDAGetNumResEvals(ida_mem::IDAMemPtr,nrevals::Ptr{Clong}) + ccall((:IDAGetNumResEvals,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nrevals) end -function IDASpilsSetMaxl(ida_mem::Ptr{Void},maxl::Int) - ccall((:IDASpilsSetMaxl,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxl) +function IDAGetNumResEvals(ida_mem,nrevals) + __IDAGetNumResEvals(convert(IDAMemPtr,ida_mem),pointer(nrevals)) end -function IDASpilsSetEpsLin(ida_mem::Ptr{Void},eplifac::realtype) - ccall((:IDASpilsSetEpsLin,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,eplifac) +function __IDAGetNumLinSolvSetups(ida_mem::IDAMemPtr,nlinsetups::Ptr{Clong}) + ccall((:IDAGetNumLinSolvSetups,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nlinsetups) end -function IDASpilsSetIncrementFactor(ida_mem::Ptr{Void},dqincfac::realtype) - ccall((:IDASpilsSetIncrementFactor,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,dqincfac) +function IDAGetNumLinSolvSetups(ida_mem,nlinsetups) + __IDAGetNumLinSolvSetups(convert(IDAMemPtr,ida_mem),pointer(nlinsetups)) end -function IDASpilsGetWorkSpace(ida_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:IDASpilsGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrwLS,leniwLS) +function __IDAGetNumErrTestFails(ida_mem::IDAMemPtr,netfails::Ptr{Clong}) + ccall((:IDAGetNumErrTestFails,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,netfails) end -function IDASpilsGetNumPrecEvals(ida_mem::Ptr{Void},npevals::Ptr{Clong}) - ccall((:IDASpilsGetNumPrecEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,npevals) +function IDAGetNumErrTestFails(ida_mem,netfails) + __IDAGetNumErrTestFails(convert(IDAMemPtr,ida_mem),pointer(netfails)) end -function IDASpilsGetNumPrecSolves(ida_mem::Ptr{Void},npsolves::Ptr{Clong}) - ccall((:IDASpilsGetNumPrecSolves,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,npsolves) +function __IDAGetNumBacktrackOps(ida_mem::IDAMemPtr,nbacktr::Ptr{Clong}) + ccall((:IDAGetNumBacktrackOps,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nbacktr) end -function IDASpilsGetNumLinIters(ida_mem::Ptr{Void},nliters::Ptr{Clong}) - ccall((:IDASpilsGetNumLinIters,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nliters) +function IDAGetNumBacktrackOps(ida_mem,nbacktr) + __IDAGetNumBacktrackOps(convert(IDAMemPtr,ida_mem),pointer(nbacktr)) end -function IDASpilsGetNumConvFails(ida_mem::Ptr{Void},nlcfails::Ptr{Clong}) - ccall((:IDASpilsGetNumConvFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nlcfails) +function __IDAGetConsistentIC(ida_mem::IDAMemPtr,yy0_mod::N_Vector,yp0_mod::N_Vector) + ccall((:IDAGetConsistentIC,libsundials_ida),Cint,(IDAMemPtr,N_Vector,N_Vector),ida_mem,yy0_mod,yp0_mod) end -function IDASpilsGetNumJtimesEvals(ida_mem::Ptr{Void},njvevals::Ptr{Clong}) - ccall((:IDASpilsGetNumJtimesEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,njvevals) +function IDAGetConsistentIC(ida_mem,yy0_mod,yp0_mod) + __yy0_mod = convert(NVector,yy0_mod) + __yp0_mod = convert(NVector,yp0_mod) + __IDAGetConsistentIC(convert(IDAMemPtr,ida_mem),convert(N_Vector,__yy0_mod),convert(N_Vector,__yp0_mod)) end -function IDASpilsGetNumResEvals(ida_mem::Ptr{Void},nrevalsLS::Ptr{Clong}) - ccall((:IDASpilsGetNumResEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nrevalsLS) +function __IDAGetLastOrder(ida_mem::IDAMemPtr,klast::Ptr{Cint}) + ccall((:IDAGetLastOrder,libsundials_ida),Cint,(IDAMemPtr,Ptr{Cint}),ida_mem,klast) end -function IDASpilsGetLastFlag(ida_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:IDASpilsGetLastFlag,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,flag) +function IDAGetLastOrder(ida_mem,klast) + __IDAGetLastOrder(convert(IDAMemPtr,ida_mem),pointer(klast)) end -function IDASpilsGetReturnFlagName(flag::Int) - ccall((:IDASpilsGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) +function __IDAGetCurrentOrder(ida_mem::IDAMemPtr,kcur::Ptr{Cint}) + ccall((:IDAGetCurrentOrder,libsundials_ida),Cint,(IDAMemPtr,Ptr{Cint}),ida_mem,kcur) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida_band.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDADlsSetDenseJacFn(ida_mem::Ptr{Void},jac::IDADlsDenseJacFn) - ccall((:IDADlsSetDenseJacFn,libsundials_ida),Cint,(Ptr{Void},IDADlsDenseJacFn),ida_mem,jac) +function IDAGetCurrentOrder(ida_mem,kcur) + __IDAGetCurrentOrder(convert(IDAMemPtr,ida_mem),pointer(kcur)) end -function IDADlsSetBandJacFn(ida_mem::Ptr{Void},jac::IDADlsBandJacFn) - ccall((:IDADlsSetBandJacFn,libsundials_ida),Cint,(Ptr{Void},IDADlsBandJacFn),ida_mem,jac) +function __IDAGetActualInitStep(ida_mem::IDAMemPtr,hinused::Ptr{realtype}) + ccall((:IDAGetActualInitStep,libsundials_ida),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,hinused) end -function IDADlsGetWorkSpace(ida_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:IDADlsGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrwLS,leniwLS) +function IDAGetActualInitStep(ida_mem,hinused) + __IDAGetActualInitStep(convert(IDAMemPtr,ida_mem),pointer(hinused)) end -function IDADlsGetNumJacEvals(ida_mem::Ptr{Void},njevals::Ptr{Clong}) - ccall((:IDADlsGetNumJacEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,njevals) +function __IDAGetLastStep(ida_mem::IDAMemPtr,hlast::Ptr{realtype}) + ccall((:IDAGetLastStep,libsundials_ida),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,hlast) end -function IDADlsGetNumResEvals(ida_mem::Ptr{Void},nfevalsLS::Ptr{Clong}) - ccall((:IDADlsGetNumResEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nfevalsLS) +function IDAGetLastStep(ida_mem,hlast) + __IDAGetLastStep(convert(IDAMemPtr,ida_mem),pointer(hlast)) end -function IDADlsGetLastFlag(ida_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:IDADlsGetLastFlag,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,flag) +function __IDAGetCurrentStep(ida_mem::IDAMemPtr,hcur::Ptr{realtype}) + ccall((:IDAGetCurrentStep,libsundials_ida),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,hcur) end -function IDADlsGetReturnFlagName(flag::Int) - ccall((:IDADlsGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) +function IDAGetCurrentStep(ida_mem,hcur) + __IDAGetCurrentStep(convert(IDAMemPtr,ida_mem),pointer(hcur)) end -function IDABand(ida_mem::Ptr{Void},Neq::Int,mupper::Int,mlower::Int) - ccall((:IDABand,libsundials_ida),Cint,(Ptr{Void},Clong,Clong,Clong),ida_mem,Neq,mupper,mlower) +function __IDAGetCurrentTime(ida_mem::IDAMemPtr,tcur::Ptr{realtype}) + ccall((:IDAGetCurrentTime,libsundials_ida),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,tcur) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida_bbdpre.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDABBDPrecInit(ida_mem::Ptr{Void},Nlocal::Int,mudq::Int,mldq::Int,mukeep::Int,mlkeep::Int,dq_rel_yy::realtype,Gres::IDABBDLocalFn,Gcomm::IDABBDCommFn) - ccall((:IDABBDPrecInit,libsundials_ida),Cint,(Ptr{Void},Clong,Clong,Clong,Clong,Clong,realtype,IDABBDLocalFn,IDABBDCommFn),ida_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dq_rel_yy,Gres,Gcomm) +function IDAGetCurrentTime(ida_mem,tcur) + __IDAGetCurrentTime(convert(IDAMemPtr,ida_mem),pointer(tcur)) end -function IDABBDPrecReInit(ida_mem::Ptr{Void},mudq::Int,mldq::Int,dq_rel_yy::realtype) - ccall((:IDABBDPrecReInit,libsundials_ida),Cint,(Ptr{Void},Clong,Clong,realtype),ida_mem,mudq,mldq,dq_rel_yy) +function __IDAGetTolScaleFactor(ida_mem::IDAMemPtr,tolsfact::Ptr{realtype}) + ccall((:IDAGetTolScaleFactor,libsundials_ida),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,tolsfact) end -function IDABBDPrecGetWorkSpace(ida_mem::Ptr{Void},lenrwBBDP::Ptr{Clong},leniwBBDP::Ptr{Clong}) - ccall((:IDABBDPrecGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrwBBDP,leniwBBDP) +function IDAGetTolScaleFactor(ida_mem,tolsfact) + __IDAGetTolScaleFactor(convert(IDAMemPtr,ida_mem),pointer(tolsfact)) end -function IDABBDPrecGetNumGfnEvals(ida_mem::Ptr{Void},ngevalsBBDP::Ptr{Clong}) - ccall((:IDABBDPrecGetNumGfnEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,ngevalsBBDP) +function __IDAGetErrWeights(ida_mem::IDAMemPtr,eweight::N_Vector) + ccall((:IDAGetErrWeights,libsundials_ida),Cint,(IDAMemPtr,N_Vector),ida_mem,eweight) +end + +function IDAGetErrWeights(ida_mem,eweight) + __eweight = convert(NVector,eweight) + __IDAGetErrWeights(convert(IDAMemPtr,ida_mem),convert(N_Vector,__eweight)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida_dense.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function __IDAGetEstLocalErrors(ida_mem::IDAMemPtr,ele::N_Vector) + ccall((:IDAGetEstLocalErrors,libsundials_ida),Cint,(IDAMemPtr,N_Vector),ida_mem,ele) +end -function IDADense(ida_mem::Ptr{Void},Neq::Int) - ccall((:IDADense,libsundials_ida),Cint,(Ptr{Void},Clong),ida_mem,Neq) +function IDAGetEstLocalErrors(ida_mem,ele) + __ele = convert(NVector,ele) + __IDAGetEstLocalErrors(convert(IDAMemPtr,ida_mem),convert(N_Vector,__ele)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida_impl.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function __IDAGetNumGEvals(ida_mem::IDAMemPtr,ngevals::Ptr{Clong}) + ccall((:IDAGetNumGEvals,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,ngevals) +end -function IDACreate() - ccall((:IDACreate,libsundials_ida),Ptr{Void},()) +function IDAGetNumGEvals(ida_mem,ngevals) + __IDAGetNumGEvals(convert(IDAMemPtr,ida_mem),pointer(ngevals)) end -function IDASetErrHandlerFn(ida_mem::Ptr{Void},ehfun::IDAErrHandlerFn,eh_data::Ptr{Void}) - ccall((:IDASetErrHandlerFn,libsundials_ida),Cint,(Ptr{Void},IDAErrHandlerFn,Ptr{Void}),ida_mem,ehfun,eh_data) +function __IDAGetRootInfo(ida_mem::IDAMemPtr,rootsfound::Ptr{Cint}) + ccall((:IDAGetRootInfo,libsundials_ida),Cint,(IDAMemPtr,Ptr{Cint}),ida_mem,rootsfound) end -function IDASetErrFile(ida_mem::Ptr{Void},errfp::Ptr{Void}) - ccall((:IDASetErrFile,libsundials_ida),Cint,(Ptr{Void},Ptr{Void}),ida_mem,errfp) +function IDAGetRootInfo(ida_mem,rootsfound) + __IDAGetRootInfo(convert(IDAMemPtr,ida_mem),pointer(rootsfound)) end -function IDASetUserData(ida_mem::Ptr{Void},user_data::Ptr{Void}) - ccall((:IDASetUserData,libsundials_ida),Cint,(Ptr{Void},Ptr{Void}),ida_mem,user_data) +function __IDAGetIntegratorStats(ida_mem::IDAMemPtr,nsteps::Ptr{Clong},nrevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Ptr{realtype},hlast::Ptr{realtype},hcur::Ptr{realtype},tcur::Ptr{realtype}) + ccall((:IDAGetIntegratorStats,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),ida_mem,nsteps,nrevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) end -function IDASetMaxOrd(ida_mem::Ptr{Void},maxord::Int) - ccall((:IDASetMaxOrd,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxord) +function IDAGetIntegratorStats(ida_mem,nsteps,nrevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) + __IDAGetIntegratorStats(convert(IDAMemPtr,ida_mem),pointer(nsteps),pointer(nrevals),pointer(nlinsetups),pointer(netfails),pointer(qlast),pointer(qcur),pointer(hinused),pointer(hlast),pointer(hcur),pointer(tcur)) end -function IDASetMaxNumSteps(ida_mem::Ptr{Void},mxsteps::Int) - ccall((:IDASetMaxNumSteps,libsundials_ida),Cint,(Ptr{Void},Clong),ida_mem,mxsteps) +function __IDAGetNumNonlinSolvIters(ida_mem::IDAMemPtr,nniters::Ptr{Clong}) + ccall((:IDAGetNumNonlinSolvIters,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nniters) end -function IDASetInitStep(ida_mem::Ptr{Void},hin::realtype) - ccall((:IDASetInitStep,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,hin) +function IDAGetNumNonlinSolvIters(ida_mem,nniters) + __IDAGetNumNonlinSolvIters(convert(IDAMemPtr,ida_mem),pointer(nniters)) end -function IDASetMaxStep(ida_mem::Ptr{Void},hmax::realtype) - ccall((:IDASetMaxStep,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,hmax) +function __IDAGetNumNonlinSolvConvFails(ida_mem::IDAMemPtr,nncfails::Ptr{Clong}) + ccall((:IDAGetNumNonlinSolvConvFails,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nncfails) end -function IDASetStopTime(ida_mem::Ptr{Void},tstop::realtype) - ccall((:IDASetStopTime,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,tstop) +function IDAGetNumNonlinSolvConvFails(ida_mem,nncfails) + __IDAGetNumNonlinSolvConvFails(convert(IDAMemPtr,ida_mem),pointer(nncfails)) end -function IDASetNonlinConvCoef(ida_mem::Ptr{Void},epcon::realtype) - ccall((:IDASetNonlinConvCoef,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,epcon) +function __IDAGetNonlinSolvStats(ida_mem::IDAMemPtr,nniters::Ptr{Clong},nncfails::Ptr{Clong}) + ccall((:IDAGetNonlinSolvStats,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,nniters,nncfails) end -function IDASetMaxErrTestFails(ida_mem::Ptr{Void},maxnef::Int) - ccall((:IDASetMaxErrTestFails,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnef) +function IDAGetNonlinSolvStats(ida_mem,nniters,nncfails) + __IDAGetNonlinSolvStats(convert(IDAMemPtr,ida_mem),pointer(nniters),pointer(nncfails)) end -function IDASetMaxNonlinIters(ida_mem::Ptr{Void},maxcor::Int) - ccall((:IDASetMaxNonlinIters,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxcor) +function __IDAGetReturnFlagName(flag::Clong) + ccall((:IDAGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) end -function IDASetMaxConvFails(ida_mem::Ptr{Void},maxncf::Int) - ccall((:IDASetMaxConvFails,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxncf) +function IDAGetReturnFlagName(flag) + __IDAGetReturnFlagName(convert(Clong,flag)) end -function IDASetSuppressAlg(ida_mem::Ptr{Void},suppressalg::Int) - ccall((:IDASetSuppressAlg,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,suppressalg) +function IDAFree(ida_mem::Ref{IDAMemPtr}) + ccall((:IDAFree,libsundials_ida),Void,(Ref{IDAMemPtr},),ida_mem) end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida_direct.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDASetId(ida_mem::Ptr{Void},id::N_Vector) - ccall((:IDASetId,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,id) + +function __IDADlsSetDenseJacFn(ida_mem::IDAMemPtr,jac::IDADlsDenseJacFn) + ccall((:IDADlsSetDenseJacFn,libsundials_ida),Cint,(IDAMemPtr,IDADlsDenseJacFn),ida_mem,jac) end -function IDASetConstraints(ida_mem::Ptr{Void},constraints::N_Vector) - ccall((:IDASetConstraints,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,constraints) +function IDADlsSetDenseJacFn(ida_mem,jac) + __IDADlsSetDenseJacFn(convert(IDAMemPtr,ida_mem),jac) end -function IDASetRootDirection(ida_mem::Ptr{Void},rootdir::Ptr{Cint}) - ccall((:IDASetRootDirection,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,rootdir) +function __IDADlsSetBandJacFn(ida_mem::IDAMemPtr,jac::IDADlsBandJacFn) + ccall((:IDADlsSetBandJacFn,libsundials_ida),Cint,(IDAMemPtr,IDADlsBandJacFn),ida_mem,jac) end -function IDASetNoInactiveRootWarn(ida_mem::Ptr{Void}) - ccall((:IDASetNoInactiveRootWarn,libsundials_ida),Cint,(Ptr{Void},),ida_mem) +function IDADlsSetBandJacFn(ida_mem,jac) + __IDADlsSetBandJacFn(convert(IDAMemPtr,ida_mem),jac) end -function IDAInit(ida_mem::Ptr{Void},res::IDAResFn,t0::realtype,yy0::N_Vector,yp0::N_Vector) - ccall((:IDAInit,libsundials_ida),Cint,(Ptr{Void},IDAResFn,realtype,N_Vector,N_Vector),ida_mem,res,t0,yy0,yp0) +function __IDADlsGetWorkSpace(ida_mem::IDAMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:IDADlsGetWorkSpace,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,lenrwLS,leniwLS) end -function IDAReInit(ida_mem::Ptr{Void},t0::realtype,yy0::N_Vector,yp0::N_Vector) - ccall((:IDAReInit,libsundials_ida),Cint,(Ptr{Void},realtype,N_Vector,N_Vector),ida_mem,t0,yy0,yp0) +function IDADlsGetWorkSpace(ida_mem,lenrwLS,leniwLS) + __IDADlsGetWorkSpace(convert(IDAMemPtr,ida_mem),pointer(lenrwLS),pointer(leniwLS)) end -function IDASStolerances(ida_mem::Ptr{Void},reltol::realtype,abstol::realtype) - ccall((:IDASStolerances,libsundials_ida),Cint,(Ptr{Void},realtype,realtype),ida_mem,reltol,abstol) +function __IDADlsGetNumJacEvals(ida_mem::IDAMemPtr,njevals::Ptr{Clong}) + ccall((:IDADlsGetNumJacEvals,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,njevals) end -function IDASVtolerances(ida_mem::Ptr{Void},reltol::realtype,abstol::N_Vector) - ccall((:IDASVtolerances,libsundials_ida),Cint,(Ptr{Void},realtype,N_Vector),ida_mem,reltol,abstol) +function IDADlsGetNumJacEvals(ida_mem,njevals) + __IDADlsGetNumJacEvals(convert(IDAMemPtr,ida_mem),pointer(njevals)) end -function IDAWFtolerances(ida_mem::Ptr{Void},efun::IDAEwtFn) - ccall((:IDAWFtolerances,libsundials_ida),Cint,(Ptr{Void},IDAEwtFn),ida_mem,efun) +function __IDADlsGetNumResEvals(ida_mem::IDAMemPtr,nfevalsLS::Ptr{Clong}) + ccall((:IDADlsGetNumResEvals,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nfevalsLS) end -function IDASetNonlinConvCoefIC(ida_mem::Ptr{Void},epiccon::realtype) - ccall((:IDASetNonlinConvCoefIC,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,epiccon) +function IDADlsGetNumResEvals(ida_mem,nfevalsLS) + __IDADlsGetNumResEvals(convert(IDAMemPtr,ida_mem),pointer(nfevalsLS)) end -function IDASetMaxNumStepsIC(ida_mem::Ptr{Void},maxnh::Int) - ccall((:IDASetMaxNumStepsIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnh) +function __IDADlsGetLastFlag(ida_mem::IDAMemPtr,flag::Ptr{Clong}) + ccall((:IDADlsGetLastFlag,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,flag) end -function IDASetMaxNumJacsIC(ida_mem::Ptr{Void},maxnj::Int) - ccall((:IDASetMaxNumJacsIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnj) +function IDADlsGetLastFlag(ida_mem,flag) + __IDADlsGetLastFlag(convert(IDAMemPtr,ida_mem),pointer(flag)) end -function IDASetMaxNumItersIC(ida_mem::Ptr{Void},maxnit::Int) - ccall((:IDASetMaxNumItersIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnit) +function __IDADlsGetReturnFlagName(flag::Clong) + ccall((:IDADlsGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) end -function IDASetLineSearchOffIC(ida_mem::Ptr{Void},lsoff::Int) - ccall((:IDASetLineSearchOffIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,lsoff) +function IDADlsGetReturnFlagName(flag) + __IDADlsGetReturnFlagName(convert(Clong,flag)) end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida_spils.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDASetStepToleranceIC(ida_mem::Ptr{Void},steptol::realtype) - ccall((:IDASetStepToleranceIC,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,steptol) + +function __IDASpilsSetPreconditioner(ida_mem::IDAMemPtr,pset::IDASpilsPrecSetupFn,psolve::IDASpilsPrecSolveFn) + ccall((:IDASpilsSetPreconditioner,libsundials_ida),Cint,(IDAMemPtr,IDASpilsPrecSetupFn,IDASpilsPrecSolveFn),ida_mem,pset,psolve) end -function IDARootInit(ida_mem::Ptr{Void},nrtfn::Int,g::IDARootFn) - ccall((:IDARootInit,libsundials_ida),Cint,(Ptr{Void},Cint,IDARootFn),ida_mem,nrtfn,g) +function IDASpilsSetPreconditioner(ida_mem,pset,psolve) + __IDASpilsSetPreconditioner(convert(IDAMemPtr,ida_mem),pset,psolve) end -function IDACalcIC(ida_mem::Ptr{Void},icopt::Int,tout1::realtype) - ccall((:IDACalcIC,libsundials_ida),Cint,(Ptr{Void},Cint,realtype),ida_mem,icopt,tout1) +function __IDASpilsSetJacTimesVecFn(ida_mem::IDAMemPtr,jtv::IDASpilsJacTimesVecFn) + ccall((:IDASpilsSetJacTimesVecFn,libsundials_ida),Cint,(IDAMemPtr,IDASpilsJacTimesVecFn),ida_mem,jtv) end -function IDASolve(ida_mem::Ptr{Void},tout::realtype,tret::Vector{realtype},yret::N_Vector,ypret::N_Vector,itask::Int) - ccall((:IDASolve,libsundials_ida),Cint,(Ptr{Void},realtype,Ptr{realtype},N_Vector,N_Vector,Cint),ida_mem,tout,tret,yret,ypret,itask) +function IDASpilsSetJacTimesVecFn(ida_mem,jtv) + __IDASpilsSetJacTimesVecFn(convert(IDAMemPtr,ida_mem),jtv) end -function IDAGetDky(ida_mem::Ptr{Void},t::realtype,k::Int,dky::N_Vector) - ccall((:IDAGetDky,libsundials_ida),Cint,(Ptr{Void},realtype,Cint,N_Vector),ida_mem,t,k,dky) +function __IDASpilsSetGSType(ida_mem::IDAMemPtr,gstype::Cint) + ccall((:IDASpilsSetGSType,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,gstype) end -function IDAGetWorkSpace(ida_mem::Ptr{Void},lenrw::Ptr{Clong},leniw::Ptr{Clong}) - ccall((:IDAGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrw,leniw) +function IDASpilsSetGSType(ida_mem,gstype) + __IDASpilsSetGSType(convert(IDAMemPtr,ida_mem),convert(Cint,gstype)) end -function IDAGetNumSteps(ida_mem::Ptr{Void},nsteps::Ptr{Clong}) - ccall((:IDAGetNumSteps,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nsteps) +function __IDASpilsSetMaxRestarts(ida_mem::IDAMemPtr,maxrs::Cint) + ccall((:IDASpilsSetMaxRestarts,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxrs) end -function IDAGetNumResEvals(ida_mem::Ptr{Void},nrevals::Ptr{Clong}) - ccall((:IDAGetNumResEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nrevals) +function IDASpilsSetMaxRestarts(ida_mem,maxrs) + __IDASpilsSetMaxRestarts(convert(IDAMemPtr,ida_mem),convert(Cint,maxrs)) end -function IDAGetNumLinSolvSetups(ida_mem::Ptr{Void},nlinsetups::Ptr{Clong}) - ccall((:IDAGetNumLinSolvSetups,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nlinsetups) +function __IDASpilsSetMaxl(ida_mem::IDAMemPtr,maxl::Cint) + ccall((:IDASpilsSetMaxl,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxl) end -function IDAGetNumErrTestFails(ida_mem::Ptr{Void},netfails::Ptr{Clong}) - ccall((:IDAGetNumErrTestFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,netfails) +function IDASpilsSetMaxl(ida_mem,maxl) + __IDASpilsSetMaxl(convert(IDAMemPtr,ida_mem),convert(Cint,maxl)) end -function IDAGetNumBacktrackOps(ida_mem::Ptr{Void},nbacktr::Ptr{Clong}) - ccall((:IDAGetNumBacktrackOps,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nbacktr) +function __IDASpilsSetEpsLin(ida_mem::IDAMemPtr,eplifac::realtype) + ccall((:IDASpilsSetEpsLin,libsundials_ida),Cint,(IDAMemPtr,realtype),ida_mem,eplifac) end -function IDAGetConsistentIC(ida_mem::Ptr{Void},yy0_mod::N_Vector,yp0_mod::N_Vector) - ccall((:IDAGetConsistentIC,libsundials_ida),Cint,(Ptr{Void},N_Vector,N_Vector),ida_mem,yy0_mod,yp0_mod) +function IDASpilsSetEpsLin(ida_mem,eplifac) + __IDASpilsSetEpsLin(convert(IDAMemPtr,ida_mem),eplifac) end -function IDAGetLastOrder(ida_mem::Ptr{Void},klast::Ptr{Cint}) - ccall((:IDAGetLastOrder,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,klast) +function __IDASpilsSetIncrementFactor(ida_mem::IDAMemPtr,dqincfac::realtype) + ccall((:IDASpilsSetIncrementFactor,libsundials_ida),Cint,(IDAMemPtr,realtype),ida_mem,dqincfac) end -function IDAGetCurrentOrder(ida_mem::Ptr{Void},kcur::Ptr{Cint}) - ccall((:IDAGetCurrentOrder,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,kcur) +function IDASpilsSetIncrementFactor(ida_mem,dqincfac) + __IDASpilsSetIncrementFactor(convert(IDAMemPtr,ida_mem),dqincfac) end -function IDAGetActualInitStep(ida_mem::Ptr{Void},hinused::Vector{realtype}) - ccall((:IDAGetActualInitStep,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,hinused) +function __IDASpilsGetWorkSpace(ida_mem::IDAMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:IDASpilsGetWorkSpace,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,lenrwLS,leniwLS) end -function IDAGetLastStep(ida_mem::Ptr{Void},hlast::Vector{realtype}) - ccall((:IDAGetLastStep,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,hlast) +function IDASpilsGetWorkSpace(ida_mem,lenrwLS,leniwLS) + __IDASpilsGetWorkSpace(convert(IDAMemPtr,ida_mem),pointer(lenrwLS),pointer(leniwLS)) end -function IDAGetCurrentStep(ida_mem::Ptr{Void},hcur::Vector{realtype}) - ccall((:IDAGetCurrentStep,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,hcur) +function __IDASpilsGetNumPrecEvals(ida_mem::IDAMemPtr,npevals::Ptr{Clong}) + ccall((:IDASpilsGetNumPrecEvals,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,npevals) end -function IDAGetCurrentTime(ida_mem::Ptr{Void},tcur::Vector{realtype}) - ccall((:IDAGetCurrentTime,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,tcur) +function IDASpilsGetNumPrecEvals(ida_mem,npevals) + __IDASpilsGetNumPrecEvals(convert(IDAMemPtr,ida_mem),pointer(npevals)) end -function IDAGetTolScaleFactor(ida_mem::Ptr{Void},tolsfact::Vector{realtype}) - ccall((:IDAGetTolScaleFactor,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,tolsfact) +function __IDASpilsGetNumPrecSolves(ida_mem::IDAMemPtr,npsolves::Ptr{Clong}) + ccall((:IDASpilsGetNumPrecSolves,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,npsolves) end -function IDAGetErrWeights(ida_mem::Ptr{Void},eweight::N_Vector) - ccall((:IDAGetErrWeights,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,eweight) +function IDASpilsGetNumPrecSolves(ida_mem,npsolves) + __IDASpilsGetNumPrecSolves(convert(IDAMemPtr,ida_mem),pointer(npsolves)) end -function IDAGetEstLocalErrors(ida_mem::Ptr{Void},ele::N_Vector) - ccall((:IDAGetEstLocalErrors,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,ele) +function __IDASpilsGetNumLinIters(ida_mem::IDAMemPtr,nliters::Ptr{Clong}) + ccall((:IDASpilsGetNumLinIters,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nliters) end -function IDAGetNumGEvals(ida_mem::Ptr{Void},ngevals::Ptr{Clong}) - ccall((:IDAGetNumGEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,ngevals) +function IDASpilsGetNumLinIters(ida_mem,nliters) + __IDASpilsGetNumLinIters(convert(IDAMemPtr,ida_mem),pointer(nliters)) end -function IDAGetRootInfo(ida_mem::Ptr{Void},rootsfound::Ptr{Cint}) - ccall((:IDAGetRootInfo,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,rootsfound) +function __IDASpilsGetNumConvFails(ida_mem::IDAMemPtr,nlcfails::Ptr{Clong}) + ccall((:IDASpilsGetNumConvFails,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nlcfails) end -function IDAGetIntegratorStats(ida_mem::Ptr{Void},nsteps::Ptr{Clong},nrevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Vector{realtype},hlast::Vector{realtype},hcur::Vector{realtype},tcur::Vector{realtype}) - ccall((:IDAGetIntegratorStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),ida_mem,nsteps,nrevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) +function IDASpilsGetNumConvFails(ida_mem,nlcfails) + __IDASpilsGetNumConvFails(convert(IDAMemPtr,ida_mem),pointer(nlcfails)) end -function IDAGetNumNonlinSolvIters(ida_mem::Ptr{Void},nniters::Ptr{Clong}) - ccall((:IDAGetNumNonlinSolvIters,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nniters) +function __IDASpilsGetNumJtimesEvals(ida_mem::IDAMemPtr,njvevals::Ptr{Clong}) + ccall((:IDASpilsGetNumJtimesEvals,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,njvevals) end -function IDAGetNumNonlinSolvConvFails(ida_mem::Ptr{Void},nncfails::Ptr{Clong}) - ccall((:IDAGetNumNonlinSolvConvFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nncfails) +function IDASpilsGetNumJtimesEvals(ida_mem,njvevals) + __IDASpilsGetNumJtimesEvals(convert(IDAMemPtr,ida_mem),pointer(njvevals)) end -function IDAGetNonlinSolvStats(ida_mem::Ptr{Void},nniters::Ptr{Clong},nncfails::Ptr{Clong}) - ccall((:IDAGetNonlinSolvStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,nniters,nncfails) +function __IDASpilsGetNumResEvals(ida_mem::IDAMemPtr,nrevalsLS::Ptr{Clong}) + ccall((:IDASpilsGetNumResEvals,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nrevalsLS) end -function IDAGetReturnFlagName(flag::Int) - ccall((:IDAGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) +function IDASpilsGetNumResEvals(ida_mem,nrevalsLS) + __IDASpilsGetNumResEvals(convert(IDAMemPtr,ida_mem),pointer(nrevalsLS)) end -function IDAFree(ida_mem::Vector{Ptr{Void}}) - ccall((:IDAFree,libsundials_ida),Void,(Ptr{Ptr{Void}},),ida_mem) +function __IDASpilsGetLastFlag(ida_mem::IDAMemPtr,flag::Ptr{Clong}) + ccall((:IDASpilsGetLastFlag,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,flag) end -function IDAEwtSet(ycur::N_Vector,weight::N_Vector,data::Ptr{Void}) - ccall((:IDAEwtSet,libsundials_ida),Cint,(N_Vector,N_Vector,Ptr{Void}),ycur,weight,data) +function IDASpilsGetLastFlag(ida_mem,flag) + __IDASpilsGetLastFlag(convert(IDAMemPtr,ida_mem),pointer(flag)) end -function IDAErrHandler(error_code::Int,_module::Ptr{UInt8},_function::Ptr{UInt8},msg::Ptr{UInt8},data::Ptr{Void}) - ccall((:IDAErrHandler,libsundials_ida),Void,(Cint,Ptr{UInt8},Ptr{UInt8},Ptr{UInt8},Ptr{Void}),error_code,_module,_function,msg,data) +function __IDASpilsGetReturnFlagName(flag::Clong) + ccall((:IDASpilsGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida_spbcgs.h + +function IDASpilsGetReturnFlagName(flag) + __IDASpilsGetReturnFlagName(convert(Clong,flag)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida_band.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function SpbcgMalloc(l_max::Int,vec_tmpl::N_Vector) - ccall((:SpbcgMalloc,libsundials_ida),SpbcgMem,(Cint,N_Vector),l_max,vec_tmpl) + +function __IDABand(ida_mem::IDAMemPtr,Neq::Clong,mupper::Clong,mlower::Clong) + ccall((:IDABand,libsundials_ida),Cint,(IDAMemPtr,Clong,Clong,Clong),ida_mem,Neq,mupper,mlower) +end + +function IDABand(ida_mem,Neq,mupper,mlower) + __IDABand(convert(IDAMemPtr,ida_mem),convert(Clong,Neq),convert(Clong,mupper),convert(Clong,mlower)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida_bbdpre.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + + +function __IDABBDPrecInit(ida_mem::IDAMemPtr,Nlocal::Clong,mudq::Clong,mldq::Clong,mukeep::Clong,mlkeep::Clong,dq_rel_yy::realtype,Gres::IDABBDLocalFn,Gcomm::IDABBDCommFn) + ccall((:IDABBDPrecInit,libsundials_ida),Cint,(IDAMemPtr,Clong,Clong,Clong,Clong,Clong,realtype,IDABBDLocalFn,IDABBDCommFn),ida_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dq_rel_yy,Gres,Gcomm) +end + +function IDABBDPrecInit(ida_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dq_rel_yy,Gres,Gcomm) + __IDABBDPrecInit(convert(IDAMemPtr,ida_mem),convert(Clong,Nlocal),convert(Clong,mudq),convert(Clong,mldq),convert(Clong,mukeep),convert(Clong,mlkeep),dq_rel_yy,Gres,Gcomm) +end + +function __IDABBDPrecReInit(ida_mem::IDAMemPtr,mudq::Clong,mldq::Clong,dq_rel_yy::realtype) + ccall((:IDABBDPrecReInit,libsundials_ida),Cint,(IDAMemPtr,Clong,Clong,realtype),ida_mem,mudq,mldq,dq_rel_yy) end -function SpbcgSolve(mem::SpbcgMem,A_data::Ptr{Void},x::N_Vector,b::N_Vector,pretype::Int,delta::realtype,P_data::Ptr{Void},sx::N_Vector,sb::N_Vector,atimes::ATimesFn,psolve::PSolveFn,res_norm::Vector{realtype},nli::Ptr{Cint},nps::Ptr{Cint}) - ccall((:SpbcgSolve,libsundials_ida),Cint,(SpbcgMem,Ptr{Void},N_Vector,N_Vector,Cint,realtype,Ptr{Void},N_Vector,N_Vector,ATimesFn,PSolveFn,Ptr{realtype},Ptr{Cint},Ptr{Cint}),mem,A_data,x,b,pretype,delta,P_data,sx,sb,atimes,psolve,res_norm,nli,nps) +function IDABBDPrecReInit(ida_mem,mudq,mldq,dq_rel_yy) + __IDABBDPrecReInit(convert(IDAMemPtr,ida_mem),convert(Clong,mudq),convert(Clong,mldq),dq_rel_yy) end -function SpbcgFree(mem::SpbcgMem) - ccall((:SpbcgFree,libsundials_ida),Void,(SpbcgMem,),mem) +function __IDABBDPrecGetWorkSpace(ida_mem::IDAMemPtr,lenrwBBDP::Ptr{Clong},leniwBBDP::Ptr{Clong}) + ccall((:IDABBDPrecGetWorkSpace,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,lenrwBBDP,leniwBBDP) end -function IDASpbcg(ida_mem::Ptr{Void},maxl::Int) - ccall((:IDASpbcg,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxl) +function IDABBDPrecGetWorkSpace(ida_mem,lenrwBBDP,leniwBBDP) + __IDABBDPrecGetWorkSpace(convert(IDAMemPtr,ida_mem),pointer(lenrwBBDP),pointer(leniwBBDP)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida_spgmr.h + +function __IDABBDPrecGetNumGfnEvals(ida_mem::IDAMemPtr,ngevalsBBDP::Ptr{Clong}) + ccall((:IDABBDPrecGetNumGfnEvals,libsundials_ida),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,ngevalsBBDP) +end + +function IDABBDPrecGetNumGfnEvals(ida_mem,ngevalsBBDP) + __IDABBDPrecGetNumGfnEvals(convert(IDAMemPtr,ida_mem),pointer(ngevalsBBDP)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida_dense.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function SpgmrMalloc(l_max::Int,vec_tmpl::N_Vector) - ccall((:SpgmrMalloc,libsundials_ida),SpgmrMem,(Cint,N_Vector),l_max,vec_tmpl) + +function __IDADense(ida_mem::IDAMemPtr,Neq::Clong) + ccall((:IDADense,libsundials_ida),Cint,(IDAMemPtr,Clong),ida_mem,Neq) end -function SpgmrSolve(mem::SpgmrMem,A_data::Ptr{Void},x::N_Vector,b::N_Vector,pretype::Int,gstype::Int,delta::realtype,max_restarts::Int,P_data::Ptr{Void},s1::N_Vector,s2::N_Vector,atimes::ATimesFn,psolve::PSolveFn,res_norm::Vector{realtype},nli::Ptr{Cint},nps::Ptr{Cint}) - ccall((:SpgmrSolve,libsundials_ida),Cint,(SpgmrMem,Ptr{Void},N_Vector,N_Vector,Cint,Cint,realtype,Cint,Ptr{Void},N_Vector,N_Vector,ATimesFn,PSolveFn,Ptr{realtype},Ptr{Cint},Ptr{Cint}),mem,A_data,x,b,pretype,gstype,delta,max_restarts,P_data,s1,s2,atimes,psolve,res_norm,nli,nps) +function IDADense(ida_mem,Neq) + __IDADense(convert(IDAMemPtr,ida_mem),convert(Clong,Neq)) end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida_impl.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function SpgmrFree(mem::SpgmrMem) - ccall((:SpgmrFree,libsundials_ida),Void,(SpgmrMem,),mem) +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida_spbcgs.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + + +function __IDASpbcg(ida_mem::IDAMemPtr,maxl::Cint) + ccall((:IDASpbcg,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxl) end -function IDASpgmr(ida_mem::Ptr{Void},maxl::Int) - ccall((:IDASpgmr,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxl) +function IDASpbcg(ida_mem,maxl) + __IDASpbcg(convert(IDAMemPtr,ida_mem),convert(Cint,maxl)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/ida/ida_sptfqmr.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida_spgmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function SptfqmrMalloc(l_max::Int,vec_tmpl::N_Vector) - ccall((:SptfqmrMalloc,libsundials_ida),SptfqmrMem,(Cint,N_Vector),l_max,vec_tmpl) + +function __IDASpgmr(ida_mem::IDAMemPtr,maxl::Cint) + ccall((:IDASpgmr,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxl) end -function SptfqmrSolve(mem::SptfqmrMem,A_data::Ptr{Void},x::N_Vector,b::N_Vector,pretype::Int,delta::realtype,P_data::Ptr{Void},sx::N_Vector,sb::N_Vector,atimes::ATimesFn,psolve::PSolveFn,res_norm::Vector{realtype},nli::Ptr{Cint},nps::Ptr{Cint}) - ccall((:SptfqmrSolve,libsundials_ida),Cint,(SptfqmrMem,Ptr{Void},N_Vector,N_Vector,Cint,realtype,Ptr{Void},N_Vector,N_Vector,ATimesFn,PSolveFn,Ptr{realtype},Ptr{Cint},Ptr{Cint}),mem,A_data,x,b,pretype,delta,P_data,sx,sb,atimes,psolve,res_norm,nli,nps) +function IDASpgmr(ida_mem,maxl) + __IDASpgmr(convert(IDAMemPtr,ida_mem),convert(Cint,maxl)) end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/ida/ida_sptfqmr.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + -function SptfqmrFree(mem::SptfqmrMem) - ccall((:SptfqmrFree,libsundials_ida),Void,(SptfqmrMem,),mem) +function __IDASptfqmr(ida_mem::IDAMemPtr,maxl::Cint) + ccall((:IDASptfqmr,libsundials_ida),Cint,(IDAMemPtr,Cint),ida_mem,maxl) end -function IDASptfqmr(ida_mem::Ptr{Void},maxl::Int) - ccall((:IDASptfqmr,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxl) +function IDASptfqmr(ida_mem,maxl) + __IDASptfqmr(convert(IDAMemPtr,ida_mem),convert(Cint,maxl)) end diff --git a/src/idas.jl b/src/idas.jl index 5158fad5..a71cf017 100644 --- a/src/idas.jl +++ b/src/idas.jl @@ -1,822 +1,1627 @@ -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 + function IDACreate() - ccall((:IDACreate,libsundials_ida),Ptr{Void},()) + ccall((:IDACreate,libsundials_idas),IDAMemPtr,()) end -function IDASetErrHandlerFn(ida_mem::Ptr{Void},ehfun::IDAErrHandlerFn,eh_data::Ptr{Void}) - ccall((:IDASetErrHandlerFn,libsundials_ida),Cint,(Ptr{Void},IDAErrHandlerFn,Ptr{Void}),ida_mem,ehfun,eh_data) +function __IDASetErrHandlerFn(ida_mem::IDAMemPtr,ehfun::IDAErrHandlerFn,eh_data::Ptr{Void}) + ccall((:IDASetErrHandlerFn,libsundials_idas),Cint,(IDAMemPtr,IDAErrHandlerFn,Ptr{Void}),ida_mem,ehfun,eh_data) end -function IDASetErrFile(ida_mem::Ptr{Void},errfp::Ptr{Void}) - ccall((:IDASetErrFile,libsundials_ida),Cint,(Ptr{Void},Ptr{Void}),ida_mem,errfp) +function IDASetErrHandlerFn(ida_mem,ehfun,eh_data) + __IDASetErrHandlerFn(convert(IDAMemPtr,ida_mem),ehfun,pointer(eh_data)) end -function IDASetUserData(ida_mem::Ptr{Void},user_data::Ptr{Void}) - ccall((:IDASetUserData,libsundials_ida),Cint,(Ptr{Void},Ptr{Void}),ida_mem,user_data) +function __IDASetErrFile(ida_mem::IDAMemPtr,errfp::Ptr{FILE}) + ccall((:IDASetErrFile,libsundials_idas),Cint,(IDAMemPtr,Ptr{FILE}),ida_mem,errfp) end -function IDASetMaxOrd(ida_mem::Ptr{Void},maxord::Int) - ccall((:IDASetMaxOrd,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxord) +function IDASetErrFile(ida_mem,errfp) + __IDASetErrFile(convert(IDAMemPtr,ida_mem),errfp) end -function IDASetMaxNumSteps(ida_mem::Ptr{Void},mxsteps::Int) - ccall((:IDASetMaxNumSteps,libsundials_ida),Cint,(Ptr{Void},Clong),ida_mem,mxsteps) +function __IDASetUserData(ida_mem::IDAMemPtr,user_data::Any) + ccall((:IDASetUserData,libsundials_idas),Cint,(IDAMemPtr,Any),ida_mem,user_data) end -function IDASetInitStep(ida_mem::Ptr{Void},hin::realtype) - ccall((:IDASetInitStep,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,hin) +function IDASetUserData(ida_mem,user_data) + __IDASetUserData(convert(IDAMemPtr,ida_mem),user_data) end -function IDASetMaxStep(ida_mem::Ptr{Void},hmax::realtype) - ccall((:IDASetMaxStep,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,hmax) +function __IDASetMaxOrd(ida_mem::IDAMemPtr,maxord::Cint) + ccall((:IDASetMaxOrd,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxord) end -function IDASetStopTime(ida_mem::Ptr{Void},tstop::realtype) - ccall((:IDASetStopTime,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,tstop) +function IDASetMaxOrd(ida_mem,maxord) + __IDASetMaxOrd(convert(IDAMemPtr,ida_mem),convert(Cint,maxord)) end -function IDASetNonlinConvCoef(ida_mem::Ptr{Void},epcon::realtype) - ccall((:IDASetNonlinConvCoef,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,epcon) +function __IDASetMaxNumSteps(ida_mem::IDAMemPtr,mxsteps::Clong) + ccall((:IDASetMaxNumSteps,libsundials_idas),Cint,(IDAMemPtr,Clong),ida_mem,mxsteps) end -function IDASetMaxErrTestFails(ida_mem::Ptr{Void},maxnef::Int) - ccall((:IDASetMaxErrTestFails,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnef) +function IDASetMaxNumSteps(ida_mem,mxsteps) + __IDASetMaxNumSteps(convert(IDAMemPtr,ida_mem),convert(Clong,mxsteps)) end -function IDASetMaxNonlinIters(ida_mem::Ptr{Void},maxcor::Int) - ccall((:IDASetMaxNonlinIters,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxcor) +function __IDASetInitStep(ida_mem::IDAMemPtr,hin::realtype) + ccall((:IDASetInitStep,libsundials_idas),Cint,(IDAMemPtr,realtype),ida_mem,hin) end -function IDASetMaxConvFails(ida_mem::Ptr{Void},maxncf::Int) - ccall((:IDASetMaxConvFails,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxncf) +function IDASetInitStep(ida_mem,hin) + __IDASetInitStep(convert(IDAMemPtr,ida_mem),hin) end -function IDASetSuppressAlg(ida_mem::Ptr{Void},suppressalg::Int) - ccall((:IDASetSuppressAlg,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,suppressalg) +function __IDASetMaxStep(ida_mem::IDAMemPtr,hmax::realtype) + ccall((:IDASetMaxStep,libsundials_idas),Cint,(IDAMemPtr,realtype),ida_mem,hmax) end -function IDASetId(ida_mem::Ptr{Void},id::N_Vector) - ccall((:IDASetId,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,id) +function IDASetMaxStep(ida_mem,hmax) + __IDASetMaxStep(convert(IDAMemPtr,ida_mem),hmax) end -function IDASetConstraints(ida_mem::Ptr{Void},constraints::N_Vector) - ccall((:IDASetConstraints,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,constraints) +function __IDASetStopTime(ida_mem::IDAMemPtr,tstop::realtype) + ccall((:IDASetStopTime,libsundials_idas),Cint,(IDAMemPtr,realtype),ida_mem,tstop) end -function IDASetRootDirection(ida_mem::Ptr{Void},rootdir::Ptr{Cint}) - ccall((:IDASetRootDirection,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,rootdir) +function IDASetStopTime(ida_mem,tstop) + __IDASetStopTime(convert(IDAMemPtr,ida_mem),tstop) end -function IDASetNoInactiveRootWarn(ida_mem::Ptr{Void}) - ccall((:IDASetNoInactiveRootWarn,libsundials_ida),Cint,(Ptr{Void},),ida_mem) +function __IDASetNonlinConvCoef(ida_mem::IDAMemPtr,epcon::realtype) + ccall((:IDASetNonlinConvCoef,libsundials_idas),Cint,(IDAMemPtr,realtype),ida_mem,epcon) end -function IDAInit(ida_mem::Ptr{Void},res::IDAResFn,t0::realtype,yy0::N_Vector,yp0::N_Vector) - ccall((:IDAInit,libsundials_ida),Cint,(Ptr{Void},IDAResFn,realtype,N_Vector,N_Vector),ida_mem,res,t0,yy0,yp0) +function IDASetNonlinConvCoef(ida_mem,epcon) + __IDASetNonlinConvCoef(convert(IDAMemPtr,ida_mem),epcon) end -function IDAReInit(ida_mem::Ptr{Void},t0::realtype,yy0::N_Vector,yp0::N_Vector) - ccall((:IDAReInit,libsundials_ida),Cint,(Ptr{Void},realtype,N_Vector,N_Vector),ida_mem,t0,yy0,yp0) +function __IDASetMaxErrTestFails(ida_mem::IDAMemPtr,maxnef::Cint) + ccall((:IDASetMaxErrTestFails,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxnef) end -function IDASStolerances(ida_mem::Ptr{Void},reltol::realtype,abstol::realtype) - ccall((:IDASStolerances,libsundials_ida),Cint,(Ptr{Void},realtype,realtype),ida_mem,reltol,abstol) +function IDASetMaxErrTestFails(ida_mem,maxnef) + __IDASetMaxErrTestFails(convert(IDAMemPtr,ida_mem),convert(Cint,maxnef)) end -function IDASVtolerances(ida_mem::Ptr{Void},reltol::realtype,abstol::N_Vector) - ccall((:IDASVtolerances,libsundials_ida),Cint,(Ptr{Void},realtype,N_Vector),ida_mem,reltol,abstol) +function __IDASetMaxNonlinIters(ida_mem::IDAMemPtr,maxcor::Cint) + ccall((:IDASetMaxNonlinIters,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxcor) end -function IDAWFtolerances(ida_mem::Ptr{Void},efun::IDAEwtFn) - ccall((:IDAWFtolerances,libsundials_ida),Cint,(Ptr{Void},IDAEwtFn),ida_mem,efun) +function IDASetMaxNonlinIters(ida_mem,maxcor) + __IDASetMaxNonlinIters(convert(IDAMemPtr,ida_mem),convert(Cint,maxcor)) end -function IDASetNonlinConvCoefIC(ida_mem::Ptr{Void},epiccon::realtype) - ccall((:IDASetNonlinConvCoefIC,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,epiccon) +function __IDASetMaxConvFails(ida_mem::IDAMemPtr,maxncf::Cint) + ccall((:IDASetMaxConvFails,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxncf) end -function IDASetMaxNumStepsIC(ida_mem::Ptr{Void},maxnh::Int) - ccall((:IDASetMaxNumStepsIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnh) +function IDASetMaxConvFails(ida_mem,maxncf) + __IDASetMaxConvFails(convert(IDAMemPtr,ida_mem),convert(Cint,maxncf)) end -function IDASetMaxNumJacsIC(ida_mem::Ptr{Void},maxnj::Int) - ccall((:IDASetMaxNumJacsIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnj) +function __IDASetSuppressAlg(ida_mem::IDAMemPtr,suppressalg::Cint) + ccall((:IDASetSuppressAlg,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,suppressalg) end -function IDASetMaxNumItersIC(ida_mem::Ptr{Void},maxnit::Int) - ccall((:IDASetMaxNumItersIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxnit) +function IDASetSuppressAlg(ida_mem,suppressalg) + __IDASetSuppressAlg(convert(IDAMemPtr,ida_mem),convert(Cint,suppressalg)) end -function IDASetLineSearchOffIC(ida_mem::Ptr{Void},lsoff::Int) - ccall((:IDASetLineSearchOffIC,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,lsoff) +function __IDASetId(ida_mem::IDAMemPtr,id::N_Vector) + ccall((:IDASetId,libsundials_idas),Cint,(IDAMemPtr,N_Vector),ida_mem,id) end -function IDASetStepToleranceIC(ida_mem::Ptr{Void},steptol::realtype) - ccall((:IDASetStepToleranceIC,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,steptol) +function IDASetId(ida_mem,id) + __id = convert(NVector,id) + __IDASetId(convert(IDAMemPtr,ida_mem),convert(N_Vector,__id)) end -function IDARootInit(ida_mem::Ptr{Void},nrtfn::Int,g::IDARootFn) - ccall((:IDARootInit,libsundials_ida),Cint,(Ptr{Void},Cint,IDARootFn),ida_mem,nrtfn,g) +function __IDASetConstraints(ida_mem::IDAMemPtr,constraints::N_Vector) + ccall((:IDASetConstraints,libsundials_idas),Cint,(IDAMemPtr,N_Vector),ida_mem,constraints) end -function IDASetQuadErrCon(ida_mem::Ptr{Void},errconQ::Int) - ccall((:IDASetQuadErrCon,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,errconQ) +function IDASetConstraints(ida_mem,constraints) + __constraints = convert(NVector,constraints) + __IDASetConstraints(convert(IDAMemPtr,ida_mem),convert(N_Vector,__constraints)) end -function IDAQuadInit(ida_mem::Ptr{Void},rhsQ::IDAQuadRhsFn,yQ0::N_Vector) - ccall((:IDAQuadInit,libsundials_ida),Cint,(Ptr{Void},IDAQuadRhsFn,N_Vector),ida_mem,rhsQ,yQ0) +function __IDASetRootDirection(ida_mem::IDAMemPtr,rootdir::Ptr{Cint}) + ccall((:IDASetRootDirection,libsundials_idas),Cint,(IDAMemPtr,Ptr{Cint}),ida_mem,rootdir) end -function IDAQuadReInit(ida_mem::Ptr{Void},yQ0::N_Vector) - ccall((:IDAQuadReInit,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,yQ0) +function IDASetRootDirection(ida_mem,rootdir) + __IDASetRootDirection(convert(IDAMemPtr,ida_mem),pointer(rootdir)) end -function IDAQuadSStolerances(ida_mem::Ptr{Void},reltolQ::realtype,abstolQ::realtype) - ccall((:IDAQuadSStolerances,libsundials_ida),Cint,(Ptr{Void},realtype,realtype),ida_mem,reltolQ,abstolQ) +function __IDASetNoInactiveRootWarn(ida_mem::IDAMemPtr) + ccall((:IDASetNoInactiveRootWarn,libsundials_idas),Cint,(IDAMemPtr,),ida_mem) end -function IDAQuadSVtolerances(ida_mem::Ptr{Void},reltolQ::realtype,abstolQ::N_Vector) - ccall((:IDAQuadSVtolerances,libsundials_ida),Cint,(Ptr{Void},realtype,N_Vector),ida_mem,reltolQ,abstolQ) +function IDASetNoInactiveRootWarn(ida_mem) + __IDASetNoInactiveRootWarn(convert(IDAMemPtr,ida_mem)) end -function IDASetSensDQMethod(ida_mem::Ptr{Void},DQtype::Int,DQrhomax::realtype) - ccall((:IDASetSensDQMethod,libsundials_ida),Cint,(Ptr{Void},Cint,realtype),ida_mem,DQtype,DQrhomax) +function __IDAInit(ida_mem::IDAMemPtr,res::IDAResFn,t0::realtype,yy0::N_Vector,yp0::N_Vector) + ccall((:IDAInit,libsundials_idas),Cint,(IDAMemPtr,IDAResFn,realtype,N_Vector,N_Vector),ida_mem,res,t0,yy0,yp0) end -function IDASetSensParams(ida_mem::Ptr{Void},p::Vector{realtype},pbar::Vector{realtype},plist::Ptr{Cint}) - ccall((:IDASetSensParams,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype},Ptr{realtype},Ptr{Cint}),ida_mem,p,pbar,plist) +function IDAInit(ida_mem,res,t0,yy0,yp0) + __yy0 = convert(NVector,yy0) + __yp0 = convert(NVector,yp0) + __IDAInit(convert(IDAMemPtr,ida_mem),IDAResFn_wrapper(res),t0,convert(N_Vector,__yy0),convert(N_Vector,__yp0)) end -function IDASetSensErrCon(ida_mem::Ptr{Void},errconS::Int) - ccall((:IDASetSensErrCon,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,errconS) +function __IDAReInit(ida_mem::IDAMemPtr,t0::realtype,yy0::N_Vector,yp0::N_Vector) + ccall((:IDAReInit,libsundials_idas),Cint,(IDAMemPtr,realtype,N_Vector,N_Vector),ida_mem,t0,yy0,yp0) end -function IDASetSensMaxNonlinIters(ida_mem::Ptr{Void},maxcorS::Int) - ccall((:IDASetSensMaxNonlinIters,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxcorS) +function IDAReInit(ida_mem,t0,yy0,yp0) + __yy0 = convert(NVector,yy0) + __yp0 = convert(NVector,yp0) + __IDAReInit(convert(IDAMemPtr,ida_mem),t0,convert(N_Vector,__yy0),convert(N_Vector,__yp0)) end -function IDASensInit(ida_mem::Ptr{Void},Ns::Int,ism::Int,resS::IDASensResFn,yS0::Ptr{N_Vector},ypS0::Ptr{N_Vector}) - ccall((:IDASensInit,libsundials_ida),Cint,(Ptr{Void},Cint,Cint,IDASensResFn,Ptr{N_Vector},Ptr{N_Vector}),ida_mem,Ns,ism,resS,yS0,ypS0) +function __IDASStolerances(ida_mem::IDAMemPtr,reltol::realtype,abstol::realtype) + ccall((:IDASStolerances,libsundials_idas),Cint,(IDAMemPtr,realtype,realtype),ida_mem,reltol,abstol) end -function IDASensReInit(ida_mem::Ptr{Void},ism::Int,yS0::Ptr{N_Vector},ypS0::Ptr{N_Vector}) - ccall((:IDASensReInit,libsundials_ida),Cint,(Ptr{Void},Cint,Ptr{N_Vector},Ptr{N_Vector}),ida_mem,ism,yS0,ypS0) +function IDASStolerances(ida_mem,reltol,abstol) + __IDASStolerances(convert(IDAMemPtr,ida_mem),reltol,abstol) end -function IDASensToggleOff(ida_mem::Ptr{Void}) - ccall((:IDASensToggleOff,libsundials_ida),Cint,(Ptr{Void},),ida_mem) +function __IDASVtolerances(ida_mem::IDAMemPtr,reltol::realtype,abstol::N_Vector) + ccall((:IDASVtolerances,libsundials_idas),Cint,(IDAMemPtr,realtype,N_Vector),ida_mem,reltol,abstol) end -function IDASensSStolerances(ida_mem::Ptr{Void},reltolS::realtype,abstolS::Vector{realtype}) - ccall((:IDASensSStolerances,libsundials_ida),Cint,(Ptr{Void},realtype,Ptr{realtype}),ida_mem,reltolS,abstolS) +function IDASVtolerances(ida_mem,reltol,abstol) + __abstol = convert(NVector,abstol) + __IDASVtolerances(convert(IDAMemPtr,ida_mem),reltol,convert(N_Vector,__abstol)) end -function IDASensSVtolerances(ida_mem::Ptr{Void},reltolS::realtype,abstolS::Ptr{N_Vector}) - ccall((:IDASensSVtolerances,libsundials_ida),Cint,(Ptr{Void},realtype,Ptr{N_Vector}),ida_mem,reltolS,abstolS) +function __IDAWFtolerances(ida_mem::IDAMemPtr,efun::IDAEwtFn) + ccall((:IDAWFtolerances,libsundials_idas),Cint,(IDAMemPtr,IDAEwtFn),ida_mem,efun) end -function IDASensEEtolerances(ida_mem::Ptr{Void}) - ccall((:IDASensEEtolerances,libsundials_ida),Cint,(Ptr{Void},),ida_mem) +function IDAWFtolerances(ida_mem,efun) + __IDAWFtolerances(convert(IDAMemPtr,ida_mem),efun) end -function IDAQuadSensInit(ida_mem::Ptr{Void},resQS::IDAQuadSensRhsFn,yQS0::Ptr{N_Vector}) - ccall((:IDAQuadSensInit,libsundials_ida),Cint,(Ptr{Void},IDAQuadSensRhsFn,Ptr{N_Vector}),ida_mem,resQS,yQS0) +function __IDASetNonlinConvCoefIC(ida_mem::IDAMemPtr,epiccon::realtype) + ccall((:IDASetNonlinConvCoefIC,libsundials_idas),Cint,(IDAMemPtr,realtype),ida_mem,epiccon) end -function IDAQuadSensReInit(ida_mem::Ptr{Void},yQS0::Ptr{N_Vector}) - ccall((:IDAQuadSensReInit,libsundials_ida),Cint,(Ptr{Void},Ptr{N_Vector}),ida_mem,yQS0) +function IDASetNonlinConvCoefIC(ida_mem,epiccon) + __IDASetNonlinConvCoefIC(convert(IDAMemPtr,ida_mem),epiccon) end -function IDAQuadSensSStolerances(ida_mem::Ptr{Void},reltolQS::realtype,abstolQS::Vector{realtype}) - ccall((:IDAQuadSensSStolerances,libsundials_ida),Cint,(Ptr{Void},realtype,Ptr{realtype}),ida_mem,reltolQS,abstolQS) +function __IDASetMaxNumStepsIC(ida_mem::IDAMemPtr,maxnh::Cint) + ccall((:IDASetMaxNumStepsIC,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxnh) end -function IDAQuadSensSVtolerances(ida_mem::Ptr{Void},reltolQS::realtype,abstolQS::Ptr{N_Vector}) - ccall((:IDAQuadSensSVtolerances,libsundials_ida),Cint,(Ptr{Void},realtype,Ptr{N_Vector}),ida_mem,reltolQS,abstolQS) +function IDASetMaxNumStepsIC(ida_mem,maxnh) + __IDASetMaxNumStepsIC(convert(IDAMemPtr,ida_mem),convert(Cint,maxnh)) end -function IDAQuadSensEEtolerances(ida_mem::Ptr{Void}) - ccall((:IDAQuadSensEEtolerances,libsundials_ida),Cint,(Ptr{Void},),ida_mem) +function __IDASetMaxNumJacsIC(ida_mem::IDAMemPtr,maxnj::Cint) + ccall((:IDASetMaxNumJacsIC,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxnj) end -function IDASetQuadSensErrCon(ida_mem::Ptr{Void},errconQS::Int) - ccall((:IDASetQuadSensErrCon,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,errconQS) +function IDASetMaxNumJacsIC(ida_mem,maxnj) + __IDASetMaxNumJacsIC(convert(IDAMemPtr,ida_mem),convert(Cint,maxnj)) end -function IDACalcIC(ida_mem::Ptr{Void},icopt::Int,tout1::realtype) - ccall((:IDACalcIC,libsundials_ida),Cint,(Ptr{Void},Cint,realtype),ida_mem,icopt,tout1) +function __IDASetMaxNumItersIC(ida_mem::IDAMemPtr,maxnit::Cint) + ccall((:IDASetMaxNumItersIC,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxnit) end -function IDASolve(ida_mem::Ptr{Void},tout::realtype,tret::Vector{realtype},yret::N_Vector,ypret::N_Vector,itask::Int) - ccall((:IDASolve,libsundials_ida),Cint,(Ptr{Void},realtype,Ptr{realtype},N_Vector,N_Vector,Cint),ida_mem,tout,tret,yret,ypret,itask) +function IDASetMaxNumItersIC(ida_mem,maxnit) + __IDASetMaxNumItersIC(convert(IDAMemPtr,ida_mem),convert(Cint,maxnit)) end -function IDAGetDky(ida_mem::Ptr{Void},t::realtype,k::Int,dky::N_Vector) - ccall((:IDAGetDky,libsundials_ida),Cint,(Ptr{Void},realtype,Cint,N_Vector),ida_mem,t,k,dky) +function __IDASetLineSearchOffIC(ida_mem::IDAMemPtr,lsoff::Cint) + ccall((:IDASetLineSearchOffIC,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,lsoff) end -function IDAGetWorkSpace(ida_mem::Ptr{Void},lenrw::Ptr{Clong},leniw::Ptr{Clong}) - ccall((:IDAGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrw,leniw) +function IDASetLineSearchOffIC(ida_mem,lsoff) + __IDASetLineSearchOffIC(convert(IDAMemPtr,ida_mem),convert(Cint,lsoff)) end -function IDAGetNumSteps(ida_mem::Ptr{Void},nsteps::Ptr{Clong}) - ccall((:IDAGetNumSteps,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nsteps) +function __IDASetStepToleranceIC(ida_mem::IDAMemPtr,steptol::realtype) + ccall((:IDASetStepToleranceIC,libsundials_idas),Cint,(IDAMemPtr,realtype),ida_mem,steptol) end -function IDAGetNumResEvals(ida_mem::Ptr{Void},nrevals::Ptr{Clong}) - ccall((:IDAGetNumResEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nrevals) +function IDASetStepToleranceIC(ida_mem,steptol) + __IDASetStepToleranceIC(convert(IDAMemPtr,ida_mem),steptol) end -function IDAGetNumLinSolvSetups(ida_mem::Ptr{Void},nlinsetups::Ptr{Clong}) - ccall((:IDAGetNumLinSolvSetups,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nlinsetups) +function __IDARootInit(ida_mem::IDAMemPtr,nrtfn::Cint,g::IDARootFn) + ccall((:IDARootInit,libsundials_idas),Cint,(IDAMemPtr,Cint,IDARootFn),ida_mem,nrtfn,g) end -function IDAGetNumErrTestFails(ida_mem::Ptr{Void},netfails::Ptr{Clong}) - ccall((:IDAGetNumErrTestFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,netfails) +function IDARootInit(ida_mem,nrtfn,g) + __IDARootInit(convert(IDAMemPtr,ida_mem),convert(Cint,nrtfn),IDARootFn_wrapper(g)) end -function IDAGetNumBacktrackOps(ida_mem::Ptr{Void},nbacktr::Ptr{Clong}) - ccall((:IDAGetNumBacktrackOps,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nbacktr) +function __IDASetQuadErrCon(ida_mem::IDAMemPtr,errconQ::Cint) + ccall((:IDASetQuadErrCon,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,errconQ) end -function IDAGetConsistentIC(ida_mem::Ptr{Void},yy0_mod::N_Vector,yp0_mod::N_Vector) - ccall((:IDAGetConsistentIC,libsundials_ida),Cint,(Ptr{Void},N_Vector,N_Vector),ida_mem,yy0_mod,yp0_mod) +function IDASetQuadErrCon(ida_mem,errconQ) + __IDASetQuadErrCon(convert(IDAMemPtr,ida_mem),convert(Cint,errconQ)) end -function IDAGetLastOrder(ida_mem::Ptr{Void},klast::Ptr{Cint}) - ccall((:IDAGetLastOrder,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,klast) +function __IDAQuadInit(ida_mem::IDAMemPtr,rhsQ::IDAQuadRhsFn,yQ0::N_Vector) + ccall((:IDAQuadInit,libsundials_idas),Cint,(IDAMemPtr,IDAQuadRhsFn,N_Vector),ida_mem,rhsQ,yQ0) end -function IDAGetCurrentOrder(ida_mem::Ptr{Void},kcur::Ptr{Cint}) - ccall((:IDAGetCurrentOrder,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,kcur) +function IDAQuadInit(ida_mem,rhsQ,yQ0) + __yQ0 = convert(NVector,yQ0) + __IDAQuadInit(convert(IDAMemPtr,ida_mem),rhsQ,convert(N_Vector,__yQ0)) end -function IDAGetActualInitStep(ida_mem::Ptr{Void},hinused::Vector{realtype}) - ccall((:IDAGetActualInitStep,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,hinused) +function __IDAQuadReInit(ida_mem::IDAMemPtr,yQ0::N_Vector) + ccall((:IDAQuadReInit,libsundials_idas),Cint,(IDAMemPtr,N_Vector),ida_mem,yQ0) end -function IDAGetLastStep(ida_mem::Ptr{Void},hlast::Vector{realtype}) - ccall((:IDAGetLastStep,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,hlast) +function IDAQuadReInit(ida_mem,yQ0) + __yQ0 = convert(NVector,yQ0) + __IDAQuadReInit(convert(IDAMemPtr,ida_mem),convert(N_Vector,__yQ0)) end -function IDAGetCurrentStep(ida_mem::Ptr{Void},hcur::Vector{realtype}) - ccall((:IDAGetCurrentStep,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,hcur) +function __IDAQuadSStolerances(ida_mem::IDAMemPtr,reltolQ::realtype,abstolQ::realtype) + ccall((:IDAQuadSStolerances,libsundials_idas),Cint,(IDAMemPtr,realtype,realtype),ida_mem,reltolQ,abstolQ) end -function IDAGetCurrentTime(ida_mem::Ptr{Void},tcur::Vector{realtype}) - ccall((:IDAGetCurrentTime,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,tcur) +function IDAQuadSStolerances(ida_mem,reltolQ,abstolQ) + __IDAQuadSStolerances(convert(IDAMemPtr,ida_mem),reltolQ,abstolQ) end -function IDAGetTolScaleFactor(ida_mem::Ptr{Void},tolsfact::Vector{realtype}) - ccall((:IDAGetTolScaleFactor,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype}),ida_mem,tolsfact) +function __IDAQuadSVtolerances(ida_mem::IDAMemPtr,reltolQ::realtype,abstolQ::N_Vector) + ccall((:IDAQuadSVtolerances,libsundials_idas),Cint,(IDAMemPtr,realtype,N_Vector),ida_mem,reltolQ,abstolQ) end -function IDAGetErrWeights(ida_mem::Ptr{Void},eweight::N_Vector) - ccall((:IDAGetErrWeights,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,eweight) +function IDAQuadSVtolerances(ida_mem,reltolQ,abstolQ) + __abstolQ = convert(NVector,abstolQ) + __IDAQuadSVtolerances(convert(IDAMemPtr,ida_mem),reltolQ,convert(N_Vector,__abstolQ)) end -function IDAGetEstLocalErrors(ida_mem::Ptr{Void},ele::N_Vector) - ccall((:IDAGetEstLocalErrors,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,ele) +function __IDASetSensDQMethod(ida_mem::IDAMemPtr,DQtype::Cint,DQrhomax::realtype) + ccall((:IDASetSensDQMethod,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype),ida_mem,DQtype,DQrhomax) end -function IDAGetNumGEvals(ida_mem::Ptr{Void},ngevals::Ptr{Clong}) - ccall((:IDAGetNumGEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,ngevals) +function IDASetSensDQMethod(ida_mem,DQtype,DQrhomax) + __IDASetSensDQMethod(convert(IDAMemPtr,ida_mem),convert(Cint,DQtype),DQrhomax) end -function IDAGetRootInfo(ida_mem::Ptr{Void},rootsfound::Ptr{Cint}) - ccall((:IDAGetRootInfo,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,rootsfound) +function __IDASetSensParams(ida_mem::IDAMemPtr,p::Ptr{realtype},pbar::Ptr{realtype},plist::Ptr{Cint}) + ccall((:IDASetSensParams,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype},Ptr{realtype},Ptr{Cint}),ida_mem,p,pbar,plist) end -function IDAGetIntegratorStats(ida_mem::Ptr{Void},nsteps::Ptr{Clong},nrevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Vector{realtype},hlast::Vector{realtype},hcur::Vector{realtype},tcur::Vector{realtype}) - ccall((:IDAGetIntegratorStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),ida_mem,nsteps,nrevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) +function IDASetSensParams(ida_mem,p,pbar,plist) + __IDASetSensParams(convert(IDAMemPtr,ida_mem),pointer(p),pointer(pbar),pointer(plist)) end -function IDAGetNumNonlinSolvIters(ida_mem::Ptr{Void},nniters::Ptr{Clong}) - ccall((:IDAGetNumNonlinSolvIters,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nniters) +function __IDASetSensErrCon(ida_mem::IDAMemPtr,errconS::Cint) + ccall((:IDASetSensErrCon,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,errconS) end -function IDAGetNumNonlinSolvConvFails(ida_mem::Ptr{Void},nncfails::Ptr{Clong}) - ccall((:IDAGetNumNonlinSolvConvFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nncfails) +function IDASetSensErrCon(ida_mem,errconS) + __IDASetSensErrCon(convert(IDAMemPtr,ida_mem),convert(Cint,errconS)) end -function IDAGetNonlinSolvStats(ida_mem::Ptr{Void},nniters::Ptr{Clong},nncfails::Ptr{Clong}) - ccall((:IDAGetNonlinSolvStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,nniters,nncfails) +function __IDASetSensMaxNonlinIters(ida_mem::IDAMemPtr,maxcorS::Cint) + ccall((:IDASetSensMaxNonlinIters,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxcorS) end -function IDAGetQuad(ida_mem::Ptr{Void},t::Vector{realtype},yQout::N_Vector) - ccall((:IDAGetQuad,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype},N_Vector),ida_mem,t,yQout) +function IDASetSensMaxNonlinIters(ida_mem,maxcorS) + __IDASetSensMaxNonlinIters(convert(IDAMemPtr,ida_mem),convert(Cint,maxcorS)) end -function IDAGetQuadDky(ida_mem::Ptr{Void},t::realtype,k::Int,dky::N_Vector) - ccall((:IDAGetQuadDky,libsundials_ida),Cint,(Ptr{Void},realtype,Cint,N_Vector),ida_mem,t,k,dky) +function __IDASensInit(ida_mem::IDAMemPtr,Ns::Cint,ism::Cint,resS::IDASensResFn,yS0::Ptr{N_Vector},ypS0::Ptr{N_Vector}) + ccall((:IDASensInit,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint,IDASensResFn,Ptr{N_Vector},Ptr{N_Vector}),ida_mem,Ns,ism,resS,yS0,ypS0) end -function IDAGetQuadNumRhsEvals(ida_mem::Ptr{Void},nrhsQevals::Ptr{Clong}) - ccall((:IDAGetQuadNumRhsEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nrhsQevals) +function IDASensInit(ida_mem,Ns,ism,resS,yS0,ypS0) + __IDASensInit(convert(IDAMemPtr,ida_mem),convert(Cint,Ns),convert(Cint,ism),resS,pointer(yS0),pointer(ypS0)) end -function IDAGetQuadNumErrTestFails(ida_mem::Ptr{Void},nQetfails::Ptr{Clong}) - ccall((:IDAGetQuadNumErrTestFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nQetfails) +function __IDASensReInit(ida_mem::IDAMemPtr,ism::Cint,yS0::Ptr{N_Vector},ypS0::Ptr{N_Vector}) + ccall((:IDASensReInit,libsundials_idas),Cint,(IDAMemPtr,Cint,Ptr{N_Vector},Ptr{N_Vector}),ida_mem,ism,yS0,ypS0) end -function IDAGetQuadErrWeights(ida_mem::Ptr{Void},eQweight::N_Vector) - ccall((:IDAGetQuadErrWeights,libsundials_ida),Cint,(Ptr{Void},N_Vector),ida_mem,eQweight) +function IDASensReInit(ida_mem,ism,yS0,ypS0) + __IDASensReInit(convert(IDAMemPtr,ida_mem),convert(Cint,ism),pointer(yS0),pointer(ypS0)) end -function IDAGetQuadStats(ida_mem::Ptr{Void},nrhsQevals::Ptr{Clong},nQetfails::Ptr{Clong}) - ccall((:IDAGetQuadStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,nrhsQevals,nQetfails) +function __IDASensToggleOff(ida_mem::IDAMemPtr) + ccall((:IDASensToggleOff,libsundials_idas),Cint,(IDAMemPtr,),ida_mem) end -function IDAGetSens(ida_mem::Ptr{Void},tret::Vector{realtype},yySout::Ptr{N_Vector}) - ccall((:IDAGetSens,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype},Ptr{N_Vector}),ida_mem,tret,yySout) +function IDASensToggleOff(ida_mem) + __IDASensToggleOff(convert(IDAMemPtr,ida_mem)) end -function IDAGetSens1(ida_mem::Ptr{Void},tret::Vector{realtype},is::Int,yySret::N_Vector) - ccall((:IDAGetSens1,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype},Cint,N_Vector),ida_mem,tret,is,yySret) +function __IDASensSStolerances(ida_mem::IDAMemPtr,reltolS::realtype,abstolS::Ptr{realtype}) + ccall((:IDASensSStolerances,libsundials_idas),Cint,(IDAMemPtr,realtype,Ptr{realtype}),ida_mem,reltolS,abstolS) end -function IDAGetSensDky(ida_mem::Ptr{Void},t::realtype,k::Int,dkyS::Ptr{N_Vector}) - ccall((:IDAGetSensDky,libsundials_ida),Cint,(Ptr{Void},realtype,Cint,Ptr{N_Vector}),ida_mem,t,k,dkyS) +function IDASensSStolerances(ida_mem,reltolS,abstolS) + __IDASensSStolerances(convert(IDAMemPtr,ida_mem),reltolS,pointer(abstolS)) end -function IDAGetSensDky1(ida_mem::Ptr{Void},t::realtype,k::Int,is::Int,dkyS::N_Vector) - ccall((:IDAGetSensDky1,libsundials_ida),Cint,(Ptr{Void},realtype,Cint,Cint,N_Vector),ida_mem,t,k,is,dkyS) +function __IDASensSVtolerances(ida_mem::IDAMemPtr,reltolS::realtype,abstolS::Ptr{N_Vector}) + ccall((:IDASensSVtolerances,libsundials_idas),Cint,(IDAMemPtr,realtype,Ptr{N_Vector}),ida_mem,reltolS,abstolS) end -function IDAGetSensConsistentIC(ida_mem::Ptr{Void},yyS0::Ptr{N_Vector},ypS0::Ptr{N_Vector}) - ccall((:IDAGetSensConsistentIC,libsundials_ida),Cint,(Ptr{Void},Ptr{N_Vector},Ptr{N_Vector}),ida_mem,yyS0,ypS0) +function IDASensSVtolerances(ida_mem,reltolS,abstolS) + __IDASensSVtolerances(convert(IDAMemPtr,ida_mem),reltolS,pointer(abstolS)) end -function IDAGetSensNumResEvals(ida_mem::Ptr{Void},nresSevals::Ptr{Clong}) - ccall((:IDAGetSensNumResEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nresSevals) +function __IDASensEEtolerances(ida_mem::IDAMemPtr) + ccall((:IDASensEEtolerances,libsundials_idas),Cint,(IDAMemPtr,),ida_mem) end -function IDAGetNumResEvalsSens(ida_mem::Ptr{Void},nresevalsS::Ptr{Clong}) - ccall((:IDAGetNumResEvalsSens,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nresevalsS) +function IDASensEEtolerances(ida_mem) + __IDASensEEtolerances(convert(IDAMemPtr,ida_mem)) end -function IDAGetSensNumErrTestFails(ida_mem::Ptr{Void},nSetfails::Ptr{Clong}) - ccall((:IDAGetSensNumErrTestFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nSetfails) +function __IDAQuadSensInit(ida_mem::IDAMemPtr,resQS::IDAQuadSensRhsFn,yQS0::Ptr{N_Vector}) + ccall((:IDAQuadSensInit,libsundials_idas),Cint,(IDAMemPtr,IDAQuadSensRhsFn,Ptr{N_Vector}),ida_mem,resQS,yQS0) end -function IDAGetSensNumLinSolvSetups(ida_mem::Ptr{Void},nlinsetupsS::Ptr{Clong}) - ccall((:IDAGetSensNumLinSolvSetups,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nlinsetupsS) +function IDAQuadSensInit(ida_mem,resQS,yQS0) + __IDAQuadSensInit(convert(IDAMemPtr,ida_mem),resQS,pointer(yQS0)) end -function IDAGetSensErrWeights(ida_mem::Ptr{Void},eSweight::N_Vector_S) - ccall((:IDAGetSensErrWeights,libsundials_ida),Cint,(Ptr{Void},N_Vector_S),ida_mem,eSweight) +function __IDAQuadSensReInit(ida_mem::IDAMemPtr,yQS0::Ptr{N_Vector}) + ccall((:IDAQuadSensReInit,libsundials_idas),Cint,(IDAMemPtr,Ptr{N_Vector}),ida_mem,yQS0) end -function IDAGetSensStats(ida_mem::Ptr{Void},nresSevals::Ptr{Clong},nresevalsS::Ptr{Clong},nSetfails::Ptr{Clong},nlinsetupsS::Ptr{Clong}) - ccall((:IDAGetSensStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong}),ida_mem,nresSevals,nresevalsS,nSetfails,nlinsetupsS) +function IDAQuadSensReInit(ida_mem,yQS0) + __IDAQuadSensReInit(convert(IDAMemPtr,ida_mem),pointer(yQS0)) end -function IDAGetSensNumNonlinSolvIters(ida_mem::Ptr{Void},nSniters::Ptr{Clong}) - ccall((:IDAGetSensNumNonlinSolvIters,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nSniters) +function __IDAQuadSensSStolerances(ida_mem::IDAMemPtr,reltolQS::realtype,abstolQS::Ptr{realtype}) + ccall((:IDAQuadSensSStolerances,libsundials_idas),Cint,(IDAMemPtr,realtype,Ptr{realtype}),ida_mem,reltolQS,abstolQS) end -function IDAGetSensNumNonlinSolvConvFails(ida_mem::Ptr{Void},nSncfails::Ptr{Clong}) - ccall((:IDAGetSensNumNonlinSolvConvFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nSncfails) +function IDAQuadSensSStolerances(ida_mem,reltolQS,abstolQS) + __IDAQuadSensSStolerances(convert(IDAMemPtr,ida_mem),reltolQS,pointer(abstolQS)) end -function IDAGetSensNonlinSolvStats(ida_mem::Ptr{Void},nSniters::Ptr{Clong},nSncfails::Ptr{Clong}) - ccall((:IDAGetSensNonlinSolvStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,nSniters,nSncfails) +function __IDAQuadSensSVtolerances(ida_mem::IDAMemPtr,reltolQS::realtype,abstolQS::Ptr{N_Vector}) + ccall((:IDAQuadSensSVtolerances,libsundials_idas),Cint,(IDAMemPtr,realtype,Ptr{N_Vector}),ida_mem,reltolQS,abstolQS) end -function IDAGetQuadSensNumRhsEvals(ida_mem::Ptr{Void},nrhsQSevals::Ptr{Clong}) - ccall((:IDAGetQuadSensNumRhsEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nrhsQSevals) +function IDAQuadSensSVtolerances(ida_mem,reltolQS,abstolQS) + __IDAQuadSensSVtolerances(convert(IDAMemPtr,ida_mem),reltolQS,pointer(abstolQS)) end -function IDAGetQuadSensNumErrTestFails(ida_mem::Ptr{Void},nQSetfails::Ptr{Clong}) - ccall((:IDAGetQuadSensNumErrTestFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nQSetfails) +function __IDAQuadSensEEtolerances(ida_mem::IDAMemPtr) + ccall((:IDAQuadSensEEtolerances,libsundials_idas),Cint,(IDAMemPtr,),ida_mem) end -function IDAGetQuadSensErrWeights(ida_mem::Ptr{Void},eQSweight::Ptr{N_Vector}) - ccall((:IDAGetQuadSensErrWeights,libsundials_ida),Cint,(Ptr{Void},Ptr{N_Vector}),ida_mem,eQSweight) +function IDAQuadSensEEtolerances(ida_mem) + __IDAQuadSensEEtolerances(convert(IDAMemPtr,ida_mem)) end -function IDAGetQuadSensStats(ida_mem::Ptr{Void},nrhsQSevals::Ptr{Clong},nQSetfails::Ptr{Clong}) - ccall((:IDAGetQuadSensStats,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,nrhsQSevals,nQSetfails) +function __IDASetQuadSensErrCon(ida_mem::IDAMemPtr,errconQS::Cint) + ccall((:IDASetQuadSensErrCon,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,errconQS) end -function IDAGetQuadSens(ida_mem::Ptr{Void},tret::Vector{realtype},yyQSout::Ptr{N_Vector}) - ccall((:IDAGetQuadSens,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype},Ptr{N_Vector}),ida_mem,tret,yyQSout) +function IDASetQuadSensErrCon(ida_mem,errconQS) + __IDASetQuadSensErrCon(convert(IDAMemPtr,ida_mem),convert(Cint,errconQS)) end -function IDAGetQuadSens1(ida_mem::Ptr{Void},tret::Vector{realtype},is::Int,yyQSret::N_Vector) - ccall((:IDAGetQuadSens1,libsundials_ida),Cint,(Ptr{Void},Ptr{realtype},Cint,N_Vector),ida_mem,tret,is,yyQSret) +function __IDACalcIC(ida_mem::IDAMemPtr,icopt::Cint,tout1::realtype) + ccall((:IDACalcIC,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype),ida_mem,icopt,tout1) end -function IDAGetQuadSensDky(ida_mem::Ptr{Void},t::realtype,k::Int,dkyQS::Ptr{N_Vector}) - ccall((:IDAGetQuadSensDky,libsundials_ida),Cint,(Ptr{Void},realtype,Cint,Ptr{N_Vector}),ida_mem,t,k,dkyQS) +function IDACalcIC(ida_mem,icopt,tout1) + __IDACalcIC(convert(IDAMemPtr,ida_mem),convert(Cint,icopt),tout1) end -function IDAGetQuadSensDky1(ida_mem::Ptr{Void},t::realtype,k::Int,is::Int,dkyQS::N_Vector) - ccall((:IDAGetQuadSensDky1,libsundials_ida),Cint,(Ptr{Void},realtype,Cint,Cint,N_Vector),ida_mem,t,k,is,dkyQS) +function __IDASolve(ida_mem::IDAMemPtr,tout::realtype,tret::Ptr{realtype},yret::N_Vector,ypret::N_Vector,itask::Cint) + ccall((:IDASolve,libsundials_idas),Cint,(IDAMemPtr,realtype,Ptr{realtype},N_Vector,N_Vector,Cint),ida_mem,tout,tret,yret,ypret,itask) end -function IDAGetReturnFlagName(flag::Int) - ccall((:IDAGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) +function IDASolve(ida_mem,tout,tret,yret,ypret,itask) + __yret = convert(NVector,yret) + __ypret = convert(NVector,ypret) + __IDASolve(convert(IDAMemPtr,ida_mem),tout,pointer(tret),convert(N_Vector,__yret),convert(N_Vector,__ypret),convert(Cint,itask)) end -function IDAFree(ida_mem::Vector{Ptr{Void}}) - ccall((:IDAFree,libsundials_ida),Void,(Ptr{Ptr{Void}},),ida_mem) +function __IDAGetDky(ida_mem::IDAMemPtr,t::realtype,k::Cint,dky::N_Vector) + ccall((:IDAGetDky,libsundials_idas),Cint,(IDAMemPtr,realtype,Cint,N_Vector),ida_mem,t,k,dky) end -function IDAQuadFree(ida_mem::Ptr{Void}) - ccall((:IDAQuadFree,libsundials_ida),Void,(Ptr{Void},),ida_mem) +function IDAGetDky(ida_mem,t,k,dky) + __dky = convert(NVector,dky) + __IDAGetDky(convert(IDAMemPtr,ida_mem),t,convert(Cint,k),convert(N_Vector,__dky)) end -function IDASensFree(ida_mem::Ptr{Void}) - ccall((:IDASensFree,libsundials_ida),Void,(Ptr{Void},),ida_mem) +function __IDAGetWorkSpace(ida_mem::IDAMemPtr,lenrw::Ptr{Clong},leniw::Ptr{Clong}) + ccall((:IDAGetWorkSpace,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,lenrw,leniw) end -function IDAQuadSensFree(ida_mem::Ptr{Void}) - ccall((:IDAQuadSensFree,libsundials_ida),Void,(Ptr{Void},),ida_mem) +function IDAGetWorkSpace(ida_mem,lenrw,leniw) + __IDAGetWorkSpace(convert(IDAMemPtr,ida_mem),pointer(lenrw),pointer(leniw)) end -function IDAAdjInit(ida_mem::Ptr{Void},steps::Int,interp::Int) - ccall((:IDAAdjInit,libsundials_ida),Cint,(Ptr{Void},Clong,Cint),ida_mem,steps,interp) +function __IDAGetNumSteps(ida_mem::IDAMemPtr,nsteps::Ptr{Clong}) + ccall((:IDAGetNumSteps,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nsteps) end -function IDAAdjReInit(ida_mem::Ptr{Void}) - ccall((:IDAAdjReInit,libsundials_ida),Cint,(Ptr{Void},),ida_mem) +function IDAGetNumSteps(ida_mem,nsteps) + __IDAGetNumSteps(convert(IDAMemPtr,ida_mem),pointer(nsteps)) end -function IDAAdjFree(ida_mem::Ptr{Void}) - ccall((:IDAAdjFree,libsundials_ida),Void,(Ptr{Void},),ida_mem) +function __IDAGetNumResEvals(ida_mem::IDAMemPtr,nrevals::Ptr{Clong}) + ccall((:IDAGetNumResEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nrevals) end -function IDACreateB(ida_mem::Ptr{Void},which::Ptr{Cint}) - ccall((:IDACreateB,libsundials_ida),Cint,(Ptr{Void},Ptr{Cint}),ida_mem,which) +function IDAGetNumResEvals(ida_mem,nrevals) + __IDAGetNumResEvals(convert(IDAMemPtr,ida_mem),pointer(nrevals)) end -function IDAInitB(ida_mem::Ptr{Void},which::Int,resB::IDAResFnB,tB0::realtype,yyB0::N_Vector,ypB0::N_Vector) - ccall((:IDAInitB,libsundials_ida),Cint,(Ptr{Void},Cint,IDAResFnB,realtype,N_Vector,N_Vector),ida_mem,which,resB,tB0,yyB0,ypB0) +function __IDAGetNumLinSolvSetups(ida_mem::IDAMemPtr,nlinsetups::Ptr{Clong}) + ccall((:IDAGetNumLinSolvSetups,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nlinsetups) end -function IDAInitBS(ida_mem::Ptr{Void},which::Int,resS::IDAResFnBS,tB0::realtype,yyB0::N_Vector,ypB0::N_Vector) - ccall((:IDAInitBS,libsundials_ida),Cint,(Ptr{Void},Cint,IDAResFnBS,realtype,N_Vector,N_Vector),ida_mem,which,resS,tB0,yyB0,ypB0) +function IDAGetNumLinSolvSetups(ida_mem,nlinsetups) + __IDAGetNumLinSolvSetups(convert(IDAMemPtr,ida_mem),pointer(nlinsetups)) end -function IDAReInitB(ida_mem::Ptr{Void},which::Int,tB0::realtype,yyB0::N_Vector,ypB0::N_Vector) - ccall((:IDAReInitB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype,N_Vector,N_Vector),ida_mem,which,tB0,yyB0,ypB0) +function __IDAGetNumErrTestFails(ida_mem::IDAMemPtr,netfails::Ptr{Clong}) + ccall((:IDAGetNumErrTestFails,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,netfails) end -function IDASStolerancesB(ida_mem::Ptr{Void},which::Int,relTolB::realtype,absTolB::realtype) - ccall((:IDASStolerancesB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype,realtype),ida_mem,which,relTolB,absTolB) +function IDAGetNumErrTestFails(ida_mem,netfails) + __IDAGetNumErrTestFails(convert(IDAMemPtr,ida_mem),pointer(netfails)) end -function IDASVtolerancesB(ida_mem::Ptr{Void},which::Int,relTolB::realtype,absTolB::N_Vector) - ccall((:IDASVtolerancesB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype,N_Vector),ida_mem,which,relTolB,absTolB) +function __IDAGetNumBacktrackOps(ida_mem::IDAMemPtr,nbacktr::Ptr{Clong}) + ccall((:IDAGetNumBacktrackOps,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nbacktr) end -function IDAQuadInitB(ida_mem::Ptr{Void},which::Int,rhsQB::IDAQuadRhsFnB,yQB0::N_Vector) - ccall((:IDAQuadInitB,libsundials_ida),Cint,(Ptr{Void},Cint,IDAQuadRhsFnB,N_Vector),ida_mem,which,rhsQB,yQB0) +function IDAGetNumBacktrackOps(ida_mem,nbacktr) + __IDAGetNumBacktrackOps(convert(IDAMemPtr,ida_mem),pointer(nbacktr)) end -function IDAQuadInitBS(ida_mem::Ptr{Void},which::Int,rhsQS::IDAQuadRhsFnBS,yQB0::N_Vector) - ccall((:IDAQuadInitBS,libsundials_ida),Cint,(Ptr{Void},Cint,IDAQuadRhsFnBS,N_Vector),ida_mem,which,rhsQS,yQB0) +function __IDAGetConsistentIC(ida_mem::IDAMemPtr,yy0_mod::N_Vector,yp0_mod::N_Vector) + ccall((:IDAGetConsistentIC,libsundials_idas),Cint,(IDAMemPtr,N_Vector,N_Vector),ida_mem,yy0_mod,yp0_mod) end -function IDAQuadReInitB(ida_mem::Ptr{Void},which::Int,yQB0::N_Vector) - ccall((:IDAQuadReInitB,libsundials_ida),Cint,(Ptr{Void},Cint,N_Vector),ida_mem,which,yQB0) +function IDAGetConsistentIC(ida_mem,yy0_mod,yp0_mod) + __yy0_mod = convert(NVector,yy0_mod) + __yp0_mod = convert(NVector,yp0_mod) + __IDAGetConsistentIC(convert(IDAMemPtr,ida_mem),convert(N_Vector,__yy0_mod),convert(N_Vector,__yp0_mod)) end -function IDAQuadSStolerancesB(ida_mem::Ptr{Void},which::Int,reltolQB::realtype,abstolQB::realtype) - ccall((:IDAQuadSStolerancesB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype,realtype),ida_mem,which,reltolQB,abstolQB) +function __IDAGetLastOrder(ida_mem::IDAMemPtr,klast::Ptr{Cint}) + ccall((:IDAGetLastOrder,libsundials_idas),Cint,(IDAMemPtr,Ptr{Cint}),ida_mem,klast) end -function IDAQuadSVtolerancesB(ida_mem::Ptr{Void},which::Int,reltolQB::realtype,abstolQB::N_Vector) - ccall((:IDAQuadSVtolerancesB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype,N_Vector),ida_mem,which,reltolQB,abstolQB) +function IDAGetLastOrder(ida_mem,klast) + __IDAGetLastOrder(convert(IDAMemPtr,ida_mem),pointer(klast)) end -function IDACalcICB(ida_mem::Ptr{Void},which::Int,tout1::realtype,yy0::N_Vector,yp0::N_Vector) - ccall((:IDACalcICB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype,N_Vector,N_Vector),ida_mem,which,tout1,yy0,yp0) +function __IDAGetCurrentOrder(ida_mem::IDAMemPtr,kcur::Ptr{Cint}) + ccall((:IDAGetCurrentOrder,libsundials_idas),Cint,(IDAMemPtr,Ptr{Cint}),ida_mem,kcur) end -function IDACalcICBS(ida_mem::Ptr{Void},which::Int,tout1::realtype,yy0::N_Vector,yp0::N_Vector,yyS0::Ptr{N_Vector},ypS0::Ptr{N_Vector}) - ccall((:IDACalcICBS,libsundials_ida),Cint,(Ptr{Void},Cint,realtype,N_Vector,N_Vector,Ptr{N_Vector},Ptr{N_Vector}),ida_mem,which,tout1,yy0,yp0,yyS0,ypS0) +function IDAGetCurrentOrder(ida_mem,kcur) + __IDAGetCurrentOrder(convert(IDAMemPtr,ida_mem),pointer(kcur)) end -function IDASolveF(ida_mem::Ptr{Void},tout::realtype,tret::Vector{realtype},yret::N_Vector,ypret::N_Vector,itask::Int,ncheckPtr::Ptr{Cint}) - ccall((:IDASolveF,libsundials_ida),Cint,(Ptr{Void},realtype,Ptr{realtype},N_Vector,N_Vector,Cint,Ptr{Cint}),ida_mem,tout,tret,yret,ypret,itask,ncheckPtr) +function __IDAGetActualInitStep(ida_mem::IDAMemPtr,hinused::Ptr{realtype}) + ccall((:IDAGetActualInitStep,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,hinused) end -function IDASolveB(ida_mem::Ptr{Void},tBout::realtype,itaskB::Int) - ccall((:IDASolveB,libsundials_ida),Cint,(Ptr{Void},realtype,Cint),ida_mem,tBout,itaskB) +function IDAGetActualInitStep(ida_mem,hinused) + __IDAGetActualInitStep(convert(IDAMemPtr,ida_mem),pointer(hinused)) end -function IDASetAdjNoSensi(ida_mem::Ptr{Void}) - ccall((:IDASetAdjNoSensi,libsundials_ida),Cint,(Ptr{Void},),ida_mem) +function __IDAGetLastStep(ida_mem::IDAMemPtr,hlast::Ptr{realtype}) + ccall((:IDAGetLastStep,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,hlast) end -function IDASetUserDataB(ida_mem::Ptr{Void},which::Int,user_dataB::Ptr{Void}) - ccall((:IDASetUserDataB,libsundials_ida),Cint,(Ptr{Void},Cint,Ptr{Void}),ida_mem,which,user_dataB) +function IDAGetLastStep(ida_mem,hlast) + __IDAGetLastStep(convert(IDAMemPtr,ida_mem),pointer(hlast)) end -function IDASetMaxOrdB(ida_mem::Ptr{Void},which::Int,maxordB::Int) - ccall((:IDASetMaxOrdB,libsundials_ida),Cint,(Ptr{Void},Cint,Cint),ida_mem,which,maxordB) +function __IDAGetCurrentStep(ida_mem::IDAMemPtr,hcur::Ptr{realtype}) + ccall((:IDAGetCurrentStep,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,hcur) end -function IDASetMaxNumStepsB(ida_mem::Ptr{Void},which::Int,mxstepsB::Int) - ccall((:IDASetMaxNumStepsB,libsundials_ida),Cint,(Ptr{Void},Cint,Clong),ida_mem,which,mxstepsB) +function IDAGetCurrentStep(ida_mem,hcur) + __IDAGetCurrentStep(convert(IDAMemPtr,ida_mem),pointer(hcur)) end -function IDASetInitStepB(ida_mem::Ptr{Void},which::Int,hinB::realtype) - ccall((:IDASetInitStepB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype),ida_mem,which,hinB) +function __IDAGetCurrentTime(ida_mem::IDAMemPtr,tcur::Ptr{realtype}) + ccall((:IDAGetCurrentTime,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,tcur) end -function IDASetMaxStepB(ida_mem::Ptr{Void},which::Int,hmaxB::realtype) - ccall((:IDASetMaxStepB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype),ida_mem,which,hmaxB) +function IDAGetCurrentTime(ida_mem,tcur) + __IDAGetCurrentTime(convert(IDAMemPtr,ida_mem),pointer(tcur)) end -function IDASetSuppressAlgB(ida_mem::Ptr{Void},which::Int,suppressalgB::Int) - ccall((:IDASetSuppressAlgB,libsundials_ida),Cint,(Ptr{Void},Cint,Cint),ida_mem,which,suppressalgB) +function __IDAGetTolScaleFactor(ida_mem::IDAMemPtr,tolsfact::Ptr{realtype}) + ccall((:IDAGetTolScaleFactor,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype}),ida_mem,tolsfact) end -function IDASetIdB(ida_mem::Ptr{Void},which::Int,idB::N_Vector) - ccall((:IDASetIdB,libsundials_ida),Cint,(Ptr{Void},Cint,N_Vector),ida_mem,which,idB) +function IDAGetTolScaleFactor(ida_mem,tolsfact) + __IDAGetTolScaleFactor(convert(IDAMemPtr,ida_mem),pointer(tolsfact)) end -function IDASetConstraintsB(ida_mem::Ptr{Void},which::Int,constraintsB::N_Vector) - ccall((:IDASetConstraintsB,libsundials_ida),Cint,(Ptr{Void},Cint,N_Vector),ida_mem,which,constraintsB) +function __IDAGetErrWeights(ida_mem::IDAMemPtr,eweight::N_Vector) + ccall((:IDAGetErrWeights,libsundials_idas),Cint,(IDAMemPtr,N_Vector),ida_mem,eweight) end -function IDASetQuadErrConB(ida_mem::Ptr{Void},which::Int,errconQB::Int) - ccall((:IDASetQuadErrConB,libsundials_ida),Cint,(Ptr{Void},Cint,Cint),ida_mem,which,errconQB) +function IDAGetErrWeights(ida_mem,eweight) + __eweight = convert(NVector,eweight) + __IDAGetErrWeights(convert(IDAMemPtr,ida_mem),convert(N_Vector,__eweight)) end -function IDAGetB(ida_mem::Ptr{Void},which::Int,tret::Vector{realtype},yy::N_Vector,yp::N_Vector) - ccall((:IDAGetB,libsundials_ida),Cint,(Ptr{Void},Cint,Ptr{realtype},N_Vector,N_Vector),ida_mem,which,tret,yy,yp) +function __IDAGetEstLocalErrors(ida_mem::IDAMemPtr,ele::N_Vector) + ccall((:IDAGetEstLocalErrors,libsundials_idas),Cint,(IDAMemPtr,N_Vector),ida_mem,ele) end -function IDAGetQuadB(ida_mem::Ptr{Void},which::Int,tret::Vector{realtype},qB::N_Vector) - ccall((:IDAGetQuadB,libsundials_ida),Cint,(Ptr{Void},Cint,Ptr{realtype},N_Vector),ida_mem,which,tret,qB) +function IDAGetEstLocalErrors(ida_mem,ele) + __ele = convert(NVector,ele) + __IDAGetEstLocalErrors(convert(IDAMemPtr,ida_mem),convert(N_Vector,__ele)) end -function IDAGetAdjIDABmem(ida_mem::Ptr{Void},which::Int) - ccall((:IDAGetAdjIDABmem,libsundials_ida),Ptr{Void},(Ptr{Void},Cint),ida_mem,which) +function __IDAGetNumGEvals(ida_mem::IDAMemPtr,ngevals::Ptr{Clong}) + ccall((:IDAGetNumGEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,ngevals) end -function IDAGetConsistentICB(ida_mem::Ptr{Void},which::Int,yyB0::N_Vector,ypB0::N_Vector) - ccall((:IDAGetConsistentICB,libsundials_ida),Cint,(Ptr{Void},Cint,N_Vector,N_Vector),ida_mem,which,yyB0,ypB0) +function IDAGetNumGEvals(ida_mem,ngevals) + __IDAGetNumGEvals(convert(IDAMemPtr,ida_mem),pointer(ngevals)) end -function IDAGetAdjY(ida_mem::Ptr{Void},t::realtype,yy::N_Vector,yp::N_Vector) - ccall((:IDAGetAdjY,libsundials_ida),Cint,(Ptr{Void},realtype,N_Vector,N_Vector),ida_mem,t,yy,yp) +function __IDAGetRootInfo(ida_mem::IDAMemPtr,rootsfound::Ptr{Cint}) + ccall((:IDAGetRootInfo,libsundials_idas),Cint,(IDAMemPtr,Ptr{Cint}),ida_mem,rootsfound) end -function IDAGetAdjCheckPointsInfo(ida_mem::Ptr{Void},ckpnt::Ptr{IDAadjCheckPointRec}) - ccall((:IDAGetAdjCheckPointsInfo,libsundials_ida),Cint,(Ptr{Void},Ptr{IDAadjCheckPointRec}),ida_mem,ckpnt) +function IDAGetRootInfo(ida_mem,rootsfound) + __IDAGetRootInfo(convert(IDAMemPtr,ida_mem),pointer(rootsfound)) end -function IDAGetAdjDataPointHermite(ida_mem::Ptr{Void},which::Int,t::Vector{realtype},yy::N_Vector,yd::N_Vector) - ccall((:IDAGetAdjDataPointHermite,libsundials_ida),Cint,(Ptr{Void},Cint,Ptr{realtype},N_Vector,N_Vector),ida_mem,which,t,yy,yd) +function __IDAGetIntegratorStats(ida_mem::IDAMemPtr,nsteps::Ptr{Clong},nrevals::Ptr{Clong},nlinsetups::Ptr{Clong},netfails::Ptr{Clong},qlast::Ptr{Cint},qcur::Ptr{Cint},hinused::Ptr{realtype},hlast::Ptr{realtype},hcur::Ptr{realtype},tcur::Ptr{realtype}) + ccall((:IDAGetIntegratorStats,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Cint},Ptr{Cint},Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),ida_mem,nsteps,nrevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) end -function IDAGetAdjDataPointPolynomial(ida_mem::Ptr{Void},which::Int,t::Vector{realtype},order::Ptr{Cint},y::N_Vector) - ccall((:IDAGetAdjDataPointPolynomial,libsundials_ida),Cint,(Ptr{Void},Cint,Ptr{realtype},Ptr{Cint},N_Vector),ida_mem,which,t,order,y) +function IDAGetIntegratorStats(ida_mem,nsteps,nrevals,nlinsetups,netfails,qlast,qcur,hinused,hlast,hcur,tcur) + __IDAGetIntegratorStats(convert(IDAMemPtr,ida_mem),pointer(nsteps),pointer(nrevals),pointer(nlinsetups),pointer(netfails),pointer(qlast),pointer(qcur),pointer(hinused),pointer(hlast),pointer(hcur),pointer(tcur)) end -function IDAGetAdjCurrentCheckPoint(ida_mem::Ptr{Void},addr::Vector{Ptr{Void}}) - ccall((:IDAGetAdjCurrentCheckPoint,libsundials_ida),Cint,(Ptr{Void},Ptr{Ptr{Void}}),ida_mem,addr) +function __IDAGetNumNonlinSolvIters(ida_mem::IDAMemPtr,nniters::Ptr{Clong}) + ccall((:IDAGetNumNonlinSolvIters,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nniters) +end + +function IDAGetNumNonlinSolvIters(ida_mem,nniters) + __IDAGetNumNonlinSolvIters(convert(IDAMemPtr,ida_mem),pointer(nniters)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas_direct.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function __IDAGetNumNonlinSolvConvFails(ida_mem::IDAMemPtr,nncfails::Ptr{Clong}) + ccall((:IDAGetNumNonlinSolvConvFails,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nncfails) +end -function IDADlsSetDenseJacFn(ida_mem::Ptr{Void},jac::IDADlsDenseJacFn) - ccall((:IDADlsSetDenseJacFn,libsundials_ida),Cint,(Ptr{Void},IDADlsDenseJacFn),ida_mem,jac) +function IDAGetNumNonlinSolvConvFails(ida_mem,nncfails) + __IDAGetNumNonlinSolvConvFails(convert(IDAMemPtr,ida_mem),pointer(nncfails)) end -function IDADlsSetBandJacFn(ida_mem::Ptr{Void},jac::IDADlsBandJacFn) - ccall((:IDADlsSetBandJacFn,libsundials_ida),Cint,(Ptr{Void},IDADlsBandJacFn),ida_mem,jac) +function __IDAGetNonlinSolvStats(ida_mem::IDAMemPtr,nniters::Ptr{Clong},nncfails::Ptr{Clong}) + ccall((:IDAGetNonlinSolvStats,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,nniters,nncfails) end -function IDADlsGetWorkSpace(ida_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:IDADlsGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrwLS,leniwLS) +function IDAGetNonlinSolvStats(ida_mem,nniters,nncfails) + __IDAGetNonlinSolvStats(convert(IDAMemPtr,ida_mem),pointer(nniters),pointer(nncfails)) end -function IDADlsGetNumJacEvals(ida_mem::Ptr{Void},njevals::Ptr{Clong}) - ccall((:IDADlsGetNumJacEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,njevals) +function __IDAGetQuad(ida_mem::IDAMemPtr,t::Ptr{realtype},yQout::N_Vector) + ccall((:IDAGetQuad,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype},N_Vector),ida_mem,t,yQout) end -function IDADlsGetNumResEvals(ida_mem::Ptr{Void},nfevalsLS::Ptr{Clong}) - ccall((:IDADlsGetNumResEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nfevalsLS) +function IDAGetQuad(ida_mem,t,yQout) + __yQout = convert(NVector,yQout) + __IDAGetQuad(convert(IDAMemPtr,ida_mem),pointer(t),convert(N_Vector,__yQout)) end -function IDADlsGetLastFlag(ida_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:IDADlsGetLastFlag,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,flag) +function __IDAGetQuadDky(ida_mem::IDAMemPtr,t::realtype,k::Cint,dky::N_Vector) + ccall((:IDAGetQuadDky,libsundials_idas),Cint,(IDAMemPtr,realtype,Cint,N_Vector),ida_mem,t,k,dky) end -function IDADlsGetReturnFlagName(flag::Int) - ccall((:IDADlsGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) +function IDAGetQuadDky(ida_mem,t,k,dky) + __dky = convert(NVector,dky) + __IDAGetQuadDky(convert(IDAMemPtr,ida_mem),t,convert(Cint,k),convert(N_Vector,__dky)) end -function IDADlsSetDenseJacFnB(ida_mem::Ptr{Void},which::Int,jacB::IDADlsDenseJacFnB) - ccall((:IDADlsSetDenseJacFnB,libsundials_ida),Cint,(Ptr{Void},Cint,IDADlsDenseJacFnB),ida_mem,which,jacB) +function __IDAGetQuadNumRhsEvals(ida_mem::IDAMemPtr,nrhsQevals::Ptr{Clong}) + ccall((:IDAGetQuadNumRhsEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nrhsQevals) end -function IDADlsSetBandJacFnB(idaa_mem::Ptr{Void},which::Int,jacB::IDADlsBandJacFnB) - ccall((:IDADlsSetBandJacFnB,libsundials_ida),Cint,(Ptr{Void},Cint,IDADlsBandJacFnB),idaa_mem,which,jacB) +function IDAGetQuadNumRhsEvals(ida_mem,nrhsQevals) + __IDAGetQuadNumRhsEvals(convert(IDAMemPtr,ida_mem),pointer(nrhsQevals)) +end + +function __IDAGetQuadNumErrTestFails(ida_mem::IDAMemPtr,nQetfails::Ptr{Clong}) + ccall((:IDAGetQuadNumErrTestFails,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nQetfails) +end + +function IDAGetQuadNumErrTestFails(ida_mem,nQetfails) + __IDAGetQuadNumErrTestFails(convert(IDAMemPtr,ida_mem),pointer(nQetfails)) +end + +function __IDAGetQuadErrWeights(ida_mem::IDAMemPtr,eQweight::N_Vector) + ccall((:IDAGetQuadErrWeights,libsundials_idas),Cint,(IDAMemPtr,N_Vector),ida_mem,eQweight) +end + +function IDAGetQuadErrWeights(ida_mem,eQweight) + __eQweight = convert(NVector,eQweight) + __IDAGetQuadErrWeights(convert(IDAMemPtr,ida_mem),convert(N_Vector,__eQweight)) +end + +function __IDAGetQuadStats(ida_mem::IDAMemPtr,nrhsQevals::Ptr{Clong},nQetfails::Ptr{Clong}) + ccall((:IDAGetQuadStats,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,nrhsQevals,nQetfails) +end + +function IDAGetQuadStats(ida_mem,nrhsQevals,nQetfails) + __IDAGetQuadStats(convert(IDAMemPtr,ida_mem),pointer(nrhsQevals),pointer(nQetfails)) +end + +function __IDAGetSens(ida_mem::IDAMemPtr,tret::Ptr{realtype},yySout::Ptr{N_Vector}) + ccall((:IDAGetSens,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype},Ptr{N_Vector}),ida_mem,tret,yySout) +end + +function IDAGetSens(ida_mem,tret,yySout) + __IDAGetSens(convert(IDAMemPtr,ida_mem),pointer(tret),pointer(yySout)) +end + +function __IDAGetSens1(ida_mem::IDAMemPtr,tret::Ptr{realtype},is::Cint,yySret::N_Vector) + ccall((:IDAGetSens1,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype},Cint,N_Vector),ida_mem,tret,is,yySret) +end + +function IDAGetSens1(ida_mem,tret,is,yySret) + __yySret = convert(NVector,yySret) + __IDAGetSens1(convert(IDAMemPtr,ida_mem),pointer(tret),convert(Cint,is),convert(N_Vector,__yySret)) +end + +function __IDAGetSensDky(ida_mem::IDAMemPtr,t::realtype,k::Cint,dkyS::Ptr{N_Vector}) + ccall((:IDAGetSensDky,libsundials_idas),Cint,(IDAMemPtr,realtype,Cint,Ptr{N_Vector}),ida_mem,t,k,dkyS) +end + +function IDAGetSensDky(ida_mem,t,k,dkyS) + __IDAGetSensDky(convert(IDAMemPtr,ida_mem),t,convert(Cint,k),pointer(dkyS)) +end + +function __IDAGetSensDky1(ida_mem::IDAMemPtr,t::realtype,k::Cint,is::Cint,dkyS::N_Vector) + ccall((:IDAGetSensDky1,libsundials_idas),Cint,(IDAMemPtr,realtype,Cint,Cint,N_Vector),ida_mem,t,k,is,dkyS) +end + +function IDAGetSensDky1(ida_mem,t,k,is,dkyS) + __dkyS = convert(NVector,dkyS) + __IDAGetSensDky1(convert(IDAMemPtr,ida_mem),t,convert(Cint,k),convert(Cint,is),convert(N_Vector,__dkyS)) +end + +function __IDAGetSensConsistentIC(ida_mem::IDAMemPtr,yyS0::Ptr{N_Vector},ypS0::Ptr{N_Vector}) + ccall((:IDAGetSensConsistentIC,libsundials_idas),Cint,(IDAMemPtr,Ptr{N_Vector},Ptr{N_Vector}),ida_mem,yyS0,ypS0) +end + +function IDAGetSensConsistentIC(ida_mem,yyS0,ypS0) + __IDAGetSensConsistentIC(convert(IDAMemPtr,ida_mem),pointer(yyS0),pointer(ypS0)) +end + +function __IDAGetSensNumResEvals(ida_mem::IDAMemPtr,nresSevals::Ptr{Clong}) + ccall((:IDAGetSensNumResEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nresSevals) +end + +function IDAGetSensNumResEvals(ida_mem,nresSevals) + __IDAGetSensNumResEvals(convert(IDAMemPtr,ida_mem),pointer(nresSevals)) +end + +function __IDAGetNumResEvalsSens(ida_mem::IDAMemPtr,nresevalsS::Ptr{Clong}) + ccall((:IDAGetNumResEvalsSens,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nresevalsS) +end + +function IDAGetNumResEvalsSens(ida_mem,nresevalsS) + __IDAGetNumResEvalsSens(convert(IDAMemPtr,ida_mem),pointer(nresevalsS)) +end + +function __IDAGetSensNumErrTestFails(ida_mem::IDAMemPtr,nSetfails::Ptr{Clong}) + ccall((:IDAGetSensNumErrTestFails,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nSetfails) +end + +function IDAGetSensNumErrTestFails(ida_mem,nSetfails) + __IDAGetSensNumErrTestFails(convert(IDAMemPtr,ida_mem),pointer(nSetfails)) +end + +function __IDAGetSensNumLinSolvSetups(ida_mem::IDAMemPtr,nlinsetupsS::Ptr{Clong}) + ccall((:IDAGetSensNumLinSolvSetups,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nlinsetupsS) +end + +function IDAGetSensNumLinSolvSetups(ida_mem,nlinsetupsS) + __IDAGetSensNumLinSolvSetups(convert(IDAMemPtr,ida_mem),pointer(nlinsetupsS)) +end + +function __IDAGetSensErrWeights(ida_mem::IDAMemPtr,eSweight::N_Vector_S) + ccall((:IDAGetSensErrWeights,libsundials_idas),Cint,(IDAMemPtr,N_Vector_S),ida_mem,eSweight) +end + +function IDAGetSensErrWeights(ida_mem,eSweight) + __IDAGetSensErrWeights(convert(IDAMemPtr,ida_mem),eSweight) +end + +function __IDAGetSensStats(ida_mem::IDAMemPtr,nresSevals::Ptr{Clong},nresevalsS::Ptr{Clong},nSetfails::Ptr{Clong},nlinsetupsS::Ptr{Clong}) + ccall((:IDAGetSensStats,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong},Ptr{Clong},Ptr{Clong}),ida_mem,nresSevals,nresevalsS,nSetfails,nlinsetupsS) +end + +function IDAGetSensStats(ida_mem,nresSevals,nresevalsS,nSetfails,nlinsetupsS) + __IDAGetSensStats(convert(IDAMemPtr,ida_mem),pointer(nresSevals),pointer(nresevalsS),pointer(nSetfails),pointer(nlinsetupsS)) +end + +function __IDAGetSensNumNonlinSolvIters(ida_mem::IDAMemPtr,nSniters::Ptr{Clong}) + ccall((:IDAGetSensNumNonlinSolvIters,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nSniters) +end + +function IDAGetSensNumNonlinSolvIters(ida_mem,nSniters) + __IDAGetSensNumNonlinSolvIters(convert(IDAMemPtr,ida_mem),pointer(nSniters)) +end + +function __IDAGetSensNumNonlinSolvConvFails(ida_mem::IDAMemPtr,nSncfails::Ptr{Clong}) + ccall((:IDAGetSensNumNonlinSolvConvFails,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nSncfails) +end + +function IDAGetSensNumNonlinSolvConvFails(ida_mem,nSncfails) + __IDAGetSensNumNonlinSolvConvFails(convert(IDAMemPtr,ida_mem),pointer(nSncfails)) +end + +function __IDAGetSensNonlinSolvStats(ida_mem::IDAMemPtr,nSniters::Ptr{Clong},nSncfails::Ptr{Clong}) + ccall((:IDAGetSensNonlinSolvStats,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,nSniters,nSncfails) +end + +function IDAGetSensNonlinSolvStats(ida_mem,nSniters,nSncfails) + __IDAGetSensNonlinSolvStats(convert(IDAMemPtr,ida_mem),pointer(nSniters),pointer(nSncfails)) +end + +function __IDAGetQuadSensNumRhsEvals(ida_mem::IDAMemPtr,nrhsQSevals::Ptr{Clong}) + ccall((:IDAGetQuadSensNumRhsEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nrhsQSevals) +end + +function IDAGetQuadSensNumRhsEvals(ida_mem,nrhsQSevals) + __IDAGetQuadSensNumRhsEvals(convert(IDAMemPtr,ida_mem),pointer(nrhsQSevals)) +end + +function __IDAGetQuadSensNumErrTestFails(ida_mem::IDAMemPtr,nQSetfails::Ptr{Clong}) + ccall((:IDAGetQuadSensNumErrTestFails,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nQSetfails) +end + +function IDAGetQuadSensNumErrTestFails(ida_mem,nQSetfails) + __IDAGetQuadSensNumErrTestFails(convert(IDAMemPtr,ida_mem),pointer(nQSetfails)) +end + +function __IDAGetQuadSensErrWeights(ida_mem::IDAMemPtr,eQSweight::Ptr{N_Vector}) + ccall((:IDAGetQuadSensErrWeights,libsundials_idas),Cint,(IDAMemPtr,Ptr{N_Vector}),ida_mem,eQSweight) +end + +function IDAGetQuadSensErrWeights(ida_mem,eQSweight) + __IDAGetQuadSensErrWeights(convert(IDAMemPtr,ida_mem),pointer(eQSweight)) +end + +function __IDAGetQuadSensStats(ida_mem::IDAMemPtr,nrhsQSevals::Ptr{Clong},nQSetfails::Ptr{Clong}) + ccall((:IDAGetQuadSensStats,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,nrhsQSevals,nQSetfails) +end + +function IDAGetQuadSensStats(ida_mem,nrhsQSevals,nQSetfails) + __IDAGetQuadSensStats(convert(IDAMemPtr,ida_mem),pointer(nrhsQSevals),pointer(nQSetfails)) +end + +function __IDAGetQuadSens(ida_mem::IDAMemPtr,tret::Ptr{realtype},yyQSout::Ptr{N_Vector}) + ccall((:IDAGetQuadSens,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype},Ptr{N_Vector}),ida_mem,tret,yyQSout) +end + +function IDAGetQuadSens(ida_mem,tret,yyQSout) + __IDAGetQuadSens(convert(IDAMemPtr,ida_mem),pointer(tret),pointer(yyQSout)) +end + +function __IDAGetQuadSens1(ida_mem::IDAMemPtr,tret::Ptr{realtype},is::Cint,yyQSret::N_Vector) + ccall((:IDAGetQuadSens1,libsundials_idas),Cint,(IDAMemPtr,Ptr{realtype},Cint,N_Vector),ida_mem,tret,is,yyQSret) +end + +function IDAGetQuadSens1(ida_mem,tret,is,yyQSret) + __yyQSret = convert(NVector,yyQSret) + __IDAGetQuadSens1(convert(IDAMemPtr,ida_mem),pointer(tret),convert(Cint,is),convert(N_Vector,__yyQSret)) +end + +function __IDAGetQuadSensDky(ida_mem::IDAMemPtr,t::realtype,k::Cint,dkyQS::Ptr{N_Vector}) + ccall((:IDAGetQuadSensDky,libsundials_idas),Cint,(IDAMemPtr,realtype,Cint,Ptr{N_Vector}),ida_mem,t,k,dkyQS) +end + +function IDAGetQuadSensDky(ida_mem,t,k,dkyQS) + __IDAGetQuadSensDky(convert(IDAMemPtr,ida_mem),t,convert(Cint,k),pointer(dkyQS)) +end + +function __IDAGetQuadSensDky1(ida_mem::IDAMemPtr,t::realtype,k::Cint,is::Cint,dkyQS::N_Vector) + ccall((:IDAGetQuadSensDky1,libsundials_idas),Cint,(IDAMemPtr,realtype,Cint,Cint,N_Vector),ida_mem,t,k,is,dkyQS) +end + +function IDAGetQuadSensDky1(ida_mem,t,k,is,dkyQS) + __dkyQS = convert(NVector,dkyQS) + __IDAGetQuadSensDky1(convert(IDAMemPtr,ida_mem),t,convert(Cint,k),convert(Cint,is),convert(N_Vector,__dkyQS)) +end + +function __IDAGetReturnFlagName(flag::Clong) + ccall((:IDAGetReturnFlagName,libsundials_idas),Ptr{UInt8},(Clong,),flag) +end + +function IDAGetReturnFlagName(flag) + __IDAGetReturnFlagName(convert(Clong,flag)) +end + +function IDAFree(ida_mem::Ref{IDAMemPtr}) + ccall((:IDAFree,libsundials_idas),Void,(Ref{IDAMemPtr},),ida_mem) +end + +function __IDAQuadFree(ida_mem::IDAMemPtr) + ccall((:IDAQuadFree,libsundials_idas),Void,(IDAMemPtr,),ida_mem) +end + +function IDAQuadFree(ida_mem) + __IDAQuadFree(convert(IDAMemPtr,ida_mem)) +end + +function __IDASensFree(ida_mem::IDAMemPtr) + ccall((:IDASensFree,libsundials_idas),Void,(IDAMemPtr,),ida_mem) +end + +function IDASensFree(ida_mem) + __IDASensFree(convert(IDAMemPtr,ida_mem)) +end + +function __IDAQuadSensFree(ida_mem::IDAMemPtr) + ccall((:IDAQuadSensFree,libsundials_idas),Void,(IDAMemPtr,),ida_mem) +end + +function IDAQuadSensFree(ida_mem) + __IDAQuadSensFree(convert(IDAMemPtr,ida_mem)) +end + +function __IDAAdjInit(ida_mem::IDAMemPtr,steps::Clong,interp::Cint) + ccall((:IDAAdjInit,libsundials_idas),Cint,(IDAMemPtr,Clong,Cint),ida_mem,steps,interp) +end + +function IDAAdjInit(ida_mem,steps,interp) + __IDAAdjInit(convert(IDAMemPtr,ida_mem),convert(Clong,steps),convert(Cint,interp)) +end + +function __IDAAdjReInit(ida_mem::IDAMemPtr) + ccall((:IDAAdjReInit,libsundials_idas),Cint,(IDAMemPtr,),ida_mem) +end + +function IDAAdjReInit(ida_mem) + __IDAAdjReInit(convert(IDAMemPtr,ida_mem)) +end + +function __IDAAdjFree(ida_mem::IDAMemPtr) + ccall((:IDAAdjFree,libsundials_idas),Void,(IDAMemPtr,),ida_mem) +end + +function IDAAdjFree(ida_mem) + __IDAAdjFree(convert(IDAMemPtr,ida_mem)) +end + +function __IDACreateB(ida_mem::IDAMemPtr,which::Ptr{Cint}) + ccall((:IDACreateB,libsundials_idas),Cint,(IDAMemPtr,Ptr{Cint}),ida_mem,which) +end + +function IDACreateB(ida_mem,which) + __IDACreateB(convert(IDAMemPtr,ida_mem),pointer(which)) +end + +function __IDAInitB(ida_mem::IDAMemPtr,which::Cint,resB::IDAResFnB,tB0::realtype,yyB0::N_Vector,ypB0::N_Vector) + ccall((:IDAInitB,libsundials_idas),Cint,(IDAMemPtr,Cint,IDAResFnB,realtype,N_Vector,N_Vector),ida_mem,which,resB,tB0,yyB0,ypB0) +end + +function IDAInitB(ida_mem,which,resB,tB0,yyB0,ypB0) + __yyB0 = convert(NVector,yyB0) + __ypB0 = convert(NVector,ypB0) + __IDAInitB(convert(IDAMemPtr,ida_mem),convert(Cint,which),resB,tB0,convert(N_Vector,__yyB0),convert(N_Vector,__ypB0)) +end + +function __IDAInitBS(ida_mem::IDAMemPtr,which::Cint,resS::IDAResFnBS,tB0::realtype,yyB0::N_Vector,ypB0::N_Vector) + ccall((:IDAInitBS,libsundials_idas),Cint,(IDAMemPtr,Cint,IDAResFnBS,realtype,N_Vector,N_Vector),ida_mem,which,resS,tB0,yyB0,ypB0) +end + +function IDAInitBS(ida_mem,which,resS,tB0,yyB0,ypB0) + __yyB0 = convert(NVector,yyB0) + __ypB0 = convert(NVector,ypB0) + __IDAInitBS(convert(IDAMemPtr,ida_mem),convert(Cint,which),resS,tB0,convert(N_Vector,__yyB0),convert(N_Vector,__ypB0)) +end + +function __IDAReInitB(ida_mem::IDAMemPtr,which::Cint,tB0::realtype,yyB0::N_Vector,ypB0::N_Vector) + ccall((:IDAReInitB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype,N_Vector,N_Vector),ida_mem,which,tB0,yyB0,ypB0) +end + +function IDAReInitB(ida_mem,which,tB0,yyB0,ypB0) + __yyB0 = convert(NVector,yyB0) + __ypB0 = convert(NVector,ypB0) + __IDAReInitB(convert(IDAMemPtr,ida_mem),convert(Cint,which),tB0,convert(N_Vector,__yyB0),convert(N_Vector,__ypB0)) +end + +function __IDASStolerancesB(ida_mem::IDAMemPtr,which::Cint,relTolB::realtype,absTolB::realtype) + ccall((:IDASStolerancesB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype,realtype),ida_mem,which,relTolB,absTolB) +end + +function IDASStolerancesB(ida_mem,which,relTolB,absTolB) + __IDASStolerancesB(convert(IDAMemPtr,ida_mem),convert(Cint,which),relTolB,absTolB) +end + +function __IDASVtolerancesB(ida_mem::IDAMemPtr,which::Cint,relTolB::realtype,absTolB::N_Vector) + ccall((:IDASVtolerancesB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype,N_Vector),ida_mem,which,relTolB,absTolB) +end + +function IDASVtolerancesB(ida_mem,which,relTolB,absTolB) + __absTolB = convert(NVector,absTolB) + __IDASVtolerancesB(convert(IDAMemPtr,ida_mem),convert(Cint,which),relTolB,convert(N_Vector,__absTolB)) +end + +function __IDAQuadInitB(ida_mem::IDAMemPtr,which::Cint,rhsQB::IDAQuadRhsFnB,yQB0::N_Vector) + ccall((:IDAQuadInitB,libsundials_idas),Cint,(IDAMemPtr,Cint,IDAQuadRhsFnB,N_Vector),ida_mem,which,rhsQB,yQB0) +end + +function IDAQuadInitB(ida_mem,which,rhsQB,yQB0) + __yQB0 = convert(NVector,yQB0) + __IDAQuadInitB(convert(IDAMemPtr,ida_mem),convert(Cint,which),rhsQB,convert(N_Vector,__yQB0)) +end + +function __IDAQuadInitBS(ida_mem::IDAMemPtr,which::Cint,rhsQS::IDAQuadRhsFnBS,yQB0::N_Vector) + ccall((:IDAQuadInitBS,libsundials_idas),Cint,(IDAMemPtr,Cint,IDAQuadRhsFnBS,N_Vector),ida_mem,which,rhsQS,yQB0) +end + +function IDAQuadInitBS(ida_mem,which,rhsQS,yQB0) + __yQB0 = convert(NVector,yQB0) + __IDAQuadInitBS(convert(IDAMemPtr,ida_mem),convert(Cint,which),rhsQS,convert(N_Vector,__yQB0)) +end + +function __IDAQuadReInitB(ida_mem::IDAMemPtr,which::Cint,yQB0::N_Vector) + ccall((:IDAQuadReInitB,libsundials_idas),Cint,(IDAMemPtr,Cint,N_Vector),ida_mem,which,yQB0) +end + +function IDAQuadReInitB(ida_mem,which,yQB0) + __yQB0 = convert(NVector,yQB0) + __IDAQuadReInitB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(N_Vector,__yQB0)) +end + +function __IDAQuadSStolerancesB(ida_mem::IDAMemPtr,which::Cint,reltolQB::realtype,abstolQB::realtype) + ccall((:IDAQuadSStolerancesB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype,realtype),ida_mem,which,reltolQB,abstolQB) +end + +function IDAQuadSStolerancesB(ida_mem,which,reltolQB,abstolQB) + __IDAQuadSStolerancesB(convert(IDAMemPtr,ida_mem),convert(Cint,which),reltolQB,abstolQB) +end + +function __IDAQuadSVtolerancesB(ida_mem::IDAMemPtr,which::Cint,reltolQB::realtype,abstolQB::N_Vector) + ccall((:IDAQuadSVtolerancesB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype,N_Vector),ida_mem,which,reltolQB,abstolQB) +end + +function IDAQuadSVtolerancesB(ida_mem,which,reltolQB,abstolQB) + __abstolQB = convert(NVector,abstolQB) + __IDAQuadSVtolerancesB(convert(IDAMemPtr,ida_mem),convert(Cint,which),reltolQB,convert(N_Vector,__abstolQB)) +end + +function __IDACalcICB(ida_mem::IDAMemPtr,which::Cint,tout1::realtype,yy0::N_Vector,yp0::N_Vector) + ccall((:IDACalcICB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype,N_Vector,N_Vector),ida_mem,which,tout1,yy0,yp0) +end + +function IDACalcICB(ida_mem,which,tout1,yy0,yp0) + __yy0 = convert(NVector,yy0) + __yp0 = convert(NVector,yp0) + __IDACalcICB(convert(IDAMemPtr,ida_mem),convert(Cint,which),tout1,convert(N_Vector,__yy0),convert(N_Vector,__yp0)) +end + +function __IDACalcICBS(ida_mem::IDAMemPtr,which::Cint,tout1::realtype,yy0::N_Vector,yp0::N_Vector,yyS0::Ptr{N_Vector},ypS0::Ptr{N_Vector}) + ccall((:IDACalcICBS,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype,N_Vector,N_Vector,Ptr{N_Vector},Ptr{N_Vector}),ida_mem,which,tout1,yy0,yp0,yyS0,ypS0) +end + +function IDACalcICBS(ida_mem,which,tout1,yy0,yp0,yyS0,ypS0) + __yy0 = convert(NVector,yy0) + __yp0 = convert(NVector,yp0) + __IDACalcICBS(convert(IDAMemPtr,ida_mem),convert(Cint,which),tout1,convert(N_Vector,__yy0),convert(N_Vector,__yp0),pointer(yyS0),pointer(ypS0)) +end + +function __IDASolveF(ida_mem::IDAMemPtr,tout::realtype,tret::Ptr{realtype},yret::N_Vector,ypret::N_Vector,itask::Cint,ncheckPtr::Ptr{Cint}) + ccall((:IDASolveF,libsundials_idas),Cint,(IDAMemPtr,realtype,Ptr{realtype},N_Vector,N_Vector,Cint,Ptr{Cint}),ida_mem,tout,tret,yret,ypret,itask,ncheckPtr) +end + +function IDASolveF(ida_mem,tout,tret,yret,ypret,itask,ncheckPtr) + __yret = convert(NVector,yret) + __ypret = convert(NVector,ypret) + __IDASolveF(convert(IDAMemPtr,ida_mem),tout,pointer(tret),convert(N_Vector,__yret),convert(N_Vector,__ypret),convert(Cint,itask),pointer(ncheckPtr)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas_spils.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDASpilsSetPreconditioner(ida_mem::Ptr{Void},pset::IDASpilsPrecSetupFn,psolve::IDASpilsPrecSolveFn) - ccall((:IDASpilsSetPreconditioner,libsundials_ida),Cint,(Ptr{Void},IDASpilsPrecSetupFn,IDASpilsPrecSolveFn),ida_mem,pset,psolve) +function __IDASolveB(ida_mem::IDAMemPtr,tBout::realtype,itaskB::Cint) + ccall((:IDASolveB,libsundials_idas),Cint,(IDAMemPtr,realtype,Cint),ida_mem,tBout,itaskB) end -function IDASpilsSetJacTimesVecFn(ida_mem::Ptr{Void},jtv::IDASpilsJacTimesVecFn) - ccall((:IDASpilsSetJacTimesVecFn,libsundials_ida),Cint,(Ptr{Void},IDASpilsJacTimesVecFn),ida_mem,jtv) +function IDASolveB(ida_mem,tBout,itaskB) + __IDASolveB(convert(IDAMemPtr,ida_mem),tBout,convert(Cint,itaskB)) end -function IDASpilsSetGSType(ida_mem::Ptr{Void},gstype::Int) - ccall((:IDASpilsSetGSType,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,gstype) +function __IDASetAdjNoSensi(ida_mem::IDAMemPtr) + ccall((:IDASetAdjNoSensi,libsundials_idas),Cint,(IDAMemPtr,),ida_mem) end -function IDASpilsSetMaxRestarts(ida_mem::Ptr{Void},maxrs::Int) - ccall((:IDASpilsSetMaxRestarts,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxrs) +function IDASetAdjNoSensi(ida_mem) + __IDASetAdjNoSensi(convert(IDAMemPtr,ida_mem)) end -function IDASpilsSetMaxl(ida_mem::Ptr{Void},maxl::Int) - ccall((:IDASpilsSetMaxl,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxl) +function __IDASetUserDataB(ida_mem::IDAMemPtr,which::Cint,user_dataB::Any) + ccall((:IDASetUserDataB,libsundials_idas),Cint,(IDAMemPtr,Cint,Any),ida_mem,which,user_dataB) end -function IDASpilsSetEpsLin(ida_mem::Ptr{Void},eplifac::realtype) - ccall((:IDASpilsSetEpsLin,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,eplifac) +function IDASetUserDataB(ida_mem,which,user_dataB) + __IDASetUserDataB(convert(IDAMemPtr,ida_mem),convert(Cint,which),user_dataB) end -function IDASpilsSetIncrementFactor(ida_mem::Ptr{Void},dqincfac::realtype) - ccall((:IDASpilsSetIncrementFactor,libsundials_ida),Cint,(Ptr{Void},realtype),ida_mem,dqincfac) +function __IDASetMaxOrdB(ida_mem::IDAMemPtr,which::Cint,maxordB::Cint) + ccall((:IDASetMaxOrdB,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint),ida_mem,which,maxordB) end -function IDASpilsGetWorkSpace(ida_mem::Ptr{Void},lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) - ccall((:IDASpilsGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrwLS,leniwLS) +function IDASetMaxOrdB(ida_mem,which,maxordB) + __IDASetMaxOrdB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Cint,maxordB)) end -function IDASpilsGetNumPrecEvals(ida_mem::Ptr{Void},npevals::Ptr{Clong}) - ccall((:IDASpilsGetNumPrecEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,npevals) +function __IDASetMaxNumStepsB(ida_mem::IDAMemPtr,which::Cint,mxstepsB::Clong) + ccall((:IDASetMaxNumStepsB,libsundials_idas),Cint,(IDAMemPtr,Cint,Clong),ida_mem,which,mxstepsB) end -function IDASpilsGetNumPrecSolves(ida_mem::Ptr{Void},npsolves::Ptr{Clong}) - ccall((:IDASpilsGetNumPrecSolves,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,npsolves) +function IDASetMaxNumStepsB(ida_mem,which,mxstepsB) + __IDASetMaxNumStepsB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Clong,mxstepsB)) end -function IDASpilsGetNumLinIters(ida_mem::Ptr{Void},nliters::Ptr{Clong}) - ccall((:IDASpilsGetNumLinIters,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nliters) +function __IDASetInitStepB(ida_mem::IDAMemPtr,which::Cint,hinB::realtype) + ccall((:IDASetInitStepB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype),ida_mem,which,hinB) end -function IDASpilsGetNumConvFails(ida_mem::Ptr{Void},nlcfails::Ptr{Clong}) - ccall((:IDASpilsGetNumConvFails,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nlcfails) +function IDASetInitStepB(ida_mem,which,hinB) + __IDASetInitStepB(convert(IDAMemPtr,ida_mem),convert(Cint,which),hinB) end -function IDASpilsGetNumJtimesEvals(ida_mem::Ptr{Void},njvevals::Ptr{Clong}) - ccall((:IDASpilsGetNumJtimesEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,njvevals) +function __IDASetMaxStepB(ida_mem::IDAMemPtr,which::Cint,hmaxB::realtype) + ccall((:IDASetMaxStepB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype),ida_mem,which,hmaxB) end -function IDASpilsGetNumResEvals(ida_mem::Ptr{Void},nrevalsLS::Ptr{Clong}) - ccall((:IDASpilsGetNumResEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,nrevalsLS) +function IDASetMaxStepB(ida_mem,which,hmaxB) + __IDASetMaxStepB(convert(IDAMemPtr,ida_mem),convert(Cint,which),hmaxB) end -function IDASpilsGetLastFlag(ida_mem::Ptr{Void},flag::Ptr{Clong}) - ccall((:IDASpilsGetLastFlag,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,flag) +function __IDASetSuppressAlgB(ida_mem::IDAMemPtr,which::Cint,suppressalgB::Cint) + ccall((:IDASetSuppressAlgB,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint),ida_mem,which,suppressalgB) end -function IDASpilsGetReturnFlagName(flag::Int) - ccall((:IDASpilsGetReturnFlagName,libsundials_ida),Ptr{UInt8},(Clong,),flag) +function IDASetSuppressAlgB(ida_mem,which,suppressalgB) + __IDASetSuppressAlgB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Cint,suppressalgB)) end -function IDASpilsSetGSTypeB(ida_mem::Ptr{Void},which::Int,gstypeB::Int) - ccall((:IDASpilsSetGSTypeB,libsundials_ida),Cint,(Ptr{Void},Cint,Cint),ida_mem,which,gstypeB) +function __IDASetIdB(ida_mem::IDAMemPtr,which::Cint,idB::N_Vector) + ccall((:IDASetIdB,libsundials_idas),Cint,(IDAMemPtr,Cint,N_Vector),ida_mem,which,idB) end -function IDASpilsSetMaxRestartsB(ida_mem::Ptr{Void},which::Int,maxrsB::Int) - ccall((:IDASpilsSetMaxRestartsB,libsundials_ida),Cint,(Ptr{Void},Cint,Cint),ida_mem,which,maxrsB) +function IDASetIdB(ida_mem,which,idB) + __idB = convert(NVector,idB) + __IDASetIdB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(N_Vector,__idB)) end -function IDASpilsSetEpsLinB(ida_mem::Ptr{Void},which::Int,eplifacB::realtype) - ccall((:IDASpilsSetEpsLinB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype),ida_mem,which,eplifacB) +function __IDASetConstraintsB(ida_mem::IDAMemPtr,which::Cint,constraintsB::N_Vector) + ccall((:IDASetConstraintsB,libsundials_idas),Cint,(IDAMemPtr,Cint,N_Vector),ida_mem,which,constraintsB) end -function IDASpilsSetMaxlB(ida_mem::Ptr{Void},which::Int,maxlB::Int) - ccall((:IDASpilsSetMaxlB,libsundials_ida),Cint,(Ptr{Void},Cint,Cint),ida_mem,which,maxlB) +function IDASetConstraintsB(ida_mem,which,constraintsB) + __constraintsB = convert(NVector,constraintsB) + __IDASetConstraintsB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(N_Vector,__constraintsB)) end -function IDASpilsSetIncrementFactorB(ida_mem::Ptr{Void},which::Int,dqincfacB::realtype) - ccall((:IDASpilsSetIncrementFactorB,libsundials_ida),Cint,(Ptr{Void},Cint,realtype),ida_mem,which,dqincfacB) +function __IDASetQuadErrConB(ida_mem::IDAMemPtr,which::Cint,errconQB::Cint) + ccall((:IDASetQuadErrConB,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint),ida_mem,which,errconQB) end -function IDASpilsSetPreconditionerB(ida_mem::Ptr{Void},which::Int,psetB::IDASpilsPrecSetupFnB,psolveB::IDASpilsPrecSolveFnB) - ccall((:IDASpilsSetPreconditionerB,libsundials_ida),Cint,(Ptr{Void},Cint,IDASpilsPrecSetupFnB,IDASpilsPrecSolveFnB),ida_mem,which,psetB,psolveB) +function IDASetQuadErrConB(ida_mem,which,errconQB) + __IDASetQuadErrConB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Cint,errconQB)) end -function IDASpilsSetJacTimesVecFnB(ida_mem::Ptr{Void},which::Int,jtvB::IDASpilsJacTimesVecFnB) - ccall((:IDASpilsSetJacTimesVecFnB,libsundials_ida),Cint,(Ptr{Void},Cint,IDASpilsJacTimesVecFnB),ida_mem,which,jtvB) +function __IDAGetB(ida_mem::IDAMemPtr,which::Cint,tret::Ptr{realtype},yy::N_Vector,yp::N_Vector) + ccall((:IDAGetB,libsundials_idas),Cint,(IDAMemPtr,Cint,Ptr{realtype},N_Vector,N_Vector),ida_mem,which,tret,yy,yp) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas_band.h + +function IDAGetB(ida_mem,which,tret,yy,yp) + __yy = convert(NVector,yy) + __yp = convert(NVector,yp) + __IDAGetB(convert(IDAMemPtr,ida_mem),convert(Cint,which),pointer(tret),convert(N_Vector,__yy),convert(N_Vector,__yp)) +end + +function __IDAGetQuadB(ida_mem::IDAMemPtr,which::Cint,tret::Ptr{realtype},qB::N_Vector) + ccall((:IDAGetQuadB,libsundials_idas),Cint,(IDAMemPtr,Cint,Ptr{realtype},N_Vector),ida_mem,which,tret,qB) +end + +function IDAGetQuadB(ida_mem,which,tret,qB) + __qB = convert(NVector,qB) + __IDAGetQuadB(convert(IDAMemPtr,ida_mem),convert(Cint,which),pointer(tret),convert(N_Vector,__qB)) +end + +function __IDAGetAdjIDABmem(ida_mem::IDAMemPtr,which::Cint) + ccall((:IDAGetAdjIDABmem,libsundials_idas),Ptr{Void},(IDAMemPtr,Cint),ida_mem,which) +end + +function IDAGetAdjIDABmem(ida_mem,which) + __IDAGetAdjIDABmem(convert(IDAMemPtr,ida_mem),convert(Cint,which)) +end + +function __IDAGetConsistentICB(ida_mem::IDAMemPtr,which::Cint,yyB0::N_Vector,ypB0::N_Vector) + ccall((:IDAGetConsistentICB,libsundials_idas),Cint,(IDAMemPtr,Cint,N_Vector,N_Vector),ida_mem,which,yyB0,ypB0) +end + +function IDAGetConsistentICB(ida_mem,which,yyB0,ypB0) + __yyB0 = convert(NVector,yyB0) + __ypB0 = convert(NVector,ypB0) + __IDAGetConsistentICB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(N_Vector,__yyB0),convert(N_Vector,__ypB0)) +end + +function __IDAGetAdjY(ida_mem::IDAMemPtr,t::realtype,yy::N_Vector,yp::N_Vector) + ccall((:IDAGetAdjY,libsundials_idas),Cint,(IDAMemPtr,realtype,N_Vector,N_Vector),ida_mem,t,yy,yp) +end + +function IDAGetAdjY(ida_mem,t,yy,yp) + __yy = convert(NVector,yy) + __yp = convert(NVector,yp) + __IDAGetAdjY(convert(IDAMemPtr,ida_mem),t,convert(N_Vector,__yy),convert(N_Vector,__yp)) +end + +function __IDAGetAdjCheckPointsInfo(ida_mem::IDAMemPtr,ckpnt::Ptr{IDAadjCheckPointRec}) + ccall((:IDAGetAdjCheckPointsInfo,libsundials_idas),Cint,(IDAMemPtr,Ptr{IDAadjCheckPointRec}),ida_mem,ckpnt) +end + +function IDAGetAdjCheckPointsInfo(ida_mem,ckpnt) + __IDAGetAdjCheckPointsInfo(convert(IDAMemPtr,ida_mem),pointer(ckpnt)) +end + +function __IDAGetAdjDataPointHermite(ida_mem::IDAMemPtr,which::Cint,t::Ptr{realtype},yy::N_Vector,yd::N_Vector) + ccall((:IDAGetAdjDataPointHermite,libsundials_idas),Cint,(IDAMemPtr,Cint,Ptr{realtype},N_Vector,N_Vector),ida_mem,which,t,yy,yd) +end + +function IDAGetAdjDataPointHermite(ida_mem,which,t,yy,yd) + __yy = convert(NVector,yy) + __yd = convert(NVector,yd) + __IDAGetAdjDataPointHermite(convert(IDAMemPtr,ida_mem),convert(Cint,which),pointer(t),convert(N_Vector,__yy),convert(N_Vector,__yd)) +end + +function __IDAGetAdjDataPointPolynomial(ida_mem::IDAMemPtr,which::Cint,t::Ptr{realtype},order::Ptr{Cint},y::N_Vector) + ccall((:IDAGetAdjDataPointPolynomial,libsundials_idas),Cint,(IDAMemPtr,Cint,Ptr{realtype},Ptr{Cint},N_Vector),ida_mem,which,t,order,y) +end + +function IDAGetAdjDataPointPolynomial(ida_mem,which,t,order,y) + __y = convert(NVector,y) + __IDAGetAdjDataPointPolynomial(convert(IDAMemPtr,ida_mem),convert(Cint,which),pointer(t),pointer(order),convert(N_Vector,__y)) +end + +function __IDAGetAdjCurrentCheckPoint(ida_mem::IDAMemPtr,addr::Ptr{Ptr{Void}}) + ccall((:IDAGetAdjCurrentCheckPoint,libsundials_idas),Cint,(IDAMemPtr,Ptr{Ptr{Void}}),ida_mem,addr) +end + +function IDAGetAdjCurrentCheckPoint(ida_mem,addr) + __IDAGetAdjCurrentCheckPoint(convert(IDAMemPtr,ida_mem),pointer(addr)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas_direct.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDABand(ida_mem::Ptr{Void},Neq::Int,mupper::Int,mlower::Int) - ccall((:IDABand,libsundials_ida),Cint,(Ptr{Void},Clong,Clong,Clong),ida_mem,Neq,mupper,mlower) + +function __IDADlsSetDenseJacFn(ida_mem::IDAMemPtr,jac::IDADlsDenseJacFn) + ccall((:IDADlsSetDenseJacFn,libsundials_idas),Cint,(IDAMemPtr,IDADlsDenseJacFn),ida_mem,jac) +end + +function IDADlsSetDenseJacFn(ida_mem,jac) + __IDADlsSetDenseJacFn(convert(IDAMemPtr,ida_mem),jac) +end + +function __IDADlsSetBandJacFn(ida_mem::IDAMemPtr,jac::IDADlsBandJacFn) + ccall((:IDADlsSetBandJacFn,libsundials_idas),Cint,(IDAMemPtr,IDADlsBandJacFn),ida_mem,jac) +end + +function IDADlsSetBandJacFn(ida_mem,jac) + __IDADlsSetBandJacFn(convert(IDAMemPtr,ida_mem),jac) +end + +function __IDADlsGetWorkSpace(ida_mem::IDAMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:IDADlsGetWorkSpace,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,lenrwLS,leniwLS) +end + +function IDADlsGetWorkSpace(ida_mem,lenrwLS,leniwLS) + __IDADlsGetWorkSpace(convert(IDAMemPtr,ida_mem),pointer(lenrwLS),pointer(leniwLS)) +end + +function __IDADlsGetNumJacEvals(ida_mem::IDAMemPtr,njevals::Ptr{Clong}) + ccall((:IDADlsGetNumJacEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,njevals) +end + +function IDADlsGetNumJacEvals(ida_mem,njevals) + __IDADlsGetNumJacEvals(convert(IDAMemPtr,ida_mem),pointer(njevals)) +end + +function __IDADlsGetNumResEvals(ida_mem::IDAMemPtr,nfevalsLS::Ptr{Clong}) + ccall((:IDADlsGetNumResEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nfevalsLS) +end + +function IDADlsGetNumResEvals(ida_mem,nfevalsLS) + __IDADlsGetNumResEvals(convert(IDAMemPtr,ida_mem),pointer(nfevalsLS)) +end + +function __IDADlsGetLastFlag(ida_mem::IDAMemPtr,flag::Ptr{Clong}) + ccall((:IDADlsGetLastFlag,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,flag) +end + +function IDADlsGetLastFlag(ida_mem,flag) + __IDADlsGetLastFlag(convert(IDAMemPtr,ida_mem),pointer(flag)) +end + +function __IDADlsGetReturnFlagName(flag::Clong) + ccall((:IDADlsGetReturnFlagName,libsundials_idas),Ptr{UInt8},(Clong,),flag) +end + +function IDADlsGetReturnFlagName(flag) + __IDADlsGetReturnFlagName(convert(Clong,flag)) +end + +function __IDADlsSetDenseJacFnB(ida_mem::IDAMemPtr,which::Cint,jacB::IDADlsDenseJacFnB) + ccall((:IDADlsSetDenseJacFnB,libsundials_idas),Cint,(IDAMemPtr,Cint,IDADlsDenseJacFnB),ida_mem,which,jacB) +end + +function IDADlsSetDenseJacFnB(ida_mem,which,jacB) + __IDADlsSetDenseJacFnB(convert(IDAMemPtr,ida_mem),convert(Cint,which),jacB) +end + +function __IDADlsSetBandJacFnB(idaa_mem::IDAMemPtr,which::Cint,jacB::IDADlsBandJacFnB) + ccall((:IDADlsSetBandJacFnB,libsundials_idas),Cint,(IDAMemPtr,Cint,IDADlsBandJacFnB),idaa_mem,which,jacB) end -function IDABandB(idaadj_mem::Ptr{Void},which::Int,NeqB::Int,mupperB::Int,mlowerB::Int) - ccall((:IDABandB,libsundials_ida),Cint,(Ptr{Void},Cint,Clong,Clong,Clong),idaadj_mem,which,NeqB,mupperB,mlowerB) +function IDADlsSetBandJacFnB(idaa_mem,which,jacB) + __IDADlsSetBandJacFnB(convert(IDAMemPtr,idaa_mem),convert(Cint,which),jacB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas_bbdpre.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas_spils.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDABBDPrecInit(ida_mem::Ptr{Void},Nlocal::Int,mudq::Int,mldq::Int,mukeep::Int,mlkeep::Int,dq_rel_yy::realtype,Gres::IDABBDLocalFn,Gcomm::IDABBDCommFn) - ccall((:IDABBDPrecInit,libsundials_ida),Cint,(Ptr{Void},Clong,Clong,Clong,Clong,Clong,realtype,IDABBDLocalFn,IDABBDCommFn),ida_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dq_rel_yy,Gres,Gcomm) +function __IDASpilsSetPreconditioner(ida_mem::IDAMemPtr,pset::IDASpilsPrecSetupFn,psolve::IDASpilsPrecSolveFn) + ccall((:IDASpilsSetPreconditioner,libsundials_idas),Cint,(IDAMemPtr,IDASpilsPrecSetupFn,IDASpilsPrecSolveFn),ida_mem,pset,psolve) +end + +function IDASpilsSetPreconditioner(ida_mem,pset,psolve) + __IDASpilsSetPreconditioner(convert(IDAMemPtr,ida_mem),pset,psolve) +end + +function __IDASpilsSetJacTimesVecFn(ida_mem::IDAMemPtr,jtv::IDASpilsJacTimesVecFn) + ccall((:IDASpilsSetJacTimesVecFn,libsundials_idas),Cint,(IDAMemPtr,IDASpilsJacTimesVecFn),ida_mem,jtv) +end + +function IDASpilsSetJacTimesVecFn(ida_mem,jtv) + __IDASpilsSetJacTimesVecFn(convert(IDAMemPtr,ida_mem),jtv) +end + +function __IDASpilsSetGSType(ida_mem::IDAMemPtr,gstype::Cint) + ccall((:IDASpilsSetGSType,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,gstype) +end + +function IDASpilsSetGSType(ida_mem,gstype) + __IDASpilsSetGSType(convert(IDAMemPtr,ida_mem),convert(Cint,gstype)) +end + +function __IDASpilsSetMaxRestarts(ida_mem::IDAMemPtr,maxrs::Cint) + ccall((:IDASpilsSetMaxRestarts,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxrs) +end + +function IDASpilsSetMaxRestarts(ida_mem,maxrs) + __IDASpilsSetMaxRestarts(convert(IDAMemPtr,ida_mem),convert(Cint,maxrs)) +end + +function __IDASpilsSetMaxl(ida_mem::IDAMemPtr,maxl::Cint) + ccall((:IDASpilsSetMaxl,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxl) +end + +function IDASpilsSetMaxl(ida_mem,maxl) + __IDASpilsSetMaxl(convert(IDAMemPtr,ida_mem),convert(Cint,maxl)) +end + +function __IDASpilsSetEpsLin(ida_mem::IDAMemPtr,eplifac::realtype) + ccall((:IDASpilsSetEpsLin,libsundials_idas),Cint,(IDAMemPtr,realtype),ida_mem,eplifac) +end + +function IDASpilsSetEpsLin(ida_mem,eplifac) + __IDASpilsSetEpsLin(convert(IDAMemPtr,ida_mem),eplifac) +end + +function __IDASpilsSetIncrementFactor(ida_mem::IDAMemPtr,dqincfac::realtype) + ccall((:IDASpilsSetIncrementFactor,libsundials_idas),Cint,(IDAMemPtr,realtype),ida_mem,dqincfac) +end + +function IDASpilsSetIncrementFactor(ida_mem,dqincfac) + __IDASpilsSetIncrementFactor(convert(IDAMemPtr,ida_mem),dqincfac) +end + +function __IDASpilsGetWorkSpace(ida_mem::IDAMemPtr,lenrwLS::Ptr{Clong},leniwLS::Ptr{Clong}) + ccall((:IDASpilsGetWorkSpace,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,lenrwLS,leniwLS) +end + +function IDASpilsGetWorkSpace(ida_mem,lenrwLS,leniwLS) + __IDASpilsGetWorkSpace(convert(IDAMemPtr,ida_mem),pointer(lenrwLS),pointer(leniwLS)) +end + +function __IDASpilsGetNumPrecEvals(ida_mem::IDAMemPtr,npevals::Ptr{Clong}) + ccall((:IDASpilsGetNumPrecEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,npevals) +end + +function IDASpilsGetNumPrecEvals(ida_mem,npevals) + __IDASpilsGetNumPrecEvals(convert(IDAMemPtr,ida_mem),pointer(npevals)) +end + +function __IDASpilsGetNumPrecSolves(ida_mem::IDAMemPtr,npsolves::Ptr{Clong}) + ccall((:IDASpilsGetNumPrecSolves,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,npsolves) +end + +function IDASpilsGetNumPrecSolves(ida_mem,npsolves) + __IDASpilsGetNumPrecSolves(convert(IDAMemPtr,ida_mem),pointer(npsolves)) +end + +function __IDASpilsGetNumLinIters(ida_mem::IDAMemPtr,nliters::Ptr{Clong}) + ccall((:IDASpilsGetNumLinIters,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nliters) +end + +function IDASpilsGetNumLinIters(ida_mem,nliters) + __IDASpilsGetNumLinIters(convert(IDAMemPtr,ida_mem),pointer(nliters)) +end + +function __IDASpilsGetNumConvFails(ida_mem::IDAMemPtr,nlcfails::Ptr{Clong}) + ccall((:IDASpilsGetNumConvFails,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nlcfails) +end + +function IDASpilsGetNumConvFails(ida_mem,nlcfails) + __IDASpilsGetNumConvFails(convert(IDAMemPtr,ida_mem),pointer(nlcfails)) +end + +function __IDASpilsGetNumJtimesEvals(ida_mem::IDAMemPtr,njvevals::Ptr{Clong}) + ccall((:IDASpilsGetNumJtimesEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,njvevals) +end + +function IDASpilsGetNumJtimesEvals(ida_mem,njvevals) + __IDASpilsGetNumJtimesEvals(convert(IDAMemPtr,ida_mem),pointer(njvevals)) +end + +function __IDASpilsGetNumResEvals(ida_mem::IDAMemPtr,nrevalsLS::Ptr{Clong}) + ccall((:IDASpilsGetNumResEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,nrevalsLS) +end + +function IDASpilsGetNumResEvals(ida_mem,nrevalsLS) + __IDASpilsGetNumResEvals(convert(IDAMemPtr,ida_mem),pointer(nrevalsLS)) +end + +function __IDASpilsGetLastFlag(ida_mem::IDAMemPtr,flag::Ptr{Clong}) + ccall((:IDASpilsGetLastFlag,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,flag) +end + +function IDASpilsGetLastFlag(ida_mem,flag) + __IDASpilsGetLastFlag(convert(IDAMemPtr,ida_mem),pointer(flag)) +end + +function __IDASpilsGetReturnFlagName(flag::Clong) + ccall((:IDASpilsGetReturnFlagName,libsundials_idas),Ptr{UInt8},(Clong,),flag) +end + +function IDASpilsGetReturnFlagName(flag) + __IDASpilsGetReturnFlagName(convert(Clong,flag)) +end + +function __IDASpilsSetGSTypeB(ida_mem::IDAMemPtr,which::Cint,gstypeB::Cint) + ccall((:IDASpilsSetGSTypeB,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint),ida_mem,which,gstypeB) +end + +function IDASpilsSetGSTypeB(ida_mem,which,gstypeB) + __IDASpilsSetGSTypeB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Cint,gstypeB)) +end + +function __IDASpilsSetMaxRestartsB(ida_mem::IDAMemPtr,which::Cint,maxrsB::Cint) + ccall((:IDASpilsSetMaxRestartsB,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint),ida_mem,which,maxrsB) +end + +function IDASpilsSetMaxRestartsB(ida_mem,which,maxrsB) + __IDASpilsSetMaxRestartsB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Cint,maxrsB)) +end + +function __IDASpilsSetEpsLinB(ida_mem::IDAMemPtr,which::Cint,eplifacB::realtype) + ccall((:IDASpilsSetEpsLinB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype),ida_mem,which,eplifacB) +end + +function IDASpilsSetEpsLinB(ida_mem,which,eplifacB) + __IDASpilsSetEpsLinB(convert(IDAMemPtr,ida_mem),convert(Cint,which),eplifacB) +end + +function __IDASpilsSetMaxlB(ida_mem::IDAMemPtr,which::Cint,maxlB::Cint) + ccall((:IDASpilsSetMaxlB,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint),ida_mem,which,maxlB) +end + +function IDASpilsSetMaxlB(ida_mem,which,maxlB) + __IDASpilsSetMaxlB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Cint,maxlB)) +end + +function __IDASpilsSetIncrementFactorB(ida_mem::IDAMemPtr,which::Cint,dqincfacB::realtype) + ccall((:IDASpilsSetIncrementFactorB,libsundials_idas),Cint,(IDAMemPtr,Cint,realtype),ida_mem,which,dqincfacB) end -function IDABBDPrecReInit(ida_mem::Ptr{Void},mudq::Int,mldq::Int,dq_rel_yy::realtype) - ccall((:IDABBDPrecReInit,libsundials_ida),Cint,(Ptr{Void},Clong,Clong,realtype),ida_mem,mudq,mldq,dq_rel_yy) +function IDASpilsSetIncrementFactorB(ida_mem,which,dqincfacB) + __IDASpilsSetIncrementFactorB(convert(IDAMemPtr,ida_mem),convert(Cint,which),dqincfacB) end -function IDABBDPrecGetWorkSpace(ida_mem::Ptr{Void},lenrwBBDP::Ptr{Clong},leniwBBDP::Ptr{Clong}) - ccall((:IDABBDPrecGetWorkSpace,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),ida_mem,lenrwBBDP,leniwBBDP) +function __IDASpilsSetPreconditionerB(ida_mem::IDAMemPtr,which::Cint,psetB::IDASpilsPrecSetupFnB,psolveB::IDASpilsPrecSolveFnB) + ccall((:IDASpilsSetPreconditionerB,libsundials_idas),Cint,(IDAMemPtr,Cint,IDASpilsPrecSetupFnB,IDASpilsPrecSolveFnB),ida_mem,which,psetB,psolveB) end -function IDABBDPrecGetNumGfnEvals(ida_mem::Ptr{Void},ngevalsBBDP::Ptr{Clong}) - ccall((:IDABBDPrecGetNumGfnEvals,libsundials_ida),Cint,(Ptr{Void},Ptr{Clong}),ida_mem,ngevalsBBDP) +function IDASpilsSetPreconditionerB(ida_mem,which,psetB,psolveB) + __IDASpilsSetPreconditionerB(convert(IDAMemPtr,ida_mem),convert(Cint,which),psetB,psolveB) end -function IDABBDPrecInitB(ida_mem::Ptr{Void},which::Int,NlocalB::Int,mudqB::Int,mldqB::Int,mukeepB::Int,mlkeepB::Int,dq_rel_yyB::realtype,GresB::IDABBDLocalFnB,GcommB::IDABBDCommFnB) - ccall((:IDABBDPrecInitB,libsundials_ida),Cint,(Ptr{Void},Cint,Clong,Clong,Clong,Clong,Clong,realtype,IDABBDLocalFnB,IDABBDCommFnB),ida_mem,which,NlocalB,mudqB,mldqB,mukeepB,mlkeepB,dq_rel_yyB,GresB,GcommB) +function __IDASpilsSetJacTimesVecFnB(ida_mem::IDAMemPtr,which::Cint,jtvB::IDASpilsJacTimesVecFnB) + ccall((:IDASpilsSetJacTimesVecFnB,libsundials_idas),Cint,(IDAMemPtr,Cint,IDASpilsJacTimesVecFnB),ida_mem,which,jtvB) end -function IDABBDPrecReInitB(ida_mem::Ptr{Void},which::Int,mudqB::Int,mldqB::Int,dq_rel_yyB::realtype) - ccall((:IDABBDPrecReInitB,libsundials_ida),Cint,(Ptr{Void},Cint,Clong,Clong,realtype),ida_mem,which,mudqB,mldqB,dq_rel_yyB) +function IDASpilsSetJacTimesVecFnB(ida_mem,which,jtvB) + __IDASpilsSetJacTimesVecFnB(convert(IDAMemPtr,ida_mem),convert(Cint,which),jtvB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas_dense.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas_band.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDADense(ida_mem::Ptr{Void},Neq::Int) - ccall((:IDADense,libsundials_ida),Cint,(Ptr{Void},Clong),ida_mem,Neq) + +function __IDABand(ida_mem::IDAMemPtr,Neq::Clong,mupper::Clong,mlower::Clong) + ccall((:IDABand,libsundials_idas),Cint,(IDAMemPtr,Clong,Clong,Clong),ida_mem,Neq,mupper,mlower) +end + +function IDABand(ida_mem,Neq,mupper,mlower) + __IDABand(convert(IDAMemPtr,ida_mem),convert(Clong,Neq),convert(Clong,mupper),convert(Clong,mlower)) end -function IDADenseB(ida_mem::Ptr{Void},which::Int,NeqB::Int) - ccall((:IDADenseB,libsundials_ida),Cint,(Ptr{Void},Cint,Clong),ida_mem,which,NeqB) +function __IDABandB(idaadj_mem::IDAMemPtr,which::Cint,NeqB::Clong,mupperB::Clong,mlowerB::Clong) + ccall((:IDABandB,libsundials_idas),Cint,(IDAMemPtr,Cint,Clong,Clong,Clong),idaadj_mem,which,NeqB,mupperB,mlowerB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas_impl.h + +function IDABandB(idaadj_mem,which,NeqB,mupperB,mlowerB) + __IDABandB(convert(IDAMemPtr,idaadj_mem),convert(Cint,which),convert(Clong,NeqB),convert(Clong,mupperB),convert(Clong,mlowerB)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas_bbdpre.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDAEwtSet(ycur::N_Vector,weight::N_Vector,data::Ptr{Void}) - ccall((:IDAEwtSet,libsundials_ida),Cint,(N_Vector,N_Vector,Ptr{Void}),ycur,weight,data) + +function __IDABBDPrecInit(ida_mem::IDAMemPtr,Nlocal::Clong,mudq::Clong,mldq::Clong,mukeep::Clong,mlkeep::Clong,dq_rel_yy::realtype,Gres::IDABBDLocalFn,Gcomm::IDABBDCommFn) + ccall((:IDABBDPrecInit,libsundials_idas),Cint,(IDAMemPtr,Clong,Clong,Clong,Clong,Clong,realtype,IDABBDLocalFn,IDABBDCommFn),ida_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dq_rel_yy,Gres,Gcomm) +end + +function IDABBDPrecInit(ida_mem,Nlocal,mudq,mldq,mukeep,mlkeep,dq_rel_yy,Gres,Gcomm) + __IDABBDPrecInit(convert(IDAMemPtr,ida_mem),convert(Clong,Nlocal),convert(Clong,mudq),convert(Clong,mldq),convert(Clong,mukeep),convert(Clong,mlkeep),dq_rel_yy,Gres,Gcomm) +end + +function __IDABBDPrecReInit(ida_mem::IDAMemPtr,mudq::Clong,mldq::Clong,dq_rel_yy::realtype) + ccall((:IDABBDPrecReInit,libsundials_idas),Cint,(IDAMemPtr,Clong,Clong,realtype),ida_mem,mudq,mldq,dq_rel_yy) +end + +function IDABBDPrecReInit(ida_mem,mudq,mldq,dq_rel_yy) + __IDABBDPrecReInit(convert(IDAMemPtr,ida_mem),convert(Clong,mudq),convert(Clong,mldq),dq_rel_yy) +end + +function __IDABBDPrecGetWorkSpace(ida_mem::IDAMemPtr,lenrwBBDP::Ptr{Clong},leniwBBDP::Ptr{Clong}) + ccall((:IDABBDPrecGetWorkSpace,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong},Ptr{Clong}),ida_mem,lenrwBBDP,leniwBBDP) +end + +function IDABBDPrecGetWorkSpace(ida_mem,lenrwBBDP,leniwBBDP) + __IDABBDPrecGetWorkSpace(convert(IDAMemPtr,ida_mem),pointer(lenrwBBDP),pointer(leniwBBDP)) +end + +function __IDABBDPrecGetNumGfnEvals(ida_mem::IDAMemPtr,ngevalsBBDP::Ptr{Clong}) + ccall((:IDABBDPrecGetNumGfnEvals,libsundials_idas),Cint,(IDAMemPtr,Ptr{Clong}),ida_mem,ngevalsBBDP) +end + +function IDABBDPrecGetNumGfnEvals(ida_mem,ngevalsBBDP) + __IDABBDPrecGetNumGfnEvals(convert(IDAMemPtr,ida_mem),pointer(ngevalsBBDP)) +end + +function __IDABBDPrecInitB(ida_mem::IDAMemPtr,which::Cint,NlocalB::Clong,mudqB::Clong,mldqB::Clong,mukeepB::Clong,mlkeepB::Clong,dq_rel_yyB::realtype,GresB::IDABBDLocalFnB,GcommB::IDABBDCommFnB) + ccall((:IDABBDPrecInitB,libsundials_idas),Cint,(IDAMemPtr,Cint,Clong,Clong,Clong,Clong,Clong,realtype,IDABBDLocalFnB,IDABBDCommFnB),ida_mem,which,NlocalB,mudqB,mldqB,mukeepB,mlkeepB,dq_rel_yyB,GresB,GcommB) +end + +function IDABBDPrecInitB(ida_mem,which,NlocalB,mudqB,mldqB,mukeepB,mlkeepB,dq_rel_yyB,GresB,GcommB) + __IDABBDPrecInitB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Clong,NlocalB),convert(Clong,mudqB),convert(Clong,mldqB),convert(Clong,mukeepB),convert(Clong,mlkeepB),dq_rel_yyB,GresB,GcommB) end -function IDAErrHandler(error_code::Int,_module::Ptr{UInt8},_function::Ptr{UInt8},msg::Ptr{UInt8},data::Ptr{Void}) - ccall((:IDAErrHandler,libsundials_ida),Void,(Cint,Ptr{UInt8},Ptr{UInt8},Ptr{UInt8},Ptr{Void}),error_code,_module,_function,msg,data) +function __IDABBDPrecReInitB(ida_mem::IDAMemPtr,which::Cint,mudqB::Clong,mldqB::Clong,dq_rel_yyB::realtype) + ccall((:IDABBDPrecReInitB,libsundials_idas),Cint,(IDAMemPtr,Cint,Clong,Clong,realtype),ida_mem,which,mudqB,mldqB,dq_rel_yyB) end -function IDASensResDQ(Ns::Int,t::realtype,yy::N_Vector,yp::N_Vector,resval::N_Vector,yyS::Ptr{N_Vector},ypS::Ptr{N_Vector},resvalS::Ptr{N_Vector},user_dataS::Ptr{Void},ytemp::N_Vector,yptemp::N_Vector,restemp::N_Vector) - ccall((:IDASensResDQ,libsundials_ida),Cint,(Cint,realtype,N_Vector,N_Vector,N_Vector,Ptr{N_Vector},Ptr{N_Vector},Ptr{N_Vector},Ptr{Void},N_Vector,N_Vector,N_Vector),Ns,t,yy,yp,resval,yyS,ypS,resvalS,user_dataS,ytemp,yptemp,restemp) +function IDABBDPrecReInitB(ida_mem,which,mudqB,mldqB,dq_rel_yyB) + __IDABBDPrecReInitB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Clong,mudqB),convert(Clong,mldqB),dq_rel_yyB) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas_spbcgs.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas_dense.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function SpbcgMalloc(l_max::Int,vec_tmpl::N_Vector) - ccall((:SpbcgMalloc,libsundials_ida),SpbcgMem,(Cint,N_Vector),l_max,vec_tmpl) + +function __IDADense(ida_mem::IDAMemPtr,Neq::Clong) + ccall((:IDADense,libsundials_idas),Cint,(IDAMemPtr,Clong),ida_mem,Neq) +end + +function IDADense(ida_mem,Neq) + __IDADense(convert(IDAMemPtr,ida_mem),convert(Clong,Neq)) end -function SpbcgSolve(mem::SpbcgMem,A_data::Ptr{Void},x::N_Vector,b::N_Vector,pretype::Int,delta::realtype,P_data::Ptr{Void},sx::N_Vector,sb::N_Vector,atimes::ATimesFn,psolve::PSolveFn,res_norm::Vector{realtype},nli::Ptr{Cint},nps::Ptr{Cint}) - ccall((:SpbcgSolve,libsundials_ida),Cint,(SpbcgMem,Ptr{Void},N_Vector,N_Vector,Cint,realtype,Ptr{Void},N_Vector,N_Vector,ATimesFn,PSolveFn,Ptr{realtype},Ptr{Cint},Ptr{Cint}),mem,A_data,x,b,pretype,delta,P_data,sx,sb,atimes,psolve,res_norm,nli,nps) +function __IDADenseB(ida_mem::IDAMemPtr,which::Cint,NeqB::Clong) + ccall((:IDADenseB,libsundials_idas),Cint,(IDAMemPtr,Cint,Clong),ida_mem,which,NeqB) +end + +function IDADenseB(ida_mem,which,NeqB) + __IDADenseB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Clong,NeqB)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas_impl.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas_spbcgs.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + + +function __IDASpbcg(ida_mem::IDAMemPtr,maxl::Cint) + ccall((:IDASpbcg,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxl) end -function SpbcgFree(mem::SpbcgMem) - ccall((:SpbcgFree,libsundials_ida),Void,(SpbcgMem,),mem) +function IDASpbcg(ida_mem,maxl) + __IDASpbcg(convert(IDAMemPtr,ida_mem),convert(Cint,maxl)) end -function IDASpbcg(ida_mem::Ptr{Void},maxl::Int) - ccall((:IDASpbcg,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxl) +function __IDASpbcgB(ida_mem::IDAMemPtr,which::Cint,maxlB::Cint) + ccall((:IDASpbcgB,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint),ida_mem,which,maxlB) end -function IDASpbcgB(ida_mem::Ptr{Void},which::Int,maxlB::Int) - ccall((:IDASpbcgB,libsundials_ida),Cint,(Ptr{Void},Cint,Cint),ida_mem,which,maxlB) +function IDASpbcgB(ida_mem,which,maxlB) + __IDASpbcgB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Cint,maxlB)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas_spgmr.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas_spgmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDASpgmr(ida_mem::Ptr{Void},maxl::Int) - ccall((:IDASpgmr,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxl) + +function __IDASpgmr(ida_mem::IDAMemPtr,maxl::Cint) + ccall((:IDASpgmr,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxl) +end + +function IDASpgmr(ida_mem,maxl) + __IDASpgmr(convert(IDAMemPtr,ida_mem),convert(Cint,maxl)) +end + +function __IDASpgmrB(ida_mem::IDAMemPtr,which::Cint,maxlB::Cint) + ccall((:IDASpgmrB,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint),ida_mem,which,maxlB) end -function IDASpgmrB(ida_mem::Ptr{Void},which::Int,maxlB::Int) - ccall((:IDASpgmrB,libsundials_ida),Cint,(Ptr{Void},Cint,Cint),ida_mem,which,maxlB) +function IDASpgmrB(ida_mem,which,maxlB) + __IDASpgmrB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Cint,maxlB)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/idas/idas_sptfqmr.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/idas/idas_sptfqmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function IDASptfqmr(ida_mem::Ptr{Void},maxl::Int) - ccall((:IDASptfqmr,libsundials_ida),Cint,(Ptr{Void},Cint),ida_mem,maxl) + +function __IDASptfqmr(ida_mem::IDAMemPtr,maxl::Cint) + ccall((:IDASptfqmr,libsundials_idas),Cint,(IDAMemPtr,Cint),ida_mem,maxl) +end + +function IDASptfqmr(ida_mem,maxl) + __IDASptfqmr(convert(IDAMemPtr,ida_mem),convert(Cint,maxl)) +end + +function __IDASptfqmrB(ida_mem::IDAMemPtr,which::Cint,maxlB::Cint) + ccall((:IDASptfqmrB,libsundials_idas),Cint,(IDAMemPtr,Cint,Cint),ida_mem,which,maxlB) end -function IDASptfqmrB(ida_mem::Ptr{Void},which::Int,maxlB::Int) - ccall((:IDASptfqmrB,libsundials_ida),Cint,(Ptr{Void},Cint,Cint),ida_mem,which,maxlB) +function IDASptfqmrB(ida_mem,which,maxlB) + __IDASptfqmrB(convert(IDAMemPtr,ida_mem),convert(Cint,which),convert(Cint,maxlB)) end diff --git a/src/kinsol.jl b/src/kinsol.jl index 5d605f90..78ffde0c 100644 --- a/src/kinsol.jl +++ b/src/kinsol.jl @@ -1,280 +1,531 @@ -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 + function KINCreate() - ccall((:KINCreate,libsundials_kinsol),Ptr{Void},()) + ccall((:KINCreate,libsundials_kinsol),KINMemPtr,()) +end + +function __KINSetErrHandlerFn(kinmem::KINMemPtr,ehfun::KINErrHandlerFn,eh_data::Ptr{Void}) + ccall((:KINSetErrHandlerFn,libsundials_kinsol),Cint,(KINMemPtr,KINErrHandlerFn,Ptr{Void}),kinmem,ehfun,eh_data) +end + +function KINSetErrHandlerFn(kinmem,ehfun,eh_data) + __KINSetErrHandlerFn(convert(KINMemPtr,kinmem),ehfun,pointer(eh_data)) +end + +function __KINSetErrFile(kinmem::KINMemPtr,errfp::Ptr{FILE}) + ccall((:KINSetErrFile,libsundials_kinsol),Cint,(KINMemPtr,Ptr{FILE}),kinmem,errfp) +end + +function KINSetErrFile(kinmem,errfp) + __KINSetErrFile(convert(KINMemPtr,kinmem),errfp) +end + +function __KINSetInfoHandlerFn(kinmem::KINMemPtr,ihfun::KINInfoHandlerFn,ih_data::Ptr{Void}) + ccall((:KINSetInfoHandlerFn,libsundials_kinsol),Cint,(KINMemPtr,KINInfoHandlerFn,Ptr{Void}),kinmem,ihfun,ih_data) +end + +function KINSetInfoHandlerFn(kinmem,ihfun,ih_data) + __KINSetInfoHandlerFn(convert(KINMemPtr,kinmem),ihfun,pointer(ih_data)) +end + +function __KINSetInfoFile(kinmem::KINMemPtr,infofp::Ptr{FILE}) + ccall((:KINSetInfoFile,libsundials_kinsol),Cint,(KINMemPtr,Ptr{FILE}),kinmem,infofp) +end + +function KINSetInfoFile(kinmem,infofp) + __KINSetInfoFile(convert(KINMemPtr,kinmem),infofp) +end + +function __KINSetUserData(kinmem::KINMemPtr,user_data::Any) + ccall((:KINSetUserData,libsundials_kinsol),Cint,(KINMemPtr,Any),kinmem,user_data) +end + +function KINSetUserData(kinmem,user_data) + __KINSetUserData(convert(KINMemPtr,kinmem),user_data) +end + +function __KINSetPrintLevel(kinmemm::KINMemPtr,printfl::Cint) + ccall((:KINSetPrintLevel,libsundials_kinsol),Cint,(KINMemPtr,Cint),kinmemm,printfl) +end + +function KINSetPrintLevel(kinmemm,printfl) + __KINSetPrintLevel(convert(KINMemPtr,kinmemm),convert(Cint,printfl)) +end + +function __KINSetNumMaxIters(kinmem::KINMemPtr,mxiter::Clong) + ccall((:KINSetNumMaxIters,libsundials_kinsol),Cint,(KINMemPtr,Clong),kinmem,mxiter) +end + +function KINSetNumMaxIters(kinmem,mxiter) + __KINSetNumMaxIters(convert(KINMemPtr,kinmem),convert(Clong,mxiter)) +end + +function __KINSetNoInitSetup(kinmem::KINMemPtr,noInitSetup::Cint) + ccall((:KINSetNoInitSetup,libsundials_kinsol),Cint,(KINMemPtr,Cint),kinmem,noInitSetup) +end + +function KINSetNoInitSetup(kinmem,noInitSetup) + __KINSetNoInitSetup(convert(KINMemPtr,kinmem),convert(Cint,noInitSetup)) +end + +function __KINSetNoResMon(kinmem::KINMemPtr,noNNIResMon::Cint) + ccall((:KINSetNoResMon,libsundials_kinsol),Cint,(KINMemPtr,Cint),kinmem,noNNIResMon) +end + +function KINSetNoResMon(kinmem,noNNIResMon) + __KINSetNoResMon(convert(KINMemPtr,kinmem),convert(Cint,noNNIResMon)) +end + +function __KINSetMaxSetupCalls(kinmem::KINMemPtr,msbset::Clong) + ccall((:KINSetMaxSetupCalls,libsundials_kinsol),Cint,(KINMemPtr,Clong),kinmem,msbset) +end + +function KINSetMaxSetupCalls(kinmem,msbset) + __KINSetMaxSetupCalls(convert(KINMemPtr,kinmem),convert(Clong,msbset)) +end + +function __KINSetMaxSubSetupCalls(kinmem::KINMemPtr,msbsetsub::Clong) + ccall((:KINSetMaxSubSetupCalls,libsundials_kinsol),Cint,(KINMemPtr,Clong),kinmem,msbsetsub) +end + +function KINSetMaxSubSetupCalls(kinmem,msbsetsub) + __KINSetMaxSubSetupCalls(convert(KINMemPtr,kinmem),convert(Clong,msbsetsub)) +end + +function __KINSetEtaForm(kinmem::KINMemPtr,etachoice::Cint) + ccall((:KINSetEtaForm,libsundials_kinsol),Cint,(KINMemPtr,Cint),kinmem,etachoice) +end + +function KINSetEtaForm(kinmem,etachoice) + __KINSetEtaForm(convert(KINMemPtr,kinmem),convert(Cint,etachoice)) +end + +function __KINSetEtaConstValue(kinmem::KINMemPtr,eta::realtype) + ccall((:KINSetEtaConstValue,libsundials_kinsol),Cint,(KINMemPtr,realtype),kinmem,eta) +end + +function KINSetEtaConstValue(kinmem,eta) + __KINSetEtaConstValue(convert(KINMemPtr,kinmem),eta) +end + +function __KINSetEtaParams(kinmem::KINMemPtr,egamma::realtype,ealpha::realtype) + ccall((:KINSetEtaParams,libsundials_kinsol),Cint,(KINMemPtr,realtype,realtype),kinmem,egamma,ealpha) +end + +function KINSetEtaParams(kinmem,egamma,ealpha) + __KINSetEtaParams(convert(KINMemPtr,kinmem),egamma,ealpha) +end + +function __KINSetResMonParams(kinmem::KINMemPtr,omegamin::realtype,omegamax::realtype) + ccall((:KINSetResMonParams,libsundials_kinsol),Cint,(KINMemPtr,realtype,realtype),kinmem,omegamin,omegamax) +end + +function KINSetResMonParams(kinmem,omegamin,omegamax) + __KINSetResMonParams(convert(KINMemPtr,kinmem),omegamin,omegamax) +end + +function __KINSetResMonConstValue(kinmem::KINMemPtr,omegaconst::realtype) + ccall((:KINSetResMonConstValue,libsundials_kinsol),Cint,(KINMemPtr,realtype),kinmem,omegaconst) +end + +function KINSetResMonConstValue(kinmem,omegaconst) + __KINSetResMonConstValue(convert(KINMemPtr,kinmem),omegaconst) end -function KINSetErrHandlerFn(kinmem::Ptr{Void},ehfun::KINErrHandlerFn,eh_data::Ptr{Void}) - ccall((:KINSetErrHandlerFn,libsundials_kinsol),Cint,(Ptr{Void},KINErrHandlerFn,Ptr{Void}),kinmem,ehfun,eh_data) +function __KINSetNoMinEps(kinmem::KINMemPtr,noMinEps::Cint) + ccall((:KINSetNoMinEps,libsundials_kinsol),Cint,(KINMemPtr,Cint),kinmem,noMinEps) end -function KINSetErrFile(kinmem::Ptr{Void},errfp::Ptr{Void}) - ccall((:KINSetErrFile,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Void}),kinmem,errfp) +function KINSetNoMinEps(kinmem,noMinEps) + __KINSetNoMinEps(convert(KINMemPtr,kinmem),convert(Cint,noMinEps)) end -function KINSetInfoHandlerFn(kinmem::Ptr{Void},ihfun::KINInfoHandlerFn,ih_data::Ptr{Void}) - ccall((:KINSetInfoHandlerFn,libsundials_kinsol),Cint,(Ptr{Void},KINInfoHandlerFn,Ptr{Void}),kinmem,ihfun,ih_data) +function __KINSetMaxNewtonStep(kinmem::KINMemPtr,mxnewtstep::realtype) + ccall((:KINSetMaxNewtonStep,libsundials_kinsol),Cint,(KINMemPtr,realtype),kinmem,mxnewtstep) end -function KINSetInfoFile(kinmem::Ptr{Void},infofp::Ptr{Void}) - ccall((:KINSetInfoFile,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Void}),kinmem,infofp) +function KINSetMaxNewtonStep(kinmem,mxnewtstep) + __KINSetMaxNewtonStep(convert(KINMemPtr,kinmem),mxnewtstep) end -function KINSetUserData(kinmem::Ptr{Void},user_data::Ptr{Void}) - ccall((:KINSetUserData,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Void}),kinmem,user_data) +function __KINSetMaxBetaFails(kinmem::KINMemPtr,mxnbcf::Clong) + ccall((:KINSetMaxBetaFails,libsundials_kinsol),Cint,(KINMemPtr,Clong),kinmem,mxnbcf) end -function KINSetPrintLevel(kinmemm::Ptr{Void},printfl::Int) - ccall((:KINSetPrintLevel,libsundials_kinsol),Cint,(Ptr{Void},Cint),kinmemm,printfl) +function KINSetMaxBetaFails(kinmem,mxnbcf) + __KINSetMaxBetaFails(convert(KINMemPtr,kinmem),convert(Clong,mxnbcf)) end -function KINSetNumMaxIters(kinmem::Ptr{Void},mxiter::Int) - ccall((:KINSetNumMaxIters,libsundials_kinsol),Cint,(Ptr{Void},Clong),kinmem,mxiter) +function __KINSetRelErrFunc(kinmem::KINMemPtr,relfunc::realtype) + ccall((:KINSetRelErrFunc,libsundials_kinsol),Cint,(KINMemPtr,realtype),kinmem,relfunc) end -function KINSetNoInitSetup(kinmem::Ptr{Void},noInitSetup::Int) - ccall((:KINSetNoInitSetup,libsundials_kinsol),Cint,(Ptr{Void},Cint),kinmem,noInitSetup) +function KINSetRelErrFunc(kinmem,relfunc) + __KINSetRelErrFunc(convert(KINMemPtr,kinmem),relfunc) end -function KINSetNoResMon(kinmem::Ptr{Void},noNNIResMon::Int) - ccall((:KINSetNoResMon,libsundials_kinsol),Cint,(Ptr{Void},Cint),kinmem,noNNIResMon) +function __KINSetFuncNormTol(kinmem::KINMemPtr,fnormtol::realtype) + ccall((:KINSetFuncNormTol,libsundials_kinsol),Cint,(KINMemPtr,realtype),kinmem,fnormtol) end -function KINSetMaxSetupCalls(kinmem::Ptr{Void},msbset::Int) - ccall((:KINSetMaxSetupCalls,libsundials_kinsol),Cint,(Ptr{Void},Clong),kinmem,msbset) +function KINSetFuncNormTol(kinmem,fnormtol) + __KINSetFuncNormTol(convert(KINMemPtr,kinmem),fnormtol) end -function KINSetMaxSubSetupCalls(kinmem::Ptr{Void},msbsetsub::Int) - ccall((:KINSetMaxSubSetupCalls,libsundials_kinsol),Cint,(Ptr{Void},Clong),kinmem,msbsetsub) +function __KINSetScaledStepTol(kinmem::KINMemPtr,scsteptol::realtype) + ccall((:KINSetScaledStepTol,libsundials_kinsol),Cint,(KINMemPtr,realtype),kinmem,scsteptol) end -function KINSetEtaForm(kinmem::Ptr{Void},etachoice::Int) - ccall((:KINSetEtaForm,libsundials_kinsol),Cint,(Ptr{Void},Cint),kinmem,etachoice) +function KINSetScaledStepTol(kinmem,scsteptol) + __KINSetScaledStepTol(convert(KINMemPtr,kinmem),scsteptol) end -function KINSetEtaConstValue(kinmem::Ptr{Void},eta::realtype) - ccall((:KINSetEtaConstValue,libsundials_kinsol),Cint,(Ptr{Void},realtype),kinmem,eta) +function __KINSetConstraints(kinmem::KINMemPtr,constraints::N_Vector) + ccall((:KINSetConstraints,libsundials_kinsol),Cint,(KINMemPtr,N_Vector),kinmem,constraints) end -function KINSetEtaParams(kinmem::Ptr{Void},egamma::realtype,ealpha::realtype) - ccall((:KINSetEtaParams,libsundials_kinsol),Cint,(Ptr{Void},realtype,realtype),kinmem,egamma,ealpha) +function KINSetConstraints(kinmem,constraints) + __constraints = convert(NVector,constraints) + __KINSetConstraints(convert(KINMemPtr,kinmem),convert(N_Vector,__constraints)) end -function KINSetResMonParams(kinmem::Ptr{Void},omegamin::realtype,omegamax::realtype) - ccall((:KINSetResMonParams,libsundials_kinsol),Cint,(Ptr{Void},realtype,realtype),kinmem,omegamin,omegamax) +function __KINSetSysFunc(kinmem::KINMemPtr,func::KINSysFn) + ccall((:KINSetSysFunc,libsundials_kinsol),Cint,(KINMemPtr,KINSysFn),kinmem,func) end -function KINSetResMonConstValue(kinmem::Ptr{Void},omegaconst::realtype) - ccall((:KINSetResMonConstValue,libsundials_kinsol),Cint,(Ptr{Void},realtype),kinmem,omegaconst) +function KINSetSysFunc(kinmem,func) + __KINSetSysFunc(convert(KINMemPtr,kinmem),KINSysFn_wrapper(func)) end -function KINSetNoMinEps(kinmem::Ptr{Void},noMinEps::Int) - ccall((:KINSetNoMinEps,libsundials_kinsol),Cint,(Ptr{Void},Cint),kinmem,noMinEps) +function __KINInit(kinmem::KINMemPtr,func::KINSysFn,tmpl::N_Vector) + ccall((:KINInit,libsundials_kinsol),Cint,(KINMemPtr,KINSysFn,N_Vector),kinmem,func,tmpl) end -function KINSetMaxNewtonStep(kinmem::Ptr{Void},mxnewtstep::realtype) - ccall((:KINSetMaxNewtonStep,libsundials_kinsol),Cint,(Ptr{Void},realtype),kinmem,mxnewtstep) +function KINInit(kinmem,func,tmpl) + __tmpl = convert(NVector,tmpl) + __KINInit(convert(KINMemPtr,kinmem),KINSysFn_wrapper(func),convert(N_Vector,__tmpl)) end -function KINSetMaxBetaFails(kinmem::Ptr{Void},mxnbcf::Int) - ccall((:KINSetMaxBetaFails,libsundials_kinsol),Cint,(Ptr{Void},Clong),kinmem,mxnbcf) +function __KINSol(kinmem::KINMemPtr,uu::N_Vector,strategy::Cint,u_scale::N_Vector,f_scale::N_Vector) + ccall((:KINSol,libsundials_kinsol),Cint,(KINMemPtr,N_Vector,Cint,N_Vector,N_Vector),kinmem,uu,strategy,u_scale,f_scale) end -function KINSetRelErrFunc(kinmem::Ptr{Void},relfunc::realtype) - ccall((:KINSetRelErrFunc,libsundials_kinsol),Cint,(Ptr{Void},realtype),kinmem,relfunc) +function KINSol(kinmem,uu,strategy,u_scale,f_scale) + __uu = convert(NVector,uu) + __u_scale = convert(NVector,u_scale) + __f_scale = convert(NVector,f_scale) + __KINSol(convert(KINMemPtr,kinmem),convert(N_Vector,__uu),convert(Cint,strategy),convert(N_Vector,__u_scale),convert(N_Vector,__f_scale)) end -function KINSetFuncNormTol(kinmem::Ptr{Void},fnormtol::realtype) - ccall((:KINSetFuncNormTol,libsundials_kinsol),Cint,(Ptr{Void},realtype),kinmem,fnormtol) +function __KINGetWorkSpace(kinmem::KINMemPtr,lenrw::Ptr{Clong},leniw::Ptr{Clong}) + ccall((:KINGetWorkSpace,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong},Ptr{Clong}),kinmem,lenrw,leniw) end -function KINSetScaledStepTol(kinmem::Ptr{Void},scsteptol::realtype) - ccall((:KINSetScaledStepTol,libsundials_kinsol),Cint,(Ptr{Void},realtype),kinmem,scsteptol) +function KINGetWorkSpace(kinmem,lenrw,leniw) + __KINGetWorkSpace(convert(KINMemPtr,kinmem),pointer(lenrw),pointer(leniw)) end -function KINSetConstraints(kinmem::Ptr{Void},constraints::N_Vector) - ccall((:KINSetConstraints,libsundials_kinsol),Cint,(Ptr{Void},N_Vector),kinmem,constraints) +function __KINGetNumNonlinSolvIters(kinmem::KINMemPtr,nniters::Ptr{Clong}) + ccall((:KINGetNumNonlinSolvIters,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,nniters) end -function KINSetSysFunc(kinmem::Ptr{Void},func::KINSysFn) - ccall((:KINSetSysFunc,libsundials_kinsol),Cint,(Ptr{Void},KINSysFn),kinmem,func) +function KINGetNumNonlinSolvIters(kinmem,nniters) + __KINGetNumNonlinSolvIters(convert(KINMemPtr,kinmem),pointer(nniters)) end -function KINInit(kinmem::Ptr{Void},func::KINSysFn,tmpl::N_Vector) - ccall((:KINInit,libsundials_kinsol),Cint,(Ptr{Void},KINSysFn,N_Vector),kinmem,func,tmpl) +function __KINGetNumFuncEvals(kinmem::KINMemPtr,nfevals::Ptr{Clong}) + ccall((:KINGetNumFuncEvals,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,nfevals) end -function KINSol(kinmem::Ptr{Void},uu::N_Vector,strategy::Int,u_scale::N_Vector,f_scale::N_Vector) - ccall((:KINSol,libsundials_kinsol),Cint,(Ptr{Void},N_Vector,Cint,N_Vector,N_Vector),kinmem,uu,strategy,u_scale,f_scale) +function KINGetNumFuncEvals(kinmem,nfevals) + __KINGetNumFuncEvals(convert(KINMemPtr,kinmem),pointer(nfevals)) end -function KINGetWorkSpace(kinmem::Ptr{Void},lenrw::Ptr{Clong},leniw::Ptr{Clong}) - ccall((:KINGetWorkSpace,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),kinmem,lenrw,leniw) +function __KINGetNumBetaCondFails(kinmem::KINMemPtr,nbcfails::Ptr{Clong}) + ccall((:KINGetNumBetaCondFails,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,nbcfails) end -function KINGetNumNonlinSolvIters(kinmem::Ptr{Void},nniters::Ptr{Clong}) - ccall((:KINGetNumNonlinSolvIters,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,nniters) +function KINGetNumBetaCondFails(kinmem,nbcfails) + __KINGetNumBetaCondFails(convert(KINMemPtr,kinmem),pointer(nbcfails)) end -function KINGetNumFuncEvals(kinmem::Ptr{Void},nfevals::Ptr{Clong}) - ccall((:KINGetNumFuncEvals,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,nfevals) +function __KINGetNumBacktrackOps(kinmem::KINMemPtr,nbacktr::Ptr{Clong}) + ccall((:KINGetNumBacktrackOps,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,nbacktr) end -function KINGetNumBetaCondFails(kinmem::Ptr{Void},nbcfails::Ptr{Clong}) - ccall((:KINGetNumBetaCondFails,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,nbcfails) +function KINGetNumBacktrackOps(kinmem,nbacktr) + __KINGetNumBacktrackOps(convert(KINMemPtr,kinmem),pointer(nbacktr)) end -function KINGetNumBacktrackOps(kinmem::Ptr{Void},nbacktr::Ptr{Clong}) - ccall((:KINGetNumBacktrackOps,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,nbacktr) +function __KINGetFuncNorm(kinmem::KINMemPtr,fnorm::Ptr{realtype}) + ccall((:KINGetFuncNorm,libsundials_kinsol),Cint,(KINMemPtr,Ptr{realtype}),kinmem,fnorm) end -function KINGetFuncNorm(kinmem::Ptr{Void},fnorm::Ptr{realtype}) - ccall((:KINGetFuncNorm,libsundials_kinsol),Cint,(Ptr{Void},Ptr{realtype}),kinmem,fnorm) +function KINGetFuncNorm(kinmem,fnorm) + __KINGetFuncNorm(convert(KINMemPtr,kinmem),pointer(fnorm)) end -function KINGetStepLength(kinmem::Ptr{Void},steplength::Ptr{realtype}) - ccall((:KINGetStepLength,libsundials_kinsol),Cint,(Ptr{Void},Ptr{realtype}),kinmem,steplength) +function __KINGetStepLength(kinmem::KINMemPtr,steplength::Ptr{realtype}) + ccall((:KINGetStepLength,libsundials_kinsol),Cint,(KINMemPtr,Ptr{realtype}),kinmem,steplength) end -function KINGetReturnFlagName(flag::Int) +function KINGetStepLength(kinmem,steplength) + __KINGetStepLength(convert(KINMemPtr,kinmem),pointer(steplength)) +end + +function __KINGetReturnFlagName(flag::Clong) ccall((:KINGetReturnFlagName,libsundials_kinsol),Ptr{UInt8},(Clong,),flag) end -function KINFree(kinmem::Vector{Ptr{Void}}) - ccall((:KINFree,libsundials_kinsol),Void,(Ptr{Ptr{Void}},),kinmem) +function KINGetReturnFlagName(flag) + __KINGetReturnFlagName(convert(Clong,flag)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol_direct.h + +function KINFree(kinmem::Ref{KINMemPtr}) + ccall((:KINFree,libsundials_kinsol),Void,(Ref{KINMemPtr},),kinmem) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol_direct.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function KINDlsSetDenseJacFn(kinmem::Ptr{Void},jac::KINDlsDenseJacFn) - ccall((:KINDlsSetDenseJacFn,libsundials_kinsol),Cint,(Ptr{Void},KINDlsDenseJacFn),kinmem,jac) + +function __KINDlsSetDenseJacFn(kinmem::KINMemPtr,jac::KINDlsDenseJacFn) + ccall((:KINDlsSetDenseJacFn,libsundials_kinsol),Cint,(KINMemPtr,KINDlsDenseJacFn),kinmem,jac) +end + +function KINDlsSetDenseJacFn(kinmem,jac) + __KINDlsSetDenseJacFn(convert(KINMemPtr,kinmem),jac) +end + +function __KINDlsSetBandJacFn(kinmem::KINMemPtr,jac::KINDlsBandJacFn) + ccall((:KINDlsSetBandJacFn,libsundials_kinsol),Cint,(KINMemPtr,KINDlsBandJacFn),kinmem,jac) +end + +function KINDlsSetBandJacFn(kinmem,jac) + __KINDlsSetBandJacFn(convert(KINMemPtr,kinmem),jac) +end + +function __KINDlsGetWorkSpace(kinmem::KINMemPtr,lenrwB::Ptr{Clong},leniwB::Ptr{Clong}) + ccall((:KINDlsGetWorkSpace,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong},Ptr{Clong}),kinmem,lenrwB,leniwB) +end + +function KINDlsGetWorkSpace(kinmem,lenrwB,leniwB) + __KINDlsGetWorkSpace(convert(KINMemPtr,kinmem),pointer(lenrwB),pointer(leniwB)) +end + +function __KINDlsGetNumJacEvals(kinmem::KINMemPtr,njevalsB::Ptr{Clong}) + ccall((:KINDlsGetNumJacEvals,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,njevalsB) end -function KINDlsSetBandJacFn(kinmem::Ptr{Void},jac::KINDlsBandJacFn) - ccall((:KINDlsSetBandJacFn,libsundials_kinsol),Cint,(Ptr{Void},KINDlsBandJacFn),kinmem,jac) +function KINDlsGetNumJacEvals(kinmem,njevalsB) + __KINDlsGetNumJacEvals(convert(KINMemPtr,kinmem),pointer(njevalsB)) end -function KINDlsGetWorkSpace(kinmem::Ptr{Void},lenrwB::Ptr{Clong},leniwB::Ptr{Clong}) - ccall((:KINDlsGetWorkSpace,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),kinmem,lenrwB,leniwB) +function __KINDlsGetNumFuncEvals(kinmem::KINMemPtr,nfevalsB::Ptr{Clong}) + ccall((:KINDlsGetNumFuncEvals,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,nfevalsB) end -function KINDlsGetNumJacEvals(kinmem::Ptr{Void},njevalsB::Ptr{Clong}) - ccall((:KINDlsGetNumJacEvals,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,njevalsB) +function KINDlsGetNumFuncEvals(kinmem,nfevalsB) + __KINDlsGetNumFuncEvals(convert(KINMemPtr,kinmem),pointer(nfevalsB)) end -function KINDlsGetNumFuncEvals(kinmem::Ptr{Void},nfevalsB::Ptr{Clong}) - ccall((:KINDlsGetNumFuncEvals,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,nfevalsB) +function __KINDlsGetLastFlag(kinmem::KINMemPtr,flag::Ptr{Clong}) + ccall((:KINDlsGetLastFlag,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,flag) end -function KINDlsGetLastFlag(kinmem::Ptr{Void},flag::Ptr{Clong}) - ccall((:KINDlsGetLastFlag,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,flag) +function KINDlsGetLastFlag(kinmem,flag) + __KINDlsGetLastFlag(convert(KINMemPtr,kinmem),pointer(flag)) end -function KINDlsGetReturnFlagName(flag::Int) +function __KINDlsGetReturnFlagName(flag::Clong) ccall((:KINDlsGetReturnFlagName,libsundials_kinsol),Ptr{UInt8},(Clong,),flag) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol_spils.h + +function KINDlsGetReturnFlagName(flag) + __KINDlsGetReturnFlagName(convert(Clong,flag)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol_spils.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function KINSpilsSetMaxRestarts(kinmem::Ptr{Void},maxrs::Int) - ccall((:KINSpilsSetMaxRestarts,libsundials_kinsol),Cint,(Ptr{Void},Cint),kinmem,maxrs) + +function __KINSpilsSetMaxRestarts(kinmem::KINMemPtr,maxrs::Cint) + ccall((:KINSpilsSetMaxRestarts,libsundials_kinsol),Cint,(KINMemPtr,Cint),kinmem,maxrs) +end + +function KINSpilsSetMaxRestarts(kinmem,maxrs) + __KINSpilsSetMaxRestarts(convert(KINMemPtr,kinmem),convert(Cint,maxrs)) +end + +function __KINSpilsSetPreconditioner(kinmem::KINMemPtr,pset::KINSpilsPrecSetupFn,psolve::KINSpilsPrecSolveFn) + ccall((:KINSpilsSetPreconditioner,libsundials_kinsol),Cint,(KINMemPtr,KINSpilsPrecSetupFn,KINSpilsPrecSolveFn),kinmem,pset,psolve) +end + +function KINSpilsSetPreconditioner(kinmem,pset,psolve) + __KINSpilsSetPreconditioner(convert(KINMemPtr,kinmem),pset,psolve) +end + +function __KINSpilsSetJacTimesVecFn(kinmem::KINMemPtr,jtv::KINSpilsJacTimesVecFn) + ccall((:KINSpilsSetJacTimesVecFn,libsundials_kinsol),Cint,(KINMemPtr,KINSpilsJacTimesVecFn),kinmem,jtv) +end + +function KINSpilsSetJacTimesVecFn(kinmem,jtv) + __KINSpilsSetJacTimesVecFn(convert(KINMemPtr,kinmem),jtv) +end + +function __KINSpilsGetWorkSpace(kinmem::KINMemPtr,lenrwSG::Ptr{Clong},leniwSG::Ptr{Clong}) + ccall((:KINSpilsGetWorkSpace,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong},Ptr{Clong}),kinmem,lenrwSG,leniwSG) end -function KINSpilsSetPreconditioner(kinmem::Ptr{Void},pset::KINSpilsPrecSetupFn,psolve::KINSpilsPrecSolveFn) - ccall((:KINSpilsSetPreconditioner,libsundials_kinsol),Cint,(Ptr{Void},KINSpilsPrecSetupFn,KINSpilsPrecSolveFn),kinmem,pset,psolve) +function KINSpilsGetWorkSpace(kinmem,lenrwSG,leniwSG) + __KINSpilsGetWorkSpace(convert(KINMemPtr,kinmem),pointer(lenrwSG),pointer(leniwSG)) end -function KINSpilsSetJacTimesVecFn(kinmem::Ptr{Void},jtv::KINSpilsJacTimesVecFn) - ccall((:KINSpilsSetJacTimesVecFn,libsundials_kinsol),Cint,(Ptr{Void},KINSpilsJacTimesVecFn),kinmem,jtv) +function __KINSpilsGetNumPrecEvals(kinmem::KINMemPtr,npevals::Ptr{Clong}) + ccall((:KINSpilsGetNumPrecEvals,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,npevals) end -function KINSpilsGetWorkSpace(kinmem::Ptr{Void},lenrwSG::Ptr{Clong},leniwSG::Ptr{Clong}) - ccall((:KINSpilsGetWorkSpace,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),kinmem,lenrwSG,leniwSG) +function KINSpilsGetNumPrecEvals(kinmem,npevals) + __KINSpilsGetNumPrecEvals(convert(KINMemPtr,kinmem),pointer(npevals)) end -function KINSpilsGetNumPrecEvals(kinmem::Ptr{Void},npevals::Ptr{Clong}) - ccall((:KINSpilsGetNumPrecEvals,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,npevals) +function __KINSpilsGetNumPrecSolves(kinmem::KINMemPtr,npsolves::Ptr{Clong}) + ccall((:KINSpilsGetNumPrecSolves,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,npsolves) end -function KINSpilsGetNumPrecSolves(kinmem::Ptr{Void},npsolves::Ptr{Clong}) - ccall((:KINSpilsGetNumPrecSolves,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,npsolves) +function KINSpilsGetNumPrecSolves(kinmem,npsolves) + __KINSpilsGetNumPrecSolves(convert(KINMemPtr,kinmem),pointer(npsolves)) end -function KINSpilsGetNumLinIters(kinmem::Ptr{Void},nliters::Ptr{Clong}) - ccall((:KINSpilsGetNumLinIters,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,nliters) +function __KINSpilsGetNumLinIters(kinmem::KINMemPtr,nliters::Ptr{Clong}) + ccall((:KINSpilsGetNumLinIters,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,nliters) end -function KINSpilsGetNumConvFails(kinmem::Ptr{Void},nlcfails::Ptr{Clong}) - ccall((:KINSpilsGetNumConvFails,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,nlcfails) +function KINSpilsGetNumLinIters(kinmem,nliters) + __KINSpilsGetNumLinIters(convert(KINMemPtr,kinmem),pointer(nliters)) end -function KINSpilsGetNumJtimesEvals(kinmem::Ptr{Void},njvevals::Ptr{Clong}) - ccall((:KINSpilsGetNumJtimesEvals,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,njvevals) +function __KINSpilsGetNumConvFails(kinmem::KINMemPtr,nlcfails::Ptr{Clong}) + ccall((:KINSpilsGetNumConvFails,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,nlcfails) end -function KINSpilsGetNumFuncEvals(kinmem::Ptr{Void},nfevalsS::Ptr{Clong}) - ccall((:KINSpilsGetNumFuncEvals,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,nfevalsS) +function KINSpilsGetNumConvFails(kinmem,nlcfails) + __KINSpilsGetNumConvFails(convert(KINMemPtr,kinmem),pointer(nlcfails)) end -function KINSpilsGetLastFlag(kinmem::Ptr{Void},flag::Ptr{Clong}) - ccall((:KINSpilsGetLastFlag,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,flag) +function __KINSpilsGetNumJtimesEvals(kinmem::KINMemPtr,njvevals::Ptr{Clong}) + ccall((:KINSpilsGetNumJtimesEvals,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,njvevals) end -function KINSpilsGetReturnFlagName(flag::Int) +function KINSpilsGetNumJtimesEvals(kinmem,njvevals) + __KINSpilsGetNumJtimesEvals(convert(KINMemPtr,kinmem),pointer(njvevals)) +end + +function __KINSpilsGetNumFuncEvals(kinmem::KINMemPtr,nfevalsS::Ptr{Clong}) + ccall((:KINSpilsGetNumFuncEvals,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,nfevalsS) +end + +function KINSpilsGetNumFuncEvals(kinmem,nfevalsS) + __KINSpilsGetNumFuncEvals(convert(KINMemPtr,kinmem),pointer(nfevalsS)) +end + +function __KINSpilsGetLastFlag(kinmem::KINMemPtr,flag::Ptr{Clong}) + ccall((:KINSpilsGetLastFlag,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,flag) +end + +function KINSpilsGetLastFlag(kinmem,flag) + __KINSpilsGetLastFlag(convert(KINMemPtr,kinmem),pointer(flag)) +end + +function __KINSpilsGetReturnFlagName(flag::Clong) ccall((:KINSpilsGetReturnFlagName,libsundials_kinsol),Ptr{UInt8},(Clong,),flag) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol_band.h + +function KINSpilsGetReturnFlagName(flag) + __KINSpilsGetReturnFlagName(convert(Clong,flag)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol_band.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function KINBand(kinmem::Ptr{Void},N::Int,mupper::Int,mlower::Int) - ccall((:KINBand,libsundials_kinsol),Cint,(Ptr{Void},Clong,Clong,Clong),kinmem,N,mupper,mlower) + +function __KINBand(kinmem::KINMemPtr,N::Clong,mupper::Clong,mlower::Clong) + ccall((:KINBand,libsundials_kinsol),Cint,(KINMemPtr,Clong,Clong,Clong),kinmem,N,mupper,mlower) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol_bbdpre.h + +function KINBand(kinmem,N,mupper,mlower) + __KINBand(convert(KINMemPtr,kinmem),convert(Clong,N),convert(Clong,mupper),convert(Clong,mlower)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol_bbdpre.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function KINBBDPrecInit(kinmem::Ptr{Void},Nlocal::Int,mudq::Int,mldq::Int,mukeep::Int,mlkeep::Int,dq_rel_uu::realtype,gloc::KINLocalFn,gcomm::KINCommFn) - ccall((:KINBBDPrecInit,libsundials_kinsol),Cint,(Ptr{Void},Clong,Clong,Clong,Clong,Clong,realtype,KINLocalFn,KINCommFn),kinmem,Nlocal,mudq,mldq,mukeep,mlkeep,dq_rel_uu,gloc,gcomm) + +function __KINBBDPrecInit(kinmem::KINMemPtr,Nlocal::Clong,mudq::Clong,mldq::Clong,mukeep::Clong,mlkeep::Clong,dq_rel_uu::realtype,gloc::KINLocalFn,gcomm::KINCommFn) + ccall((:KINBBDPrecInit,libsundials_kinsol),Cint,(KINMemPtr,Clong,Clong,Clong,Clong,Clong,realtype,KINLocalFn,KINCommFn),kinmem,Nlocal,mudq,mldq,mukeep,mlkeep,dq_rel_uu,gloc,gcomm) end -function KINBBDPrecGetWorkSpace(kinmem::Ptr{Void},lenrwBBDP::Ptr{Clong},leniwBBDP::Ptr{Clong}) - ccall((:KINBBDPrecGetWorkSpace,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong},Ptr{Clong}),kinmem,lenrwBBDP,leniwBBDP) +function KINBBDPrecInit(kinmem,Nlocal,mudq,mldq,mukeep,mlkeep,dq_rel_uu,gloc,gcomm) + __KINBBDPrecInit(convert(KINMemPtr,kinmem),convert(Clong,Nlocal),convert(Clong,mudq),convert(Clong,mldq),convert(Clong,mukeep),convert(Clong,mlkeep),dq_rel_uu,gloc,gcomm) end -function KINBBDPrecGetNumGfnEvals(kinmem::Ptr{Void},ngevalsBBDP::Ptr{Clong}) - ccall((:KINBBDPrecGetNumGfnEvals,libsundials_kinsol),Cint,(Ptr{Void},Ptr{Clong}),kinmem,ngevalsBBDP) +function __KINBBDPrecGetWorkSpace(kinmem::KINMemPtr,lenrwBBDP::Ptr{Clong},leniwBBDP::Ptr{Clong}) + ccall((:KINBBDPrecGetWorkSpace,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong},Ptr{Clong}),kinmem,lenrwBBDP,leniwBBDP) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol_dense.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function KINDense(kinmem::Ptr{Void},N::Int) - ccall((:KINDense,libsundials_kinsol),Cint,(Ptr{Void},Clong),kinmem,N) +function KINBBDPrecGetWorkSpace(kinmem,lenrwBBDP,leniwBBDP) + __KINBBDPrecGetWorkSpace(convert(KINMemPtr,kinmem),pointer(lenrwBBDP),pointer(leniwBBDP)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol_impl.h + +function __KINBBDPrecGetNumGfnEvals(kinmem::KINMemPtr,ngevalsBBDP::Ptr{Clong}) + ccall((:KINBBDPrecGetNumGfnEvals,libsundials_kinsol),Cint,(KINMemPtr,Ptr{Clong}),kinmem,ngevalsBBDP) +end + +function KINBBDPrecGetNumGfnEvals(kinmem,ngevalsBBDP) + __KINBBDPrecGetNumGfnEvals(convert(KINMemPtr,kinmem),pointer(ngevalsBBDP)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol_dense.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function KINErrHandler(error_code::Int,_module::Ptr{UInt8},_function::Ptr{UInt8},msg::Ptr{UInt8},user_data::Ptr{Void}) - ccall((:KINErrHandler,libsundials_kinsol),Void,(Cint,Ptr{UInt8},Ptr{UInt8},Ptr{UInt8},Ptr{Void}),error_code,_module,_function,msg,user_data) + +function __KINDense(kinmem::KINMemPtr,N::Clong) + ccall((:KINDense,libsundials_kinsol),Cint,(KINMemPtr,Clong),kinmem,N) end -function KINInfoHandler(_module::Ptr{UInt8},_function::Ptr{UInt8},msg::Ptr{UInt8},user_data::Ptr{Void}) - ccall((:KINInfoHandler,libsundials_kinsol),Void,(Ptr{UInt8},Ptr{UInt8},Ptr{UInt8},Ptr{Void}),_module,_function,msg,user_data) +function KINDense(kinmem,N) + __KINDense(convert(KINMemPtr,kinmem),convert(Clong,N)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol_spbcgs.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol_impl.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol_spbcgs.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function KINSpbcg(kinmem::Ptr{Void},maxl::Int) - ccall((:KINSpbcg,libsundials_kinsol),Cint,(Ptr{Void},Cint),kinmem,maxl) + +function __KINSpbcg(kinmem::KINMemPtr,maxl::Cint) + ccall((:KINSpbcg,libsundials_kinsol),Cint,(KINMemPtr,Cint),kinmem,maxl) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol_spgmr.h + +function KINSpbcg(kinmem,maxl) + __KINSpbcg(convert(KINMemPtr,kinmem),convert(Cint,maxl)) +end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol_spgmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function KINSpgmr(kinmem::Ptr{Void},maxl::Int) - ccall((:KINSpgmr,libsundials_kinsol),Cint,(Ptr{Void},Cint),kinmem,maxl) + +function __KINSpgmr(kinmem::KINMemPtr,maxl::Cint) + ccall((:KINSpgmr,libsundials_kinsol),Cint,(KINMemPtr,Cint),kinmem,maxl) +end + +function KINSpgmr(kinmem,maxl) + __KINSpgmr(convert(KINMemPtr,kinmem),convert(Cint,maxl)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/kinsol/kinsol_sptfqmr.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol_sptfqmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -function KINSptfqmr(kinmem::Ptr{Void},maxl::Int) - ccall((:KINSptfqmr,libsundials_kinsol),Cint,(Ptr{Void},Cint),kinmem,maxl) + +function __KINSptfqmr(kinmem::KINMemPtr,maxl::Cint) + ccall((:KINSptfqmr,libsundials_kinsol),Cint,(KINMemPtr,Cint),kinmem,maxl) +end + +function KINSptfqmr(kinmem,maxl) + __KINSptfqmr(convert(KINMemPtr,kinmem),convert(Cint,maxl)) end diff --git a/src/libsundials.jl b/src/libsundials.jl index dc2de3e9..fe6c6d93 100644 --- a/src/libsundials.jl +++ b/src/libsundials.jl @@ -1,259 +1,307 @@ -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/shlib.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_band.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_config.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_dense.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_direct.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_iterative.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_nvector.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function bandGBTRF(a::Ptr{Ptr{realtype}},n::Int,mu::Int,ml::Int,smu::Int,p::Ptr{Clong}) - ccall((:bandGBTRF,shlib),Clong,(Ptr{Ptr{realtype}},Clong,Clong,Clong,Clong,Ptr{Clong}),a,n,mu,ml,smu,p) -end -function BandGBTRS(A::DlsMat,p::Ptr{Clong},b::Vector{realtype}) - ccall((:BandGBTRS,shlib),Void,(DlsMat,Ptr{Clong},Ptr{realtype}),A,p,b) +function __N_VClone(w::N_Vector) + ccall((:N_VClone,libsundials_sundials),N_Vector,(N_Vector,),w) end -function bandGBTRS(a::Ptr{Ptr{realtype}},n::Int,smu::Int,ml::Int,p::Ptr{Clong},b::Vector{realtype}) - ccall((:bandGBTRS,shlib),Void,(Ptr{Ptr{realtype}},Clong,Clong,Clong,Ptr{Clong},Ptr{realtype}),a,n,smu,ml,p,b) +function N_VClone(w) + __w = convert(NVector,w) + __N_VClone(convert(N_Vector,__w)) end -function BandCopy(A::DlsMat,B::DlsMat,copymu::Int,copyml::Int) - ccall((:BandCopy,shlib),Void,(DlsMat,DlsMat,Clong,Clong),A,B,copymu,copyml) +function __N_VCloneEmpty(w::N_Vector) + ccall((:N_VCloneEmpty,libsundials_sundials),N_Vector,(N_Vector,),w) end -function bandCopy(a::Ptr{Ptr{realtype}},b::Ptr{Ptr{realtype}},n::Int,a_smu::Int,b_smu::Int,copymu::Int,copyml::Int) - ccall((:bandCopy,shlib),Void,(Ptr{Ptr{realtype}},Ptr{Ptr{realtype}},Clong,Clong,Clong,Clong,Clong),a,b,n,a_smu,b_smu,copymu,copyml) +function N_VCloneEmpty(w) + __w = convert(NVector,w) + __N_VCloneEmpty(convert(N_Vector,__w)) end -function BandScale(c::realtype,A::DlsMat) - ccall((:BandScale,shlib),Void,(realtype,DlsMat),c,A) +function __N_VDestroy(v::N_Vector) + ccall((:N_VDestroy,libsundials_sundials),Void,(N_Vector,),v) end -function bandScale(c::realtype,a::Ptr{Ptr{realtype}},n::Int,mu::Int,ml::Int,smu::Int) - ccall((:bandScale,shlib),Void,(realtype,Ptr{Ptr{realtype}},Clong,Clong,Clong,Clong),c,a,n,mu,ml,smu) +function N_VDestroy(v) + __v = convert(NVector,v) + __N_VDestroy(convert(N_Vector,__v)) end -function bandAddIdentity(a::Ptr{Ptr{realtype}},n::Int,smu::Int) - ccall((:bandAddIdentity,shlib),Void,(Ptr{Ptr{realtype}},Clong,Clong),a,n,smu) +function __N_VSpace(v::N_Vector,lrw::Ptr{Clong},liw::Ptr{Clong}) + ccall((:N_VSpace,libsundials_sundials),Void,(N_Vector,Ptr{Clong},Ptr{Clong}),v,lrw,liw) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_config.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_dense.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function N_VSpace(v,lrw,liw) + __v = convert(NVector,v) + __N_VSpace(convert(N_Vector,__v),pointer(lrw),pointer(liw)) +end -function DenseGETRF(A::DlsMat,p::Ptr{Clong}) - ccall((:DenseGETRF,shlib),Clong,(DlsMat,Ptr{Clong}),A,p) +function __N_VGetArrayPointer(v::N_Vector) + ccall((:N_VGetArrayPointer,libsundials_sundials),Ptr{realtype},(N_Vector,),v) end -function DenseGETRS(A::DlsMat,p::Ptr{Clong},b::Vector{realtype}) - ccall((:DenseGETRS,shlib),Void,(DlsMat,Ptr{Clong},Ptr{realtype}),A,p,b) +function N_VGetArrayPointer(v) + __v = convert(NVector,v) + __N_VGetArrayPointer(convert(N_Vector,__v)) end -function denseGETRF(a::Ptr{Ptr{realtype}},m::Int,n::Int,p::Ptr{Clong}) - ccall((:denseGETRF,shlib),Clong,(Ptr{Ptr{realtype}},Clong,Clong,Ptr{Clong}),a,m,n,p) +function __N_VSetArrayPointer(v_data::Ptr{realtype},v::N_Vector) + ccall((:N_VSetArrayPointer,libsundials_sundials),Void,(Ptr{realtype},N_Vector),v_data,v) end -function denseGETRS(a::Ptr{Ptr{realtype}},n::Int,p::Ptr{Clong},b::Vector{realtype}) - ccall((:denseGETRS,shlib),Void,(Ptr{Ptr{realtype}},Clong,Ptr{Clong},Ptr{realtype}),a,n,p,b) +function N_VSetArrayPointer(v_data,v) + __v = convert(NVector,v) + __N_VSetArrayPointer(pointer(v_data),convert(N_Vector,__v)) end -function DensePOTRF(A::DlsMat) - ccall((:DensePOTRF,shlib),Clong,(DlsMat,),A) +function __N_VLinearSum(a::realtype,x::N_Vector,b::realtype,y::N_Vector,z::N_Vector) + ccall((:N_VLinearSum,libsundials_sundials),Void,(realtype,N_Vector,realtype,N_Vector,N_Vector),a,x,b,y,z) end -function DensePOTRS(A::DlsMat,b::Vector{realtype}) - ccall((:DensePOTRS,shlib),Void,(DlsMat,Ptr{realtype}),A,b) +function N_VLinearSum(a,x,b,y,z) + __x = convert(NVector,x) + __y = convert(NVector,y) + __z = convert(NVector,z) + __N_VLinearSum(a,convert(N_Vector,__x),b,convert(N_Vector,__y),convert(N_Vector,__z)) end -function densePOTRF(a::Ptr{Ptr{realtype}},m::Int) - ccall((:densePOTRF,shlib),Clong,(Ptr{Ptr{realtype}},Clong),a,m) +function __N_VConst(c::realtype,z::N_Vector) + ccall((:N_VConst,libsundials_sundials),Void,(realtype,N_Vector),c,z) end -function densePOTRS(a::Ptr{Ptr{realtype}},m::Int,b::Vector{realtype}) - ccall((:densePOTRS,shlib),Void,(Ptr{Ptr{realtype}},Clong,Ptr{realtype}),a,m,b) +function N_VConst(c,z) + __z = convert(NVector,z) + __N_VConst(c,convert(N_Vector,__z)) end -function DenseGEQRF(A::DlsMat,beta::Vector{realtype},wrk::Vector{realtype}) - ccall((:DenseGEQRF,shlib),Cint,(DlsMat,Ptr{realtype},Ptr{realtype}),A,beta,wrk) +function __N_VProd(x::N_Vector,y::N_Vector,z::N_Vector) + ccall((:N_VProd,libsundials_sundials),Void,(N_Vector,N_Vector,N_Vector),x,y,z) end -function DenseORMQR(A::DlsMat,beta::Vector{realtype},vn::Vector{realtype},vm::Vector{realtype},wrk::Vector{realtype}) - ccall((:DenseORMQR,shlib),Cint,(DlsMat,Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),A,beta,vn,vm,wrk) +function N_VProd(x,y,z) + __x = convert(NVector,x) + __y = convert(NVector,y) + __z = convert(NVector,z) + __N_VProd(convert(N_Vector,__x),convert(N_Vector,__y),convert(N_Vector,__z)) end -function denseGEQRF(a::Ptr{Ptr{realtype}},m::Int,n::Int,beta::Vector{realtype},v::Vector{realtype}) - ccall((:denseGEQRF,shlib),Cint,(Ptr{Ptr{realtype}},Clong,Clong,Ptr{realtype},Ptr{realtype}),a,m,n,beta,v) +function __N_VDiv(x::N_Vector,y::N_Vector,z::N_Vector) + ccall((:N_VDiv,libsundials_sundials),Void,(N_Vector,N_Vector,N_Vector),x,y,z) end -function denseORMQR(a::Ptr{Ptr{realtype}},m::Int,n::Int,beta::Vector{realtype},v::Vector{realtype},w::Vector{realtype},wrk::Vector{realtype}) - ccall((:denseORMQR,shlib),Cint,(Ptr{Ptr{realtype}},Clong,Clong,Ptr{realtype},Ptr{realtype},Ptr{realtype},Ptr{realtype}),a,m,n,beta,v,w,wrk) +function N_VDiv(x,y,z) + __x = convert(NVector,x) + __y = convert(NVector,y) + __z = convert(NVector,z) + __N_VDiv(convert(N_Vector,__x),convert(N_Vector,__y),convert(N_Vector,__z)) end -function DenseCopy(A::DlsMat,B::DlsMat) - ccall((:DenseCopy,shlib),Void,(DlsMat,DlsMat),A,B) +function __N_VScale(c::realtype,x::N_Vector,z::N_Vector) + ccall((:N_VScale,libsundials_sundials),Void,(realtype,N_Vector,N_Vector),c,x,z) end -function denseCopy(a::Ptr{Ptr{realtype}},b::Ptr{Ptr{realtype}},m::Int,n::Int) - ccall((:denseCopy,shlib),Void,(Ptr{Ptr{realtype}},Ptr{Ptr{realtype}},Clong,Clong),a,b,m,n) +function N_VScale(c,x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VScale(c,convert(N_Vector,__x),convert(N_Vector,__z)) end -function DenseScale(c::realtype,A::DlsMat) - ccall((:DenseScale,shlib),Void,(realtype,DlsMat),c,A) +function __N_VAbs(x::N_Vector,z::N_Vector) + ccall((:N_VAbs,libsundials_sundials),Void,(N_Vector,N_Vector),x,z) end -function denseScale(c::realtype,a::Ptr{Ptr{realtype}},m::Int,n::Int) - ccall((:denseScale,shlib),Void,(realtype,Ptr{Ptr{realtype}},Clong,Clong),c,a,m,n) +function N_VAbs(x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VAbs(convert(N_Vector,__x),convert(N_Vector,__z)) end -function denseAddIdentity(a::Ptr{Ptr{realtype}},n::Int) - ccall((:denseAddIdentity,shlib),Void,(Ptr{Ptr{realtype}},Clong),a,n) +function __N_VInv(x::N_Vector,z::N_Vector) + ccall((:N_VInv,libsundials_sundials),Void,(N_Vector,N_Vector),x,z) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_direct.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function N_VInv(x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VInv(convert(N_Vector,__x),convert(N_Vector,__z)) +end -function NewDenseMat(M::Int,N::Int) - ccall((:NewDenseMat,shlib),DlsMat,(Clong,Clong),M,N) +function __N_VAddConst(x::N_Vector,b::realtype,z::N_Vector) + ccall((:N_VAddConst,libsundials_sundials),Void,(N_Vector,realtype,N_Vector),x,b,z) end -function NewBandMat(N::Int,mu::Int,ml::Int,smu::Int) - ccall((:NewBandMat,shlib),DlsMat,(Clong,Clong,Clong,Clong),N,mu,ml,smu) +function N_VAddConst(x,b,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VAddConst(convert(N_Vector,__x),b,convert(N_Vector,__z)) end -function DestroyMat(A::DlsMat) - ccall((:DestroyMat,shlib),Void,(DlsMat,),A) +function __N_VDotProd(x::N_Vector,y::N_Vector) + ccall((:N_VDotProd,libsundials_sundials),realtype,(N_Vector,N_Vector),x,y) end -function NewIntArray(N::Int) - ccall((:NewIntArray,shlib),Ptr{Cint},(Cint,),N) +function N_VDotProd(x,y) + __x = convert(NVector,x) + __y = convert(NVector,y) + __N_VDotProd(convert(N_Vector,__x),convert(N_Vector,__y)) end -function NewLintArray(N::Int) - ccall((:NewLintArray,shlib),Ptr{Clong},(Clong,),N) +function __N_VMaxNorm(x::N_Vector) + ccall((:N_VMaxNorm,libsundials_sundials),realtype,(N_Vector,),x) end -function NewRealArray(N::Int) - ccall((:NewRealArray,shlib),Ptr{realtype},(Clong,),N) +function N_VMaxNorm(x) + __x = convert(NVector,x) + __N_VMaxNorm(convert(N_Vector,__x)) end -function DestroyArray(p::Ptr{Void}) - ccall((:DestroyArray,shlib),Void,(Ptr{Void},),p) +function __N_VWrmsNorm(x::N_Vector,w::N_Vector) + ccall((:N_VWrmsNorm,libsundials_sundials),realtype,(N_Vector,N_Vector),x,w) end -function AddIdentity(A::DlsMat) - ccall((:AddIdentity,shlib),Void,(DlsMat,),A) +function N_VWrmsNorm(x,w) + __x = convert(NVector,x) + __w = convert(NVector,w) + __N_VWrmsNorm(convert(N_Vector,__x),convert(N_Vector,__w)) end -function SetToZero(A::DlsMat) - ccall((:SetToZero,shlib),Void,(DlsMat,),A) +function __N_VWrmsNormMask(x::N_Vector,w::N_Vector,id::N_Vector) + ccall((:N_VWrmsNormMask,libsundials_sundials),realtype,(N_Vector,N_Vector,N_Vector),x,w,id) end -function PrintMat(A::DlsMat) - ccall((:PrintMat,shlib),Void,(DlsMat,),A) +function N_VWrmsNormMask(x,w,id) + __x = convert(NVector,x) + __w = convert(NVector,w) + __id = convert(NVector,id) + __N_VWrmsNormMask(convert(N_Vector,__x),convert(N_Vector,__w),convert(N_Vector,__id)) end -function newDenseMat(m::Int,n::Int) - ccall((:newDenseMat,shlib),Ptr{Ptr{realtype}},(Clong,Clong),m,n) +function __N_VMin(x::N_Vector) + ccall((:N_VMin,libsundials_sundials),realtype,(N_Vector,),x) end -function newBandMat(n::Int,smu::Int,ml::Int) - ccall((:newBandMat,shlib),Ptr{Ptr{realtype}},(Clong,Clong,Clong),n,smu,ml) +function N_VMin(x) + __x = convert(NVector,x) + __N_VMin(convert(N_Vector,__x)) end -function destroyMat(a::Ptr{Ptr{realtype}}) - ccall((:destroyMat,shlib),Void,(Ptr{Ptr{realtype}},),a) +function __N_VWL2Norm(x::N_Vector,w::N_Vector) + ccall((:N_VWL2Norm,libsundials_sundials),realtype,(N_Vector,N_Vector),x,w) end -function newIntArray(n::Int) - ccall((:newIntArray,shlib),Ptr{Cint},(Cint,),n) +function N_VWL2Norm(x,w) + __x = convert(NVector,x) + __w = convert(NVector,w) + __N_VWL2Norm(convert(N_Vector,__x),convert(N_Vector,__w)) end -function newLintArray(n::Int) - ccall((:newLintArray,shlib),Ptr{Clong},(Clong,),n) +function __N_VL1Norm(x::N_Vector) + ccall((:N_VL1Norm,libsundials_sundials),realtype,(N_Vector,),x) end -function newRealArray(m::Int) - ccall((:newRealArray,shlib),Ptr{realtype},(Clong,),m) +function N_VL1Norm(x) + __x = convert(NVector,x) + __N_VL1Norm(convert(N_Vector,__x)) end -function destroyArray(v::Ptr{Void}) - ccall((:destroyArray,shlib),Void,(Ptr{Void},),v) +function __N_VCompare(c::realtype,x::N_Vector,z::N_Vector) + ccall((:N_VCompare,libsundials_sundials),Void,(realtype,N_Vector,N_Vector),c,x,z) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_iterative.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function ModifiedGS(v::Ptr{N_Vector},h::Ptr{Ptr{realtype}},k::Int,p::Int,new_vk_norm::Vector{realtype}) - ccall((:ModifiedGS,shlib),Cint,(Ptr{N_Vector},Ptr{Ptr{realtype}},Cint,Cint,Ptr{realtype}),v,h,k,p,new_vk_norm) +function N_VCompare(c,x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VCompare(c,convert(N_Vector,__x),convert(N_Vector,__z)) end -function ClassicalGS(v::Ptr{N_Vector},h::Ptr{Ptr{realtype}},k::Int,p::Int,new_vk_norm::Vector{realtype},temp::N_Vector,s::Vector{realtype}) - ccall((:ClassicalGS,shlib),Cint,(Ptr{N_Vector},Ptr{Ptr{realtype}},Cint,Cint,Ptr{realtype},N_Vector,Ptr{realtype}),v,h,k,p,new_vk_norm,temp,s) +function __N_VInvTest(x::N_Vector,z::N_Vector) + ccall((:N_VInvTest,libsundials_sundials),Cint,(N_Vector,N_Vector),x,z) end -function QRfact(n::Int,h::Ptr{Ptr{realtype}},q::Vector{realtype},job::Int) - ccall((:QRfact,shlib),Cint,(Cint,Ptr{Ptr{realtype}},Ptr{realtype},Cint),n,h,q,job) +function N_VInvTest(x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VInvTest(convert(N_Vector,__x),convert(N_Vector,__z)) end -function QRsol(n::Int,h::Ptr{Ptr{realtype}},q::Vector{realtype},b::Vector{realtype}) - ccall((:QRsol,shlib),Cint,(Cint,Ptr{Ptr{realtype}},Ptr{realtype},Ptr{realtype}),n,h,q,b) +function __N_VConstrMask(c::N_Vector,x::N_Vector,m::N_Vector) + ccall((:N_VConstrMask,libsundials_sundials),Cint,(N_Vector,N_Vector,N_Vector),c,x,m) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_spbcgs.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function N_VConstrMask(c,x,m) + __c = convert(NVector,c) + __x = convert(NVector,x) + __m = convert(NVector,m) + __N_VConstrMask(convert(N_Vector,__c),convert(N_Vector,__x),convert(N_Vector,__m)) +end +function __N_VMinQuotient(num::N_Vector,denom::N_Vector) + ccall((:N_VMinQuotient,libsundials_sundials),realtype,(N_Vector,N_Vector),num,denom) +end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_spgmr.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 +function N_VMinQuotient(num,denom) + __num = convert(NVector,num) + __denom = convert(NVector,denom) + __N_VMinQuotient(convert(N_Vector,__num),convert(N_Vector,__denom)) +end -function SpgmrMalloc(l_max::Int,vec_tmpl::N_Vector) - ccall((:SpgmrMalloc,shlib),SpgmrMem,(Cint,N_Vector),l_max,vec_tmpl) +function __N_VCloneEmptyVectorArray(count::Cint,w::N_Vector) + ccall((:N_VCloneEmptyVectorArray,libsundials_sundials),Ptr{N_Vector},(Cint,N_Vector),count,w) end -function SpgmrSolve(mem::SpgmrMem,A_data::Ptr{Void},x::N_Vector,b::N_Vector,pretype::Int,gstype::Int,delta::realtype,max_restarts::Int,P_data::Ptr{Void},s1::N_Vector,s2::N_Vector,atimes::ATimesFn,psolve::PSolveFn,res_norm::Vector{realtype},nli::Ptr{Cint},nps::Ptr{Cint}) - ccall((:SpgmrSolve,shlib),Cint,(SpgmrMem,Ptr{Void},N_Vector,N_Vector,Cint,Cint,realtype,Cint,Ptr{Void},N_Vector,N_Vector,ATimesFn,PSolveFn,Ptr{realtype},Ptr{Cint},Ptr{Cint}),mem,A_data,x,b,pretype,gstype,delta,max_restarts,P_data,s1,s2,atimes,psolve,res_norm,nli,nps) +function N_VCloneEmptyVectorArray(count,w) + __w = convert(NVector,w) + __N_VCloneEmptyVectorArray(convert(Cint,count),convert(N_Vector,__w)) end -function SpgmrFree(mem::SpgmrMem) - ccall((:SpgmrFree,shlib),Void,(SpgmrMem,),mem) +function __N_VCloneVectorArray(count::Cint,w::N_Vector) + ccall((:N_VCloneVectorArray,libsundials_sundials),Ptr{N_Vector},(Cint,N_Vector),count,w) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_sptfqmr.h -# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function SptfqmrMalloc(l_max::Int,vec_tmpl::N_Vector) - ccall((:SptfqmrMalloc,shlib),SptfqmrMem,(Cint,N_Vector),l_max,vec_tmpl) +function N_VCloneVectorArray(count,w) + __w = convert(NVector,w) + __N_VCloneVectorArray(convert(Cint,count),convert(N_Vector,__w)) end -function SptfqmrSolve(mem::SptfqmrMem,A_data::Ptr{Void},x::N_Vector,b::N_Vector,pretype::Int,delta::realtype,P_data::Ptr{Void},sx::N_Vector,sb::N_Vector,atimes::ATimesFn,psolve::PSolveFn,res_norm::Vector{realtype},nli::Ptr{Cint},nps::Ptr{Cint}) - ccall((:SptfqmrSolve,shlib),Cint,(SptfqmrMem,Ptr{Void},N_Vector,N_Vector,Cint,realtype,Ptr{Void},N_Vector,N_Vector,ATimesFn,PSolveFn,Ptr{realtype},Ptr{Cint},Ptr{Cint}),mem,A_data,x,b,pretype,delta,P_data,sx,sb,atimes,psolve,res_norm,nli,nps) +function __N_VDestroyVectorArray(vs::Ptr{N_Vector},count::Cint) + ccall((:N_VDestroyVectorArray,libsundials_sundials),Void,(Ptr{N_Vector},Cint),vs,count) end -function SptfqmrFree(mem::SptfqmrMem) - ccall((:SptfqmrFree,shlib),Void,(SptfqmrMem,),mem) +function N_VDestroyVectorArray(vs,count) + __N_VDestroyVectorArray(pointer(vs),convert(Cint,count)) end -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_types.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_spbcgs.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_fnvector.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_spgmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/sundials/sundials_math.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_sptfqmr.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_types.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function RPowerI(base::realtype,exponent::Int) - ccall((:RPowerI,shlib),realtype,(realtype,Cint),base,exponent) -end - -function RPowerR(base::realtype,exponent::realtype) - ccall((:RPowerR,shlib),realtype,(realtype,realtype),base,exponent) -end - -function RSqrt(x::realtype) - ccall((:RSqrt,shlib),realtype,(realtype,),x) -end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_fnvector.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function RAbs(x::realtype) - ccall((:RAbs,shlib),realtype,(realtype,),x) -end +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/sundials/sundials_math.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function RExp(x::realtype) - ccall((:RExp,shlib),realtype,(realtype,),x) -end diff --git a/src/nvector.jl b/src/nvector.jl index 302ec413..ba1b8745 100644 --- a/src/nvector.jl +++ b/src/nvector.jl @@ -1,243 +1,310 @@ -# Julia wrapper for header: /Users/jgoldfar/.julia/v0.4/Sundials/deps/usr/include/nvector/shlib.h +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/nvector/nvector_parallel.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 +# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/nvector/nvector_serial.h +# Automatically generated using Clang.jl wrap_c, version 0.0.0 -function N_VClone(w::N_Vector) - ccall((:N_VClone,libsundials_nvecserial),N_Vector,(N_Vector,),w) -end -function N_VCloneEmpty(w::N_Vector) - ccall((:N_VCloneEmpty,libsundials_nvecserial),N_Vector,(N_Vector,),w) +function __N_VNew_Serial(vec_length::Clong) + ccall((:N_VNew_Serial,libsundials_nvecserial),N_Vector,(Clong,),vec_length) end -function N_VDestroy(v::N_Vector) - ccall((:N_VDestroy,libsundials_nvecserial),Void,(N_Vector,),v) +function N_VNew_Serial(vec_length) + __N_VNew_Serial(convert(Clong,vec_length)) end -function N_VSpace(v::N_Vector,lrw::Ptr{Clong},liw::Ptr{Clong}) - ccall((:N_VSpace,libsundials_nvecserial),Void,(N_Vector,Ptr{Clong},Ptr{Clong}),v,lrw,liw) +function __N_VNewEmpty_Serial(vec_length::Clong) + ccall((:N_VNewEmpty_Serial,libsundials_nvecserial),N_Vector,(Clong,),vec_length) end -function N_VGetArrayPointer(v::N_Vector) - ccall((:N_VGetArrayPointer,libsundials_nvecserial),Ptr{realtype},(N_Vector,),v) +function N_VNewEmpty_Serial(vec_length) + __N_VNewEmpty_Serial(convert(Clong,vec_length)) end -function N_VSetArrayPointer(v_data::Vector{realtype},v::N_Vector) - ccall((:N_VSetArrayPointer,libsundials_nvecserial),Void,(Ptr{realtype},N_Vector),v_data,v) +function __N_VMake_Serial(vec_length::Clong,v_data::Ptr{realtype}) + ccall((:N_VMake_Serial,libsundials_nvecserial),N_Vector,(Clong,Ptr{realtype}),vec_length,v_data) end -function N_VLinearSum(a::realtype,x::N_Vector,b::realtype,y::N_Vector,z::N_Vector) - ccall((:N_VLinearSum,libsundials_nvecserial),Void,(realtype,N_Vector,realtype,N_Vector,N_Vector),a,x,b,y,z) +function N_VMake_Serial(vec_length,v_data) + __N_VMake_Serial(convert(Clong,vec_length),pointer(v_data)) end -function N_VConst(c::realtype,z::N_Vector) - ccall((:N_VConst,libsundials_nvecserial),Void,(realtype,N_Vector),c,z) +function __N_VCloneVectorArray_Serial(count::Cint,w::N_Vector) + ccall((:N_VCloneVectorArray_Serial,libsundials_nvecserial),Ptr{N_Vector},(Cint,N_Vector),count,w) end -function N_VProd(x::N_Vector,y::N_Vector,z::N_Vector) - ccall((:N_VProd,libsundials_nvecserial),Void,(N_Vector,N_Vector,N_Vector),x,y,z) +function N_VCloneVectorArray_Serial(count,w) + __w = convert(NVector,w) + __N_VCloneVectorArray_Serial(convert(Cint,count),convert(N_Vector,__w)) end -function N_VDiv(x::N_Vector,y::N_Vector,z::N_Vector) - ccall((:N_VDiv,libsundials_nvecserial),Void,(N_Vector,N_Vector,N_Vector),x,y,z) +function __N_VCloneVectorArrayEmpty_Serial(count::Cint,w::N_Vector) + ccall((:N_VCloneVectorArrayEmpty_Serial,libsundials_nvecserial),Ptr{N_Vector},(Cint,N_Vector),count,w) end -function N_VScale(c::realtype,x::N_Vector,z::N_Vector) - ccall((:N_VScale,libsundials_nvecserial),Void,(realtype,N_Vector,N_Vector),c,x,z) +function N_VCloneVectorArrayEmpty_Serial(count,w) + __w = convert(NVector,w) + __N_VCloneVectorArrayEmpty_Serial(convert(Cint,count),convert(N_Vector,__w)) end -function N_VAbs(x::N_Vector,z::N_Vector) - ccall((:N_VAbs,libsundials_nvecserial),Void,(N_Vector,N_Vector),x,z) +function __N_VDestroyVectorArray_Serial(vs::Ptr{N_Vector},count::Cint) + ccall((:N_VDestroyVectorArray_Serial,libsundials_nvecserial),Void,(Ptr{N_Vector},Cint),vs,count) end -function N_VInv(x::N_Vector,z::N_Vector) - ccall((:N_VInv,libsundials_nvecserial),Void,(N_Vector,N_Vector),x,z) +function N_VDestroyVectorArray_Serial(vs,count) + __N_VDestroyVectorArray_Serial(pointer(vs),convert(Cint,count)) end -function N_VAddConst(x::N_Vector,b::realtype,z::N_Vector) - ccall((:N_VAddConst,libsundials_nvecserial),Void,(N_Vector,realtype,N_Vector),x,b,z) +function __N_VPrint_Serial(v::N_Vector) + ccall((:N_VPrint_Serial,libsundials_nvecserial),Void,(N_Vector,),v) end -function N_VDotProd(x::N_Vector,y::N_Vector) - ccall((:N_VDotProd,libsundials_nvecserial),realtype,(N_Vector,N_Vector),x,y) +function N_VPrint_Serial(v) + __v = convert(NVector,v) + __N_VPrint_Serial(convert(N_Vector,__v)) end -function N_VMaxNorm(x::N_Vector) - ccall((:N_VMaxNorm,libsundials_nvecserial),realtype,(N_Vector,),x) +function __N_VCloneEmpty_Serial(w::N_Vector) + ccall((:N_VCloneEmpty_Serial,libsundials_nvecserial),N_Vector,(N_Vector,),w) end -function N_VWrmsNorm(x::N_Vector,w::N_Vector) - ccall((:N_VWrmsNorm,libsundials_nvecserial),realtype,(N_Vector,N_Vector),x,w) +function N_VCloneEmpty_Serial(w) + __w = convert(NVector,w) + __N_VCloneEmpty_Serial(convert(N_Vector,__w)) end -function N_VWrmsNormMask(x::N_Vector,w::N_Vector,id::N_Vector) - ccall((:N_VWrmsNormMask,libsundials_nvecserial),realtype,(N_Vector,N_Vector,N_Vector),x,w,id) +function __N_VClone_Serial(w::N_Vector) + ccall((:N_VClone_Serial,libsundials_nvecserial),N_Vector,(N_Vector,),w) end -function N_VMin(x::N_Vector) - ccall((:N_VMin,libsundials_nvecserial),realtype,(N_Vector,),x) +function N_VClone_Serial(w) + __w = convert(NVector,w) + __N_VClone_Serial(convert(N_Vector,__w)) end -function N_VWL2Norm(x::N_Vector,w::N_Vector) - ccall((:N_VWL2Norm,libsundials_nvecserial),realtype,(N_Vector,N_Vector),x,w) +function __N_VDestroy_Serial(v::N_Vector) + ccall((:N_VDestroy_Serial,libsundials_nvecserial),Void,(N_Vector,),v) end -function N_VL1Norm(x::N_Vector) - ccall((:N_VL1Norm,libsundials_nvecserial),realtype,(N_Vector,),x) +function N_VDestroy_Serial(v) + __v = convert(NVector,v) + __N_VDestroy_Serial(convert(N_Vector,__v)) end -function N_VCompare(c::realtype,x::N_Vector,z::N_Vector) - ccall((:N_VCompare,libsundials_nvecserial),Void,(realtype,N_Vector,N_Vector),c,x,z) +function __N_VSpace_Serial(v::N_Vector,lrw::Ptr{Clong},liw::Ptr{Clong}) + ccall((:N_VSpace_Serial,libsundials_nvecserial),Void,(N_Vector,Ptr{Clong},Ptr{Clong}),v,lrw,liw) end -function N_VInvTest(x::N_Vector,z::N_Vector) - ccall((:N_VInvTest,libsundials_nvecserial),Cint,(N_Vector,N_Vector),x,z) +function N_VSpace_Serial(v,lrw,liw) + __v = convert(NVector,v) + __N_VSpace_Serial(convert(N_Vector,__v),pointer(lrw),pointer(liw)) end -function N_VConstrMask(c::N_Vector,x::N_Vector,m::N_Vector) - ccall((:N_VConstrMask,libsundials_nvecserial),Cint,(N_Vector,N_Vector,N_Vector),c,x,m) +function __N_VGetArrayPointer_Serial(v::N_Vector) + ccall((:N_VGetArrayPointer_Serial,libsundials_nvecserial),Ptr{realtype},(N_Vector,),v) end -function N_VMinQuotient(num::N_Vector,denom::N_Vector) - ccall((:N_VMinQuotient,libsundials_nvecserial),realtype,(N_Vector,N_Vector),num,denom) +function N_VGetArrayPointer_Serial(v) + __v = convert(NVector,v) + __N_VGetArrayPointer_Serial(convert(N_Vector,__v)) end -function N_VCloneEmptyVectorArray(count::Int,w::N_Vector) - ccall((:N_VCloneEmptyVectorArray,libsundials_nvecserial),Ptr{N_Vector},(Cint,N_Vector),count,w) +function __N_VSetArrayPointer_Serial(v_data::Ptr{realtype},v::N_Vector) + ccall((:N_VSetArrayPointer_Serial,libsundials_nvecserial),Void,(Ptr{realtype},N_Vector),v_data,v) end -function N_VCloneVectorArray(count::Int,w::N_Vector) - ccall((:N_VCloneVectorArray,libsundials_nvecserial),Ptr{N_Vector},(Cint,N_Vector),count,w) +function N_VSetArrayPointer_Serial(v_data,v) + __v = convert(NVector,v) + __N_VSetArrayPointer_Serial(pointer(v_data),convert(N_Vector,__v)) end -function N_VDestroyVectorArray(vs::Ptr{N_Vector},count::Int) - ccall((:N_VDestroyVectorArray,libsundials_nvecserial),Void,(Ptr{N_Vector},Cint),vs,count) +function __N_VLinearSum_Serial(a::realtype,x::N_Vector,b::realtype,y::N_Vector,z::N_Vector) + ccall((:N_VLinearSum_Serial,libsundials_nvecserial),Void,(realtype,N_Vector,realtype,N_Vector,N_Vector),a,x,b,y,z) end -function N_VNew_Serial(vec_length::Int) - ccall((:N_VNew_Serial,libsundials_nvecserial),N_Vector,(Clong,),vec_length) +function N_VLinearSum_Serial(a,x,b,y,z) + __x = convert(NVector,x) + __y = convert(NVector,y) + __z = convert(NVector,z) + __N_VLinearSum_Serial(a,convert(N_Vector,__x),b,convert(N_Vector,__y),convert(N_Vector,__z)) end -function N_VNewEmpty_Serial(vec_length::Int) - ccall((:N_VNewEmpty_Serial,libsundials_nvecserial),N_Vector,(Clong,),vec_length) +function __N_VConst_Serial(c::realtype,z::N_Vector) + ccall((:N_VConst_Serial,libsundials_nvecserial),Void,(realtype,N_Vector),c,z) end -function N_VMake_Serial(vec_length::Int,v_data::Vector{realtype}) - ccall((:N_VMake_Serial,libsundials_nvecserial),N_Vector,(Clong,Ptr{realtype}),vec_length,v_data) +function N_VConst_Serial(c,z) + __z = convert(NVector,z) + __N_VConst_Serial(c,convert(N_Vector,__z)) end -function N_VCloneVectorArray_Serial(count::Int,w::N_Vector) - ccall((:N_VCloneVectorArray_Serial,libsundials_nvecserial),Ptr{N_Vector},(Cint,N_Vector),count,w) +function __N_VProd_Serial(x::N_Vector,y::N_Vector,z::N_Vector) + ccall((:N_VProd_Serial,libsundials_nvecserial),Void,(N_Vector,N_Vector,N_Vector),x,y,z) end -function N_VCloneVectorArrayEmpty_Serial(count::Int,w::N_Vector) - ccall((:N_VCloneVectorArrayEmpty_Serial,libsundials_nvecserial),Ptr{N_Vector},(Cint,N_Vector),count,w) +function N_VProd_Serial(x,y,z) + __x = convert(NVector,x) + __y = convert(NVector,y) + __z = convert(NVector,z) + __N_VProd_Serial(convert(N_Vector,__x),convert(N_Vector,__y),convert(N_Vector,__z)) end -function N_VDestroyVectorArray_Serial(vs::Ptr{N_Vector},count::Int) - ccall((:N_VDestroyVectorArray_Serial,libsundials_nvecserial),Void,(Ptr{N_Vector},Cint),vs,count) +function __N_VDiv_Serial(x::N_Vector,y::N_Vector,z::N_Vector) + ccall((:N_VDiv_Serial,libsundials_nvecserial),Void,(N_Vector,N_Vector,N_Vector),x,y,z) end -function N_VPrint_Serial(v::N_Vector) - ccall((:N_VPrint_Serial,libsundials_nvecserial),Void,(N_Vector,),v) +function N_VDiv_Serial(x,y,z) + __x = convert(NVector,x) + __y = convert(NVector,y) + __z = convert(NVector,z) + __N_VDiv_Serial(convert(N_Vector,__x),convert(N_Vector,__y),convert(N_Vector,__z)) end -function N_VCloneEmpty_Serial(w::N_Vector) - ccall((:N_VCloneEmpty_Serial,libsundials_nvecserial),N_Vector,(N_Vector,),w) +function __N_VScale_Serial(c::realtype,x::N_Vector,z::N_Vector) + ccall((:N_VScale_Serial,libsundials_nvecserial),Void,(realtype,N_Vector,N_Vector),c,x,z) end -function N_VClone_Serial(w::N_Vector) - ccall((:N_VClone_Serial,libsundials_nvecserial),N_Vector,(N_Vector,),w) +function N_VScale_Serial(c,x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VScale_Serial(c,convert(N_Vector,__x),convert(N_Vector,__z)) end -function N_VDestroy_Serial(v::N_Vector) - ccall((:N_VDestroy_Serial,libsundials_nvecserial),Void,(N_Vector,),v) +function __N_VAbs_Serial(x::N_Vector,z::N_Vector) + ccall((:N_VAbs_Serial,libsundials_nvecserial),Void,(N_Vector,N_Vector),x,z) end -function N_VSpace_Serial(v::N_Vector,lrw::Ptr{Clong},liw::Ptr{Clong}) - ccall((:N_VSpace_Serial,libsundials_nvecserial),Void,(N_Vector,Ptr{Clong},Ptr{Clong}),v,lrw,liw) +function N_VAbs_Serial(x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VAbs_Serial(convert(N_Vector,__x),convert(N_Vector,__z)) end -function N_VGetArrayPointer_Serial(v::N_Vector) - ccall((:N_VGetArrayPointer_Serial,libsundials_nvecserial),Ptr{realtype},(N_Vector,),v) +function __N_VInv_Serial(x::N_Vector,z::N_Vector) + ccall((:N_VInv_Serial,libsundials_nvecserial),Void,(N_Vector,N_Vector),x,z) end -function N_VSetArrayPointer_Serial(v_data::Vector{realtype},v::N_Vector) - ccall((:N_VSetArrayPointer_Serial,libsundials_nvecserial),Void,(Ptr{realtype},N_Vector),v_data,v) +function N_VInv_Serial(x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VInv_Serial(convert(N_Vector,__x),convert(N_Vector,__z)) end -function N_VLinearSum_Serial(a::realtype,x::N_Vector,b::realtype,y::N_Vector,z::N_Vector) - ccall((:N_VLinearSum_Serial,libsundials_nvecserial),Void,(realtype,N_Vector,realtype,N_Vector,N_Vector),a,x,b,y,z) +function __N_VAddConst_Serial(x::N_Vector,b::realtype,z::N_Vector) + ccall((:N_VAddConst_Serial,libsundials_nvecserial),Void,(N_Vector,realtype,N_Vector),x,b,z) end -function N_VConst_Serial(c::realtype,z::N_Vector) - ccall((:N_VConst_Serial,libsundials_nvecserial),Void,(realtype,N_Vector),c,z) +function N_VAddConst_Serial(x,b,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VAddConst_Serial(convert(N_Vector,__x),b,convert(N_Vector,__z)) end -function N_VProd_Serial(x::N_Vector,y::N_Vector,z::N_Vector) - ccall((:N_VProd_Serial,libsundials_nvecserial),Void,(N_Vector,N_Vector,N_Vector),x,y,z) +function __N_VDotProd_Serial(x::N_Vector,y::N_Vector) + ccall((:N_VDotProd_Serial,libsundials_nvecserial),realtype,(N_Vector,N_Vector),x,y) end -function N_VDiv_Serial(x::N_Vector,y::N_Vector,z::N_Vector) - ccall((:N_VDiv_Serial,libsundials_nvecserial),Void,(N_Vector,N_Vector,N_Vector),x,y,z) +function N_VDotProd_Serial(x,y) + __x = convert(NVector,x) + __y = convert(NVector,y) + __N_VDotProd_Serial(convert(N_Vector,__x),convert(N_Vector,__y)) end -function N_VScale_Serial(c::realtype,x::N_Vector,z::N_Vector) - ccall((:N_VScale_Serial,libsundials_nvecserial),Void,(realtype,N_Vector,N_Vector),c,x,z) +function __N_VMaxNorm_Serial(x::N_Vector) + ccall((:N_VMaxNorm_Serial,libsundials_nvecserial),realtype,(N_Vector,),x) end -function N_VAbs_Serial(x::N_Vector,z::N_Vector) - ccall((:N_VAbs_Serial,libsundials_nvecserial),Void,(N_Vector,N_Vector),x,z) +function N_VMaxNorm_Serial(x) + __x = convert(NVector,x) + __N_VMaxNorm_Serial(convert(N_Vector,__x)) end -function N_VInv_Serial(x::N_Vector,z::N_Vector) - ccall((:N_VInv_Serial,libsundials_nvecserial),Void,(N_Vector,N_Vector),x,z) +function __N_VWrmsNorm_Serial(x::N_Vector,w::N_Vector) + ccall((:N_VWrmsNorm_Serial,libsundials_nvecserial),realtype,(N_Vector,N_Vector),x,w) end -function N_VAddConst_Serial(x::N_Vector,b::realtype,z::N_Vector) - ccall((:N_VAddConst_Serial,libsundials_nvecserial),Void,(N_Vector,realtype,N_Vector),x,b,z) +function N_VWrmsNorm_Serial(x,w) + __x = convert(NVector,x) + __w = convert(NVector,w) + __N_VWrmsNorm_Serial(convert(N_Vector,__x),convert(N_Vector,__w)) end -function N_VDotProd_Serial(x::N_Vector,y::N_Vector) - ccall((:N_VDotProd_Serial,libsundials_nvecserial),realtype,(N_Vector,N_Vector),x,y) +function __N_VWrmsNormMask_Serial(x::N_Vector,w::N_Vector,id::N_Vector) + ccall((:N_VWrmsNormMask_Serial,libsundials_nvecserial),realtype,(N_Vector,N_Vector,N_Vector),x,w,id) end -function N_VMaxNorm_Serial(x::N_Vector) - ccall((:N_VMaxNorm_Serial,libsundials_nvecserial),realtype,(N_Vector,),x) +function N_VWrmsNormMask_Serial(x,w,id) + __x = convert(NVector,x) + __w = convert(NVector,w) + __id = convert(NVector,id) + __N_VWrmsNormMask_Serial(convert(N_Vector,__x),convert(N_Vector,__w),convert(N_Vector,__id)) end -function N_VWrmsNorm_Serial(x::N_Vector,w::N_Vector) - ccall((:N_VWrmsNorm_Serial,libsundials_nvecserial),realtype,(N_Vector,N_Vector),x,w) +function __N_VMin_Serial(x::N_Vector) + ccall((:N_VMin_Serial,libsundials_nvecserial),realtype,(N_Vector,),x) end -function N_VWrmsNormMask_Serial(x::N_Vector,w::N_Vector,id::N_Vector) - ccall((:N_VWrmsNormMask_Serial,libsundials_nvecserial),realtype,(N_Vector,N_Vector,N_Vector),x,w,id) +function N_VMin_Serial(x) + __x = convert(NVector,x) + __N_VMin_Serial(convert(N_Vector,__x)) end -function N_VMin_Serial(x::N_Vector) - ccall((:N_VMin_Serial,libsundials_nvecserial),realtype,(N_Vector,),x) +function __N_VWL2Norm_Serial(x::N_Vector,w::N_Vector) + ccall((:N_VWL2Norm_Serial,libsundials_nvecserial),realtype,(N_Vector,N_Vector),x,w) end -function N_VWL2Norm_Serial(x::N_Vector,w::N_Vector) - ccall((:N_VWL2Norm_Serial,libsundials_nvecserial),realtype,(N_Vector,N_Vector),x,w) +function N_VWL2Norm_Serial(x,w) + __x = convert(NVector,x) + __w = convert(NVector,w) + __N_VWL2Norm_Serial(convert(N_Vector,__x),convert(N_Vector,__w)) end -function N_VL1Norm_Serial(x::N_Vector) +function __N_VL1Norm_Serial(x::N_Vector) ccall((:N_VL1Norm_Serial,libsundials_nvecserial),realtype,(N_Vector,),x) end -function N_VCompare_Serial(c::realtype,x::N_Vector,z::N_Vector) +function N_VL1Norm_Serial(x) + __x = convert(NVector,x) + __N_VL1Norm_Serial(convert(N_Vector,__x)) +end + +function __N_VCompare_Serial(c::realtype,x::N_Vector,z::N_Vector) ccall((:N_VCompare_Serial,libsundials_nvecserial),Void,(realtype,N_Vector,N_Vector),c,x,z) end -function N_VInvTest_Serial(x::N_Vector,z::N_Vector) +function N_VCompare_Serial(c,x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VCompare_Serial(c,convert(N_Vector,__x),convert(N_Vector,__z)) +end + +function __N_VInvTest_Serial(x::N_Vector,z::N_Vector) ccall((:N_VInvTest_Serial,libsundials_nvecserial),Cint,(N_Vector,N_Vector),x,z) end -function N_VConstrMask_Serial(c::N_Vector,x::N_Vector,m::N_Vector) +function N_VInvTest_Serial(x,z) + __x = convert(NVector,x) + __z = convert(NVector,z) + __N_VInvTest_Serial(convert(N_Vector,__x),convert(N_Vector,__z)) +end + +function __N_VConstrMask_Serial(c::N_Vector,x::N_Vector,m::N_Vector) ccall((:N_VConstrMask_Serial,libsundials_nvecserial),Cint,(N_Vector,N_Vector,N_Vector),c,x,m) end -function N_VMinQuotient_Serial(num::N_Vector,denom::N_Vector) +function N_VConstrMask_Serial(c,x,m) + __c = convert(NVector,c) + __x = convert(NVector,x) + __m = convert(NVector,m) + __N_VConstrMask_Serial(convert(N_Vector,__c),convert(N_Vector,__x),convert(N_Vector,__m)) +end + +function __N_VMinQuotient_Serial(num::N_Vector,denom::N_Vector) ccall((:N_VMinQuotient_Serial,libsundials_nvecserial),realtype,(N_Vector,N_Vector),num,denom) end + +function N_VMinQuotient_Serial(num,denom) + __num = convert(NVector,num) + __denom = convert(NVector,denom) + __N_VMinQuotient_Serial(convert(N_Vector,__num),convert(N_Vector,__denom)) +end diff --git a/src/nvector_wrapper.jl b/src/nvector_wrapper.jl new file mode 100644 index 00000000..4891685d --- /dev/null +++ b/src/nvector_wrapper.jl @@ -0,0 +1,77 @@ +""" + Wrapper for Sundials `N_Vector` that + uses Julia `Vector{realtype}` as the data container. + + Implements `DenseVector` interface and + manages automatic destruction of the referenced `N_Vector` when it is + no longer in use. +""" +immutable NVector <: DenseVector{realtype} + ref_nv::Ref{N_Vector} # reference to N_Vector + v::Vector{realtype} # array that is referenced by N_Vector + + function NVector(v::Vector{realtype}) + # note that N_VMake_Serial() creates N_Vector doesn't own the data, + # so calling N_VDestroy_Serial() would not deallocate v + nv = new(Ref{N_Vector}(N_VMake_Serial(length(v), v)), v) + finalizer(nv.ref_nv, release_handle) + return nv + end + + function NVector(nv::N_Vector) + # wrap N_Vector into NVector and get non-owning access to `nv` data + # via `v`, but don't register finalizer for `nv` + return new(Ref{N_Vector}(nv), asarray(nv)) + end +end + +release_handle(ref_nv::Ref{N_Vector}) = N_VDestroy_Serial(ref_nv[]) + +Base.size(nv::NVector, d...) = size(nv.v, d...) +Base.stride(nv::NVector, d::Integer) = stride(nv.v, d) + +Base.getindex(nv::NVector, i::Real) = getindex(nv.v, i) +Base.getindex(nv::NVector, i::AbstractArray) = getindex(nv.v, i) +Base.getindex(nv::NVector, inds...) = getindex(nv.v, inds...) + +Base.setindex!(nv::NVector, X, i::Real) = setindex!(nv.v, X, i) +Base.setindex!(nv::NVector, X, i::AbstractArray) = setindex!(nv.v, X, i) +Base.setindex!(nv::NVector, X, inds...) = setindex!(nv.v, X, inds...) + +################################################################## +# +# Methods to convert between Julia Vectors and Sundials N_Vectors. +# +################################################################## + +Base.convert(::Type{NVector}, v::Vector{realtype}) = NVector(v) +Base.convert{T<:Real}(::Type{NVector}, v::Vector{T}) = NVector(copy!(similar(v, realtype), v)) +Base.convert(::Type{NVector}, nv::NVector) = nv +Base.convert(::Type{NVector}, nv::N_Vector) = NVector(nv) +Base.convert(::Type{N_Vector}, nv::NVector) = nv.ref_nv[] +Base.convert(::Type{Vector{realtype}}, nv::NVector)= nv.v +Base.convert(::Type{Vector}, nv::NVector)= nv.v + +""" `N_Vector(v::Vector{T})` + + Converts Julia `Vector` to `N_Vector`. + + Implicitly creates `NVector` object that manages automatic + destruction of `N_Vector` object when no longer in use. +""" +Base.convert(::Type{N_Vector}, v::Vector{realtype}) = N_Vector(NVector(v)) +Base.convert{T<:Real}(::Type{N_Vector}, v::Vector{T}) = N_Vector(NVector(v)) + +Base.similar(nv::NVector) = NVector(similar(nv.v)) + +nvlength(x::N_Vector) = unsafe_load(unsafe_load(convert(Ptr{Ptr{Clong}}, x))) +# asarray() creates an array pointing to N_Vector data, but does not take the ownership +@inline asarray(x::N_Vector) = @compat unsafe_wrap(Array, __N_VGetArrayPointer_Serial(x), (nvlength(x),), false) +@inline asarray(x::N_Vector, dims::Tuple) = @compat unsafe_wrap(Array, __N_VGetArrayPointer_Serial(x), dims, false) +asarray(x::Vector{realtype}) = x +asarray(x::Ptr{realtype}, dims::Tuple) = @compat unsafe_wrap(Array, x, dims, false) +@inline Base.convert(::Type{Vector{realtype}}, x::N_Vector) = asarray(x) +@inline Base.convert(::Type{Vector}, x::N_Vector) = asarray(x) + +nvector(x::Vector{realtype}) = NVector(x) +#nvector(x::N_Vector) = x diff --git a/src/simple.jl b/src/simple.jl new file mode 100644 index 00000000..62b68ba8 --- /dev/null +++ b/src/simple.jl @@ -0,0 +1,258 @@ +################################################################## +# +# Simplified interfaces that only uses Julia vectors and functions. +# +################################################################## + +""" + Insert a check that the given function call returns 0, + throw an error otherwise. Only apply directly to function calls. +""" +macro checkflag(ex) + @assert Base.Meta.isexpr(ex, :call) + fname = ex.args[1] + quote + flag = $(esc(ex)) + if flag != 0 + error($(string(fname, " failed with error code = ")), flag) + end + flag + end +end + +type UserFunctionAndData + func::Function + data::Any + + UserFunctionAndData(func::Function, data::Any) = new(func, data) +end + +UserFunctionAndData(func::Function) = func +UserFunctionAndData(func::Function, data::Void) = func + +function kinsolfun(y::N_Vector, fy::N_Vector, userfun::UserFunctionAndData) + userfun[].func(convert(Vector, y), convert(Vector, fy), userfun[].data) + return KIN_SUCCESS +end + +function kinsolfun(y::N_Vector, fy::N_Vector, userfun::Function) + userfun(convert(Vector, y), convert(Vector, fy)) + return KIN_SUCCESS +end + +function kinsol(f::Function, y0::Vector{Float64}, userdata::Any = nothing) + # f, Function to be optimized of the form f(y::Vector{Float64}, fy::Vector{Float64}) + # where `y` is the input vector, and `fy` is the result of the function + # y0, Vector of initial values + # return: the solution vector + kmem = KINCreate() + if kmem == C_NULL + error("Failed to allocate KINSOL solver object") + end + + y = copy(y0) + try + # use the user_data field to pass a function + # see: https://github.com/JuliaLang/julia/issues/2554 + userfun = UserFunctionAndData(f, userdata) + flag = @checkflag KINInit(kmem, cfunction(kinsolfun, Cint, (N_Vector, N_Vector, Ref{typeof(userfun)})), NVector(y0)) + flag = @checkflag KINDense(kmem, length(y0)) + flag = @checkflag KINSetUserData(kmem, userfun) + ## Solve problem + scale = ones(length(y0)) + strategy = KIN_NONE + flag = @checkflag KINSol(kmem, y, strategy, scale, scale) + finally + KINFree(Ref{KINMemPtr}(kmem)) + end + + return y +end + +function cvodefun(t::Float64, y::N_Vector, yp::N_Vector, userfun::UserFunctionAndData) + userfun.func(t, convert(Vector, y), convert(Vector, yp), userfun.data) + return CV_SUCCESS +end + +function cvodefun(t::Float64, y::N_Vector, yp::N_Vector, userfun::Function) + userfun(t, convert(Vector, y), convert(Vector, yp)) + return CV_SUCCESS +end + +""" +`cvode(f::Function, y0::Vector{Float64}, t::Vector{Float64}, userdata::Any=nothing; + integrator=:BDF, reltol::Float64=1e-3, abstol::Float64=1e-6)` + +* `f`, Function of the form + `f(t, y::Vector{Float64}, yp::Vector{Float64})` + where `y` is the input state vector, and `yp` is the output vector + of time derivatives for the states `y` +* `y0`, Vector of initial values +* `t`, Vector of time values at which to record integration results +* `integrator`, the chosen integration algorithm. Default is `:BDF` + , other option is `:Adams` +* `reltol`, Relative Tolerance to be used (default=1e-3) +* `abstol`, Absolute Tolerance to be used (default=1e-6) + +return: a solution matrix with time steps in `t` along rows and + state variable `y` along columns +""" +function cvode(f::Function, y0::Vector{Float64}, t::Vector{Float64}, userdata::Any=nothing; + integrator=:BDF, reltol::Float64=1e-3, abstol::Float64=1e-6) + if integrator==:BDF + mem = CVodeCreate(CV_BDF, CV_NEWTON) + elseif integrator==:Adams + mem = CVodeCreate(CV_ADAMS, CV_FUNCTIONAL) + end + if mem == C_NULL + error("Failed to allocate CVODE solver object") + end + + yres = zeros(length(t), length(y0)) + try + userfun = UserFunctionAndData(f, userdata) + y0nv = NVector(y0) + flag = @checkflag CVodeInit(mem, cfunction(cvodefun, Cint, (realtype, N_Vector, N_Vector, Ref{typeof(userfun)})), t[1], convert(N_Vector, y0nv)) + flag = @checkflag CVodeSetUserData(mem, userfun) + flag = @checkflag CVodeSStolerances(mem, reltol, abstol) + flag = @checkflag CVDense(mem, length(y0)) + yres[1,:] = y0 + ynv = NVector(copy(y0)) + tout = [0.0] + for k in 2:length(t) + flag = @checkflag CVode(mem, t[k], ynv, tout, CV_NORMAL) + yres[k,:] = convert(Vector, ynv) + end + finally + CVodeFree(Ref{CVODEMemPtr}(mem)) + end + return yres +end + +""" +`cvode_fulloutput(f::Function, y0::Vector{Float64}, tspan::Vector{Float64}, userdata::Any = nothing; + integrator=:BDF, reltol::Float64=1e-3, abstol::Float64=1e-6)` + +* `f`, Function of the form + `f(t, y::Vector{Float64}, yp::Vector{Float64})` + where `y` is the input state vector, and `yp` is the output vector + of time derivatives for the states `y` +* `y0`, Vector of initial values +* `tspan`, a vector where `tspan[1]` is the starting time and the other values are + time values which are guaranteed in the output +* `integrator`, the chosen integration algorithm. Default is `:BDF` + , other option is `:Adams` +* `reltol`, Relative Tolerance to be used (default=1e-3) +* `abstol`, Absolute Tolerance to be used (default=1e-6) + +return: a vector with the timepoints `t` and a vector with the outputs `y0` +""" +function cvode_fulloutput(f::Function, y0::Vector{Float64}, tspan::Vector{Float64}, userdata::Any = nothing; + integrator=:BDF, reltol::Float64=1e-3, abstol::Float64=1e-6) + t0 = tspan[1] + Ts = tspan[2:end] + if integrator==:BDF + mem = CVodeCreate(CV_BDF, CV_NEWTON) + elseif integrator==:Adams + mem = CVodeCreate(CV_ADAMS, CV_FUNCTIONAL) + end + if mem == C_NULL + error("Failed to allocate CVODE solver object") + end + + yres = Vector{Vector{Float64}}() + ts = [t0] + try + userfun = UserFunctionAndData(f, userdata) + y0nv = NVector(y0) + flag = @checkflag CVodeInit(mem, cfunction(cvodefun, Cint, (realtype, N_Vector, N_Vector, Ref{typeof(userfun)})), t0, convert(N_Vector, y0nv)) + flag = @checkflag CVodeSetUserData(mem, userfun) + flag = @checkflag CVodeSStolerances(mem, reltol, abstol) + flag = @checkflag CVDense(mem, length(y0)) + push!(yres, y0) + y = copy(y0) + tout = [0.0] + for t in Ts + while tout[end] < t + flag = @checkflag CVode(mem, t, y, tout, CV_ONE_STEP) + push!(yres,copy(y)) + push!(ts, tout...) + end + # Fix the end + flag = @checkflag CVodeGetDky(mem, t, Cint(0), yres[end]) + ts[end] = t + end + finally + CVodeFree(Ref{CVODEMemPtr}(mem)) + end + return ts, yres +end + +function idasolfun(t::Float64, y::N_Vector, yp::N_Vector, r::N_Vector, userfun::UserFunctionAndData) + userfun.func(t, convert(Vector, y), convert(Vector, yp), convert(Vector, r), userfun.data) + return IDA_SUCCESS +end + +function idasolfun(t::Float64, y::N_Vector, yp::N_Vector, r::N_Vector, userfun::Function) + userfun(t, convert(Vector, y), convert(Vector, yp), convert(Vector, r)) + return IDA_SUCCESS +end + +""" +`idasol(f::Function, y0::Vector{Float64}, yp0::Vector{Float64}, t::Vector{Float64}, userdata::Any=nothing; + reltol::Float64=1e-3, abstol::Float64=1e-6, diffstates::Union{Vector{Bool},Void}=nothing)` + +* `f`, Function of the form + `f(t, y::Vector{Float64}, yp::Vector{Float64}, r::Vector{Float64})`` + where `y` and `yp` are the input state and derivative vectors, + and `r` is the output residual vector +* `y0`, Vector of initial values +* `yp0`, Vector of initial values of the derivatives +* `reltol`, Relative Tolerance to be used (default=1e-3) +* `abstol`, Absolute Tolerance to be used (default=1e-6) +* `diffstates`, Boolean vector, true for the positions such that `r` depends on `yp[k]` + +return: (y,yp) two solution matrices representing the states and state derivatives + with time steps in `t` along rows and state variable `y` or `yp` along columns +""" +function idasol(f::Function, y0::Vector{Float64}, yp0::Vector{Float64}, t::Vector{Float64}, userdata::Any=nothing; + reltol::Float64=1e-3, abstol::Float64=1e-6, diffstates::Union{Vector{Bool},Void}=nothing) + mem = IDACreate() + if mem == C_NULL + error("Failed to allocate IDA solver object") + end + + yres = zeros(length(t), length(y0)) + ypres = zeros(length(t), length(y0)) + try + userfun = UserFunctionAndData(f, userdata) + flag = @checkflag IDAInit(mem, cfunction(idasolfun, Cint, (realtype, N_Vector, N_Vector, N_Vector, Ref{typeof(userfun)})), + t[1], y0, yp0) + flag = @checkflag IDASetUserData(mem, userfun) + flag = @checkflag IDASStolerances(mem, reltol, abstol) + flag = @checkflag IDADense(mem, length(y0)) + rtest = zeros(length(y0)) + f(t[1], y0, yp0, rtest) + if any(abs(rtest) .>= reltol) + if diffstates === nothing + error("Must supply diffstates argument to use IDA initial value solver.") + end + flag = @checkflag IDASetId(mem, collect(Float64, diffstates)) + flag = @checkflag IDACalcIC(mem, IDA_YA_YDP_INIT, t[2]) + end + yres[1,:] = y0 + ypres[1,:] = yp0 + y = copy(y0) + yp = copy(yp0) + tout = [0.0] + for k in 2:length(t) + retval = @checkflag IDASolve(mem, t[k], tout, y, yp, IDA_NORMAL) + yres[k,:] = y + ypres[k,:] = yp + end + finally + IDAFree(Ref{IDAMemPtr}(mem)) + end + + return yres, ypres +end diff --git a/src/sundials_h.jl b/src/sundials_h.jl deleted file mode 100644 index 6b4cbb34..00000000 --- a/src/sundials_h.jl +++ /dev/null @@ -1,2358 +0,0 @@ -# Automatically generated using Clang.jl wrap_c, version 0.0.0 - -using Compat - -const OBJC_NEW_PROPERTIES = 1 -const SUNDIALS_PACKAGE_VERSION = "2.5.0" -const SUNDIALS_DOUBLE_PRECISION = 1 -const SUNDIALS_BLAS_LAPACK = 0 -# const FLT_EVAL_METHOD = __FLT_EVAL_METHOD__ - -# Skipping MacroDefinition: FLT_ROUNDS ( __builtin_flt_rounds ( ) ) - -# const FLT_RADIX = __FLT_RADIX__ -# const FLT_MANT_DIG = __FLT_MANT_DIG__ -# const DBL_MANT_DIG = __DBL_MANT_DIG__ -# const LDBL_MANT_DIG = __LDBL_MANT_DIG__ -# const DECIMAL_DIG = __DECIMAL_DIG__ -# const FLT_DIG = __FLT_DIG__ -# const DBL_DIG = __DBL_DIG__ -# const LDBL_DIG = __LDBL_DIG__ -# const FLT_MIN_EXP = __FLT_MIN_EXP__ -# const DBL_MIN_EXP = __DBL_MIN_EXP__ -# const LDBL_MIN_EXP = __LDBL_MIN_EXP__ -# const FLT_MIN_10_EXP = __FLT_MIN_10_EXP__ -# const DBL_MIN_10_EXP = __DBL_MIN_10_EXP__ -# const LDBL_MIN_10_EXP = __LDBL_MIN_10_EXP__ -# const FLT_MAX_EXP = __FLT_MAX_EXP__ -# const DBL_MAX_EXP = __DBL_MAX_EXP__ -# const LDBL_MAX_EXP = __LDBL_MAX_EXP__ -# const FLT_MAX_10_EXP = __FLT_MAX_10_EXP__ -# const DBL_MAX_10_EXP = __DBL_MAX_10_EXP__ -# const LDBL_MAX_10_EXP = __LDBL_MAX_10_EXP__ -# const FLT_MAX = __FLT_MAX__ -# const DBL_MAX = __DBL_MAX__ -# const LDBL_MAX = __LDBL_MAX__ -# const FLT_EPSILON = __FLT_EPSILON__ -# const DBL_EPSILON = __DBL_EPSILON__ -# const LDBL_EPSILON = __LDBL_EPSILON__ -# const FLT_MIN = __FLT_MIN__ -# const DBL_MIN = __DBL_MIN__ -# const LDBL_MIN = __LDBL_MIN__ -# const FLT_TRUE_MIN = __FLT_DENORM_MIN__ -# const DBL_TRUE_MIN = __DBL_DENORM_MIN__ -# const LDBL_TRUE_MIN = __LDBL_DENORM_MIN__ - -# Skipping MacroDefinition: RCONST ( x ) x - -# const BIG_REAL = DBL_MAX -# const SMALL_REAL = DBL_MIN -# const UNIT_ROUNDOFF = DBL_EPSILON -const FALSE = 0 -const TRUE = 1 -const SUNDIALS_DENSE = 1 -const SUNDIALS_BAND = 2 - -# Skipping MacroDefinition: DENSE_COL ( A , j ) ( ( A -> cols ) [ j ] ) -# Skipping MacroDefinition: DENSE_ELEM ( A , i , j ) ( ( A -> cols ) [ j ] [ i ] ) -# Skipping MacroDefinition: BAND_COL ( A , j ) ( ( ( A -> cols ) [ j ] ) + ( A -> s_mu ) ) -# Skipping MacroDefinition: BAND_COL_ELEM ( col_j , i , j ) ( col_j [ ( i ) - ( j ) ] ) -# Skipping MacroDefinition: BAND_ELEM ( A , i , j ) ( ( A -> cols ) [ j ] [ ( i ) - ( j ) + ( A -> s_mu ) ] ) - -typealias realtype Cdouble - -type _DlsMat - _type::Cint - M::Clong - N::Clong - ldim::Clong - mu::Clong - ml::Clong - s_mu::Clong - data::Ptr{realtype} - ldata::Clong - cols::Ptr{Ptr{realtype}} -end - -typealias DlsMat Ptr{_DlsMat} - -type _generic_N_Vector_Ops - nvclone::Ptr{Void} - nvcloneempty::Ptr{Void} - nvdestroy::Ptr{Void} - nvspace::Ptr{Void} - nvgetarraypointer::Ptr{Void} - nvsetarraypointer::Ptr{Void} - nvlinearsum::Ptr{Void} - nvconst::Ptr{Void} - nvprod::Ptr{Void} - nvdiv::Ptr{Void} - nvscale::Ptr{Void} - nvabs::Ptr{Void} - nvinv::Ptr{Void} - nvaddconst::Ptr{Void} - nvdotprod::Ptr{Void} - nvmaxnorm::Ptr{Void} - nvwrmsnorm::Ptr{Void} - nvwrmsnormmask::Ptr{Void} - nvmin::Ptr{Void} - nvwl2norm::Ptr{Void} - nvl1norm::Ptr{Void} - nvcompare::Ptr{Void} - nvinvtest::Ptr{Void} - nvconstrmask::Ptr{Void} - nvminquotient::Ptr{Void} -end - -typealias N_Vector_Ops Ptr{_generic_N_Vector_Ops} - -type _generic_N_Vector - content::Ptr{Void} - ops::Ptr{_generic_N_Vector_Ops} -end - -typealias N_Vector Ptr{_generic_N_Vector} -typealias N_Vector_S Ptr{N_Vector} - -# begin enum ANONYMOUS_1 -typealias ANONYMOUS_1 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_1 - -# begin enum ANONYMOUS_47 -typealias ANONYMOUS_47 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_47 - -# begin enum ANONYMOUS_2 -typealias ANONYMOUS_2 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_2 - -# begin enum ANONYMOUS_48 -typealias ANONYMOUS_48 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_48 - -typealias ATimesFn Ptr{Void} -typealias PSolveFn Ptr{Void} - -const SPBCG_SUCCESS = 0 -const SPBCG_RES_REDUCED = 1 -const SPBCG_CONV_FAIL = 2 -const SPBCG_PSOLVE_FAIL_REC = 3 -const SPBCG_ATIMES_FAIL_REC = 4 -const SPBCG_PSET_FAIL_REC = 5 -const SPBCG_MEM_NULL = -1 -const SPBCG_ATIMES_FAIL_UNREC = -2 -const SPBCG_PSOLVE_FAIL_UNREC = -3 -const SPBCG_PSET_FAIL_UNREC = -4 - -# Skipping MacroDefinition: SPBCG_VTEMP ( mem ) ( mem -> r ) - -# begin enum ANONYMOUS_3 -typealias ANONYMOUS_3 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_3 - -# begin enum ANONYMOUS_4 -typealias ANONYMOUS_4 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_4 - -type SpbcgMemRec - l_max::Cint - r_star::N_Vector - r::N_Vector - p::N_Vector - q::N_Vector - u::N_Vector - Ap::N_Vector - vtemp::N_Vector -end - -typealias SpbcgMem Ptr{Void} - -const SPGMR_SUCCESS = 0 -const SPGMR_RES_REDUCED = 1 -const SPGMR_CONV_FAIL = 2 -const SPGMR_QRFACT_FAIL = 3 -const SPGMR_PSOLVE_FAIL_REC = 4 -const SPGMR_ATIMES_FAIL_REC = 5 -const SPGMR_PSET_FAIL_REC = 6 -const SPGMR_MEM_NULL = -1 -const SPGMR_ATIMES_FAIL_UNREC = -2 -const SPGMR_PSOLVE_FAIL_UNREC = -3 -const SPGMR_GS_FAIL = -4 -const SPGMR_QRSOL_FAIL = -5 -const SPGMR_PSET_FAIL_UNREC = -6 - -# Skipping MacroDefinition: SPGMR_VTEMP ( mem ) ( mem -> vtemp ) - -# begin enum ANONYMOUS_5 -typealias ANONYMOUS_5 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_5 - -# begin enum ANONYMOUS_6 -typealias ANONYMOUS_6 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_6 - -type _SpgmrMemRec - l_max::Cint - V::Ptr{N_Vector} - Hes::Ptr{Ptr{realtype}} - givens::Ptr{realtype} - xcor::N_Vector - yg::Ptr{realtype} - vtemp::N_Vector -end - -type SpgmrMemRec - l_max::Cint - V::Ptr{N_Vector} - Hes::Ptr{Ptr{realtype}} - givens::Ptr{realtype} - xcor::N_Vector - yg::Ptr{realtype} - vtemp::N_Vector -end - -typealias SpgmrMem Ptr{_SpgmrMemRec} - -const SPTFQMR_SUCCESS = 0 -const SPTFQMR_RES_REDUCED = 1 -const SPTFQMR_CONV_FAIL = 2 -const SPTFQMR_PSOLVE_FAIL_REC = 3 -const SPTFQMR_ATIMES_FAIL_REC = 4 -const SPTFQMR_PSET_FAIL_REC = 5 -const SPTFQMR_MEM_NULL = -1 -const SPTFQMR_ATIMES_FAIL_UNREC = -2 -const SPTFQMR_PSOLVE_FAIL_UNREC = -3 -const SPTFQMR_PSET_FAIL_UNREC = -4 - -# Skipping MacroDefinition: SPTFQMR_VTEMP ( mem ) ( mem -> vtemp1 ) - -# begin enum ANONYMOUS_7 -typealias ANONYMOUS_7 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_7 - -# begin enum ANONYMOUS_8 -typealias ANONYMOUS_8 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_8 - -type SptfqmrMemRec - l_max::Cint - r_star::N_Vector - q::N_Vector - d::N_Vector - v::N_Vector - p::N_Vector - r::Ptr{N_Vector} - u::N_Vector - vtemp1::N_Vector - vtemp2::N_Vector - vtemp3::N_Vector -end - -typealias SptfqmrMem Ptr{Void} - -# const NULL = __DARWIN_NULL -const BUFSIZ = 1024 -const EOF = -1 -const FOPEN_MAX = 20 -const FILENAME_MAX = 1024 -const P_tmpdir = "/var/tmp/" -const L_tmpnam = 1024 -const TMP_MAX = 308915776 -const SEEK_SET = 0 -const SEEK_CUR = 1 -const SEEK_END = 2 -# const stdin = __stdinp -# const stdout = __stdoutp -# const stderr = __stderrp -const L_ctermid = 1024 - -# Skipping MacroDefinition: getc_unlocked ( fp ) __sgetc ( fp ) -# Skipping MacroDefinition: putc_unlocked ( x , fp ) __sputc ( x , fp ) -# Skipping MacroDefinition: getchar_unlocked ( ) getc_unlocked ( stdin ) -# Skipping MacroDefinition: putchar_unlocked ( x ) putc_unlocked ( x , stdout ) -# Skipping MacroDefinition: fropen ( cookie , fn ) funopen ( cookie , fn , 0 , 0 , 0 ) -# Skipping MacroDefinition: fwopen ( cookie , fn ) funopen ( cookie , 0 , fn , 0 , 0 ) -# Skipping MacroDefinition: feof_unlocked ( p ) __sfeof ( p ) -# Skipping MacroDefinition: ferror_unlocked ( p ) __sferror ( p ) -# Skipping MacroDefinition: clearerr_unlocked ( p ) __sclearerr ( p ) -# Skipping MacroDefinition: fileno_unlocked ( p ) __sfileno ( p ) -# Skipping MacroDefinition: sprintf ( str , ... ) __builtin___sprintf_chk ( str , 0 , __darwin_obsz ( str ) , __VA_ARGS__ ) -# Skipping MacroDefinition: snprintf ( str , len , ... ) __builtin___snprintf_chk ( str , len , 0 , __darwin_obsz ( str ) , __VA_ARGS__ ) -# Skipping MacroDefinition: vsprintf ( str , format , ap ) __builtin___vsprintf_chk ( str , 0 , __darwin_obsz ( str ) , format , ap ) -# Skipping MacroDefinition: vsnprintf ( str , len , format , ap ) __builtin___vsnprintf_chk ( str , len , 0 , __darwin_obsz ( str ) , format , ap ) - -const CV_ADAMS = 1 -const CV_BDF = 2 -const CV_FUNCTIONAL = 1 -const CV_NEWTON = 2 -const CV_NORMAL = 1 -const CV_ONE_STEP = 2 -const CV_SUCCESS = 0 -const CV_TSTOP_RETURN = 1 -const CV_ROOT_RETURN = 2 -const CV_WARNING = 99 -const CV_TOO_MUCH_WORK = -1 -const CV_TOO_MUCH_ACC = -2 -const CV_ERR_FAILURE = -3 -const CV_CONV_FAILURE = -4 -const CV_LINIT_FAIL = -5 -const CV_LSETUP_FAIL = -6 -const CV_LSOLVE_FAIL = -7 -const CV_RHSFUNC_FAIL = -8 -const CV_FIRST_RHSFUNC_ERR = -9 -const CV_REPTD_RHSFUNC_ERR = -10 -const CV_UNREC_RHSFUNC_ERR = -11 -const CV_RTFUNC_FAIL = -12 -const CV_MEM_FAIL = -20 -const CV_MEM_NULL = -21 -const CV_ILL_INPUT = -22 -const CV_NO_MALLOC = -23 -const CV_BAD_K = -24 -const CV_BAD_T = -25 -const CV_BAD_DKY = -26 -const CV_TOO_CLOSE = -27 - -immutable Array_56_UInt8 - d1::UInt8 - d2::UInt8 - d3::UInt8 - d4::UInt8 - d5::UInt8 - d6::UInt8 - d7::UInt8 - d8::UInt8 - d9::UInt8 - d10::UInt8 - d11::UInt8 - d12::UInt8 - d13::UInt8 - d14::UInt8 - d15::UInt8 - d16::UInt8 - d17::UInt8 - d18::UInt8 - d19::UInt8 - d20::UInt8 - d21::UInt8 - d22::UInt8 - d23::UInt8 - d24::UInt8 - d25::UInt8 - d26::UInt8 - d27::UInt8 - d28::UInt8 - d29::UInt8 - d30::UInt8 - d31::UInt8 - d32::UInt8 - d33::UInt8 - d34::UInt8 - d35::UInt8 - d36::UInt8 - d37::UInt8 - d38::UInt8 - d39::UInt8 - d40::UInt8 - d41::UInt8 - d42::UInt8 - d43::UInt8 - d44::UInt8 - d45::UInt8 - d46::UInt8 - d47::UInt8 - d48::UInt8 - d49::UInt8 - d50::UInt8 - d51::UInt8 - d52::UInt8 - d53::UInt8 - d54::UInt8 - d55::UInt8 - d56::UInt8 -end - -zero(::Type{Array_56_UInt8}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_56_UInt8(fill(zero(UInt8),56)...) - end - -type _opaque_pthread_attr_t - __sig::Clong - __opaque::Array_56_UInt8 -end - -immutable Array_40_UInt8 - d1::UInt8 - d2::UInt8 - d3::UInt8 - d4::UInt8 - d5::UInt8 - d6::UInt8 - d7::UInt8 - d8::UInt8 - d9::UInt8 - d10::UInt8 - d11::UInt8 - d12::UInt8 - d13::UInt8 - d14::UInt8 - d15::UInt8 - d16::UInt8 - d17::UInt8 - d18::UInt8 - d19::UInt8 - d20::UInt8 - d21::UInt8 - d22::UInt8 - d23::UInt8 - d24::UInt8 - d25::UInt8 - d26::UInt8 - d27::UInt8 - d28::UInt8 - d29::UInt8 - d30::UInt8 - d31::UInt8 - d32::UInt8 - d33::UInt8 - d34::UInt8 - d35::UInt8 - d36::UInt8 - d37::UInt8 - d38::UInt8 - d39::UInt8 - d40::UInt8 -end - -zero(::Type{Array_40_UInt8}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_40_UInt8(fill(zero(UInt8),40)...) - end - -type _opaque_pthread_cond_t - __sig::Clong - __opaque::Array_40_UInt8 -end - -immutable Array_8_UInt8 - d1::UInt8 - d2::UInt8 - d3::UInt8 - d4::UInt8 - d5::UInt8 - d6::UInt8 - d7::UInt8 - d8::UInt8 -end - -zero(::Type{Array_8_UInt8}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_8_UInt8(fill(zero(UInt8),8)...) - end - -type _opaque_pthread_condattr_t - __sig::Clong - __opaque::Array_8_UInt8 -end - -type _opaque_pthread_mutex_t - __sig::Clong - __opaque::Array_56_UInt8 -end - -type _opaque_pthread_mutexattr_t - __sig::Clong - __opaque::Array_8_UInt8 -end - -type _opaque_pthread_once_t - __sig::Clong - __opaque::Array_8_UInt8 -end - -immutable Array_192_UInt8 - d1::UInt8 - d2::UInt8 - d3::UInt8 - d4::UInt8 - d5::UInt8 - d6::UInt8 - d7::UInt8 - d8::UInt8 - d9::UInt8 - d10::UInt8 - d11::UInt8 - d12::UInt8 - d13::UInt8 - d14::UInt8 - d15::UInt8 - d16::UInt8 - d17::UInt8 - d18::UInt8 - d19::UInt8 - d20::UInt8 - d21::UInt8 - d22::UInt8 - d23::UInt8 - d24::UInt8 - d25::UInt8 - d26::UInt8 - d27::UInt8 - d28::UInt8 - d29::UInt8 - d30::UInt8 - d31::UInt8 - d32::UInt8 - d33::UInt8 - d34::UInt8 - d35::UInt8 - d36::UInt8 - d37::UInt8 - d38::UInt8 - d39::UInt8 - d40::UInt8 - d41::UInt8 - d42::UInt8 - d43::UInt8 - d44::UInt8 - d45::UInt8 - d46::UInt8 - d47::UInt8 - d48::UInt8 - d49::UInt8 - d50::UInt8 - d51::UInt8 - d52::UInt8 - d53::UInt8 - d54::UInt8 - d55::UInt8 - d56::UInt8 - d57::UInt8 - d58::UInt8 - d59::UInt8 - d60::UInt8 - d61::UInt8 - d62::UInt8 - d63::UInt8 - d64::UInt8 - d65::UInt8 - d66::UInt8 - d67::UInt8 - d68::UInt8 - d69::UInt8 - d70::UInt8 - d71::UInt8 - d72::UInt8 - d73::UInt8 - d74::UInt8 - d75::UInt8 - d76::UInt8 - d77::UInt8 - d78::UInt8 - d79::UInt8 - d80::UInt8 - d81::UInt8 - d82::UInt8 - d83::UInt8 - d84::UInt8 - d85::UInt8 - d86::UInt8 - d87::UInt8 - d88::UInt8 - d89::UInt8 - d90::UInt8 - d91::UInt8 - d92::UInt8 - d93::UInt8 - d94::UInt8 - d95::UInt8 - d96::UInt8 - d97::UInt8 - d98::UInt8 - d99::UInt8 - d100::UInt8 - d101::UInt8 - d102::UInt8 - d103::UInt8 - d104::UInt8 - d105::UInt8 - d106::UInt8 - d107::UInt8 - d108::UInt8 - d109::UInt8 - d110::UInt8 - d111::UInt8 - d112::UInt8 - d113::UInt8 - d114::UInt8 - d115::UInt8 - d116::UInt8 - d117::UInt8 - d118::UInt8 - d119::UInt8 - d120::UInt8 - d121::UInt8 - d122::UInt8 - d123::UInt8 - d124::UInt8 - d125::UInt8 - d126::UInt8 - d127::UInt8 - d128::UInt8 - d129::UInt8 - d130::UInt8 - d131::UInt8 - d132::UInt8 - d133::UInt8 - d134::UInt8 - d135::UInt8 - d136::UInt8 - d137::UInt8 - d138::UInt8 - d139::UInt8 - d140::UInt8 - d141::UInt8 - d142::UInt8 - d143::UInt8 - d144::UInt8 - d145::UInt8 - d146::UInt8 - d147::UInt8 - d148::UInt8 - d149::UInt8 - d150::UInt8 - d151::UInt8 - d152::UInt8 - d153::UInt8 - d154::UInt8 - d155::UInt8 - d156::UInt8 - d157::UInt8 - d158::UInt8 - d159::UInt8 - d160::UInt8 - d161::UInt8 - d162::UInt8 - d163::UInt8 - d164::UInt8 - d165::UInt8 - d166::UInt8 - d167::UInt8 - d168::UInt8 - d169::UInt8 - d170::UInt8 - d171::UInt8 - d172::UInt8 - d173::UInt8 - d174::UInt8 - d175::UInt8 - d176::UInt8 - d177::UInt8 - d178::UInt8 - d179::UInt8 - d180::UInt8 - d181::UInt8 - d182::UInt8 - d183::UInt8 - d184::UInt8 - d185::UInt8 - d186::UInt8 - d187::UInt8 - d188::UInt8 - d189::UInt8 - d190::UInt8 - d191::UInt8 - d192::UInt8 -end - -zero(::Type{Array_192_UInt8}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_192_UInt8(fill(zero(UInt8),192)...) - end - -type _opaque_pthread_rwlock_t - __sig::Clong - __opaque::Array_192_UInt8 -end - -immutable Array_16_UInt8 - d1::UInt8 - d2::UInt8 - d3::UInt8 - d4::UInt8 - d5::UInt8 - d6::UInt8 - d7::UInt8 - d8::UInt8 - d9::UInt8 - d10::UInt8 - d11::UInt8 - d12::UInt8 - d13::UInt8 - d14::UInt8 - d15::UInt8 - d16::UInt8 -end - -zero(::Type{Array_16_UInt8}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_16_UInt8(fill(zero(UInt8),16)...) - end - -immutable Array_3_Cuchar - d1::Cuchar - d2::Cuchar - d3::Cuchar -end - -zero(::Type{Array_3_Cuchar}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_3_Cuchar(fill(zero(Cuchar),3)...) - end - -immutable Array_1_Cuchar - d1::Cuchar -end - -zero(::Type{Array_1_Cuchar}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_1_Cuchar(fill(zero(Cuchar),1)...) - end - -# type FILE -# _p::Ptr{Cuchar} -# _r::Cint -# _w::Cint -# _flags::Int16 -# _file::Int16 -# _bf::__sbuf -# _lbfsize::Cint -# _cookie::Ptr{Void} -# _close::Ptr{Void} -# _read::Ptr{Void} -# _seek::Ptr{Void} -# _write::Ptr{Void} -# _ub::__sbuf -# _extra::Ptr{__sFILEX} -# _ur::Cint -# _ubuf::Array_3_Cuchar -# _nbuf::Array_1_Cuchar -# _lb::__sbuf -# _blksize::Cint -# _offset::fpos_t -# end -# -# typealias off_t __darwin_off_t -# typealias ssize_t __darwin_ssize_t -typealias CVRhsFn Ptr{Void} -typealias CVRootFn Ptr{Void} -typealias CVEwtFn Ptr{Void} -typealias CVErrHandlerFn Ptr{Void} - -const CVDLS_SUCCESS = 0 -const CVDLS_MEM_NULL = -1 -const CVDLS_LMEM_NULL = -2 -const CVDLS_ILL_INPUT = -3 -const CVDLS_MEM_FAIL = -4 -const CVDLS_JACFUNC_UNRECVR = -5 -const CVDLS_JACFUNC_RECVR = -6 - -typealias CVDlsDenseJacFn Ptr{Void} -typealias CVDlsBandJacFn Ptr{Void} - -const CVSPILS_SUCCESS = 0 -const CVSPILS_MEM_NULL = -1 -const CVSPILS_LMEM_NULL = -2 -const CVSPILS_ILL_INPUT = -3 -const CVSPILS_MEM_FAIL = -4 -const CVSPILS_PMEM_NULL = -5 -const CVSPILS_MAXL = 5 -const CVSPILS_MSBPRE = 50 - -# Skipping MacroDefinition: CVSPILS_DGMAX RCONST ( 0.2 ) -# Skipping MacroDefinition: CVSPILS_EPLIN RCONST ( 0.05 ) - -# begin enum ANONYMOUS_9 -typealias ANONYMOUS_9 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_9 - -# begin enum ANONYMOUS_10 -typealias ANONYMOUS_10 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_10 - -typealias CVSpilsPrecSetupFn Ptr{Void} -typealias CVSpilsPrecSolveFn Ptr{Void} -typealias CVSpilsJacTimesVecFn Ptr{Void} - -const CV_SIMULTANEOUS = 1 -const CV_STAGGERED = 2 -const CV_STAGGERED1 = 3 -const CV_CENTERED = 1 -const CV_FORWARD = 2 -const CV_HERMITE = 1 -const CV_POLYNOMIAL = 2 -const CV_NO_QUAD = -30 -const CV_QRHSFUNC_FAIL = -31 -const CV_FIRST_QRHSFUNC_ERR = -32 -const CV_REPTD_QRHSFUNC_ERR = -33 -const CV_UNREC_QRHSFUNC_ERR = -34 -const CV_NO_SENS = -40 -const CV_SRHSFUNC_FAIL = -41 -const CV_FIRST_SRHSFUNC_ERR = -42 -const CV_REPTD_SRHSFUNC_ERR = -43 -const CV_UNREC_SRHSFUNC_ERR = -44 -const CV_BAD_IS = -45 -const CV_NO_QUADSENS = -50 -const CV_QSRHSFUNC_FAIL = -51 -const CV_FIRST_QSRHSFUNC_ERR = -52 -const CV_REPTD_QSRHSFUNC_ERR = -53 -const CV_UNREC_QSRHSFUNC_ERR = -54 -const CV_NO_ADJ = -101 -const CV_NO_FWD = -102 -const CV_NO_BCK = -103 -const CV_BAD_TB0 = -104 -const CV_REIFWD_FAIL = -105 -const CV_FWD_FAIL = -106 -const CV_GETY_BADT = -107 - -typealias CVQuadRhsFn Ptr{Void} -typealias CVSensRhsFn Ptr{Void} -typealias CVSensRhs1Fn Ptr{Void} -typealias CVQuadSensRhsFn Ptr{Void} -typealias CVRhsFnB Ptr{Void} -typealias CVRhsFnBS Ptr{Void} -typealias CVQuadRhsFnB Ptr{Void} -typealias CVQuadRhsFnBS Ptr{Void} - -type CVadjCheckPointRec - my_addr::Ptr{Void} - next_addr::Ptr{Void} - t0::realtype - t1::realtype - nstep::Clong - order::Cint - step::realtype -end - -const CVDLS_NO_ADJ = -101 -const CVDLS_LMEMB_NULL = -102 - -typealias CVDlsDenseJacFnB Ptr{Void} -typealias CVDlsBandJacFnB Ptr{Void} - -const CVSPILS_NO_ADJ = -101 -const CVSPILS_LMEMB_NULL = -102 - -# begin enum ANONYMOUS_11 -typealias ANONYMOUS_11 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_11 - -# begin enum ANONYMOUS_12 -typealias ANONYMOUS_12 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_12 - -typealias CVSpilsPrecSetupFnB Ptr{Void} -typealias CVSpilsPrecSolveFnB Ptr{Void} -typealias CVSpilsJacTimesVecFnB Ptr{Void} - -const IDA_NORMAL = 1 -const IDA_ONE_STEP = 2 -const IDA_YA_YDP_INIT = 1 -const IDA_Y_INIT = 2 -const IDA_SUCCESS = 0 -const IDA_TSTOP_RETURN = 1 -const IDA_ROOT_RETURN = 2 -const IDA_WARNING = 99 -const IDA_TOO_MUCH_WORK = -1 -const IDA_TOO_MUCH_ACC = -2 -const IDA_ERR_FAIL = -3 -const IDA_CONV_FAIL = -4 -const IDA_LINIT_FAIL = -5 -const IDA_LSETUP_FAIL = -6 -const IDA_LSOLVE_FAIL = -7 -const IDA_RES_FAIL = -8 -const IDA_REP_RES_ERR = -9 -const IDA_RTFUNC_FAIL = -10 -const IDA_CONSTR_FAIL = -11 -const IDA_FIRST_RES_FAIL = -12 -const IDA_LINESEARCH_FAIL = -13 -const IDA_NO_RECOVERY = -14 -const IDA_MEM_NULL = -20 -const IDA_MEM_FAIL = -21 -const IDA_ILL_INPUT = -22 -const IDA_NO_MALLOC = -23 -const IDA_BAD_EWT = -24 -const IDA_BAD_K = -25 -const IDA_BAD_T = -26 -const IDA_BAD_DKY = -27 - -typealias IDAResFn Ptr{Void} -typealias IDARootFn Ptr{Void} -typealias IDAEwtFn Ptr{Void} -typealias IDAErrHandlerFn Ptr{Void} - -const IDADLS_SUCCESS = 0 -const IDADLS_MEM_NULL = -1 -const IDADLS_LMEM_NULL = -2 -const IDADLS_ILL_INPUT = -3 -const IDADLS_MEM_FAIL = -4 -const IDADLS_JACFUNC_UNRECVR = -5 -const IDADLS_JACFUNC_RECVR = -6 - -typealias IDADlsDenseJacFn Ptr{Void} -typealias IDADlsBandJacFn Ptr{Void} - -const IDASPILS_SUCCESS = 0 -const IDASPILS_MEM_NULL = -1 -const IDASPILS_LMEM_NULL = -2 -const IDASPILS_ILL_INPUT = -3 -const IDASPILS_MEM_FAIL = -4 -const IDASPILS_PMEM_NULL = -5 - -# begin enum ANONYMOUS_13 -typealias ANONYMOUS_13 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_13 - -# begin enum ANONYMOUS_14 -typealias ANONYMOUS_14 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_14 - -typealias IDASpilsPrecSetupFn Ptr{Void} -typealias IDASpilsPrecSolveFn Ptr{Void} -typealias IDASpilsJacTimesVecFn Ptr{Void} - -const IDA_SIMULTANEOUS = 1 -const IDA_STAGGERED = 2 -const IDA_CENTERED = 1 -const IDA_FORWARD = 2 -const IDA_HERMITE = 1 -const IDA_POLYNOMIAL = 2 -const IDA_NO_QUAD = -30 -const IDA_QRHS_FAIL = -31 -const IDA_FIRST_QRHS_ERR = -32 -const IDA_REP_QRHS_ERR = -33 -const IDA_NO_SENS = -40 -const IDA_SRES_FAIL = -41 -const IDA_REP_SRES_ERR = -42 -const IDA_BAD_IS = -43 -const IDA_NO_QUADSENS = -50 -const IDA_QSRHS_FAIL = -51 -const IDA_FIRST_QSRHS_ERR = -52 -const IDA_REP_QSRHS_ERR = -53 -const IDA_NO_ADJ = -101 -const IDA_NO_FWD = -102 -const IDA_NO_BCK = -103 -const IDA_BAD_TB0 = -104 -const IDA_REIFWD_FAIL = -105 -const IDA_FWD_FAIL = -106 -const IDA_GETY_BADT = -107 - -typealias IDAQuadRhsFn Ptr{Void} -typealias IDASensResFn Ptr{Void} -typealias IDAQuadSensRhsFn Ptr{Void} -typealias IDAResFnB Ptr{Void} -typealias IDAResFnBS Ptr{Void} -typealias IDAQuadRhsFnB Ptr{Void} -typealias IDAQuadRhsFnBS Ptr{Void} - -type IDAadjCheckPointRec - my_addr::Ptr{Void} - next_addr::Ptr{Void} - t0::realtype - t1::realtype - nstep::Clong - order::Cint - step::realtype -end - -const IDADLS_NO_ADJ = -101 -const IDADLS_LMEMB_NULL = -102 - -typealias IDADlsDenseJacFnB Ptr{Void} -typealias IDADlsBandJacFnB Ptr{Void} - -const IDASPILS_NO_ADJ = -101 -const IDASPILS_LMEMB_NULL = -102 - -# begin enum ANONYMOUS_15 -typealias ANONYMOUS_15 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_15 - -# begin enum ANONYMOUS_16 -typealias ANONYMOUS_16 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_16 - -typealias IDASpilsPrecSetupFnB Ptr{Void} -typealias IDASpilsPrecSolveFnB Ptr{Void} -typealias IDASpilsJacTimesVecFnB Ptr{Void} - -const KIN_SUCCESS = 0 -const KIN_INITIAL_GUESS_OK = 1 -const KIN_STEP_LT_STPTOL = 2 -const KIN_WARNING = 99 -const KIN_MEM_NULL = -1 -const KIN_ILL_INPUT = -2 -const KIN_NO_MALLOC = -3 -const KIN_MEM_FAIL = -4 -const KIN_LINESEARCH_NONCONV = -5 -const KIN_MAXITER_REACHED = -6 -const KIN_MXNEWT_5X_EXCEEDED = -7 -const KIN_LINESEARCH_BCFAIL = -8 -const KIN_LINSOLV_NO_RECOVERY = -9 -const KIN_LINIT_FAIL = -10 -const KIN_LSETUP_FAIL = -11 -const KIN_LSOLVE_FAIL = -12 -const KIN_SYSFUNC_FAIL = -13 -const KIN_FIRST_SYSFUNC_ERR = -14 -const KIN_REPTD_SYSFUNC_ERR = -15 -const KIN_ETACHOICE1 = 1 -const KIN_ETACHOICE2 = 2 -const KIN_ETACONSTANT = 3 -const KIN_NONE = 0 -const KIN_LINESEARCH = 1 - -typealias KINSysFn Ptr{Void} -typealias KINErrHandlerFn Ptr{Void} -typealias KINInfoHandlerFn Ptr{Void} - -const KINDLS_SUCCESS = 0 -const KINDLS_MEM_NULL = -1 -const KINDLS_LMEM_NULL = -2 -const KINDLS_ILL_INPUT = -3 -const KINDLS_MEM_FAIL = -4 -const KINDLS_JACFUNC_UNRECVR = -5 -const KINDLS_JACFUNC_RECVR = -6 - -typealias KINDlsDenseJacFn Ptr{Void} -typealias KINDlsBandJacFn Ptr{Void} - -const KINSPILS_SUCCESS = 0 -const KINSPILS_MEM_NULL = -1 -const KINSPILS_LMEM_NULL = -2 -const KINSPILS_ILL_INPUT = -3 -const KINSPILS_MEM_FAIL = -4 -const KINSPILS_PMEM_NULL = -5 -const KINSPILS_MAXL = 10 - -# begin enum ANONYMOUS_17 -typealias ANONYMOUS_17 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_17 - -# begin enum ANONYMOUS_18 -typealias ANONYMOUS_18 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_18 - -typealias KINSpilsPrecSetupFn Ptr{Void} -typealias KINSpilsPrecSolveFn Ptr{Void} -typealias KINSpilsJacTimesVecFn Ptr{Void} - -# Skipping MacroDefinition: NV_CONTENT_S ( v ) ( ( N_VectorContent_Serial ) ( v -> content ) ) -# Skipping MacroDefinition: NV_LENGTH_S ( v ) ( NV_CONTENT_S ( v ) -> length ) -# Skipping MacroDefinition: NV_OWN_DATA_S ( v ) ( NV_CONTENT_S ( v ) -> own_data ) -# Skipping MacroDefinition: NV_DATA_S ( v ) ( NV_CONTENT_S ( v ) -> data ) -# Skipping MacroDefinition: NV_Ith_S ( v , i ) ( NV_DATA_S ( v ) [ i ] ) - -type _N_VectorContent_Serial - length::Clong - own_data::Cint - data::Ptr{realtype} -end - -typealias N_VectorContent_Serial Ptr{_N_VectorContent_Serial} - -const FCMIX_CVODE = 1 -const FCMIX_IDA = 2 -const FCMIX_KINSOL = 3 - -# Skipping MacroDefinition: MIN ( A , B ) ( ( A ) < ( B ) ? ( A ) : ( B ) ) -# Skipping MacroDefinition: MAX ( A , B ) ( ( A ) > ( B ) ? ( A ) : ( B ) ) -# Skipping MacroDefinition: SQR ( A ) ( ( A ) * ( A ) ) - -# const ABS = RAbs -# const SQRT = RSqrt -# const EXP = RExp - -typealias CVLocalFn Ptr{Void} -typealias CVCommFn Ptr{Void} - -const CVDIAG_SUCCESS = 0 -const CVDIAG_MEM_NULL = -1 -const CVDIAG_LMEM_NULL = -2 -const CVDIAG_ILL_INPUT = -3 -const CVDIAG_MEM_FAIL = -4 -const CVDIAG_INV_FAIL = -5 -const CVDIAG_RHSFUNC_UNRECVR = -6 -const CVDIAG_RHSFUNC_RECVR = -7 - -# Skipping MacroDefinition: va_start ( ap , param ) __builtin_va_start ( ap , param ) -# Skipping MacroDefinition: va_end ( ap ) __builtin_va_end ( ap ) -# Skipping MacroDefinition: va_arg ( ap , type ) __builtin_va_arg ( ap , type ) -# Skipping MacroDefinition: va_copy ( dest , src ) __builtin_va_copy ( dest , src ) - -const ADAMS_Q_MAX = 12 -const BDF_Q_MAX = 5 -const Q_MAX = ADAMS_Q_MAX -const L_MAX = Q_MAX + 1 -const NUM_TESTS = 5 - -# Skipping MacroDefinition: HMIN_DEFAULT RCONST ( 0.0 ) -# Skipping MacroDefinition: HMAX_INV_DEFAULT RCONST ( 0.0 ) - -const MXHNIL_DEFAULT = 10 -const MXSTEP_DEFAULT = 500 -const CV_NO_FAILURES = 0 -const CV_FAIL_BAD_J = 1 -const CV_FAIL_OTHER = 2 -const MSG_TIME = "t = %lg, " -const MSG_TIME_H = "t = %lg and h = %lg, " -const MSG_TIME_INT = "t = %lg is not between tcur - hu = %lg and tcur = %lg." -const MSG_TIME_TOUT = "tout = %lg" -const MSG_TIME_TSTOP = "tstop = %lg" -const MSGCV_NO_MEM = "cvode_mem = NULL illegal." -const MSGCV_CVMEM_FAIL = "Allocation of cvode_mem failed." -const MSGCV_MEM_FAIL = "A memory request failed." -const MSGCV_BAD_LMM = "Illegal value for lmm. The legal values are CV_ADAMS and CV_BDF." -const MSGCV_BAD_ITER = "Illegal value for iter. The legal values are CV_FUNCTIONAL and CV_NEWTON." -const MSGCV_NO_MALLOC = "Attempt to call before CVodeInit." -const MSGCV_NEG_MAXORD = "maxord <= 0 illegal." -const MSGCV_BAD_MAXORD = "Illegal attempt to increase maximum method order." -const MSGCV_SET_SLDET = "Attempt to use stability limit detection with the CV_ADAMS method illegal." -const MSGCV_NEG_HMIN = "hmin < 0 illegal." -const MSGCV_NEG_HMAX = "hmax < 0 illegal." -const MSGCV_BAD_HMIN_HMAX = "Inconsistent step size limits: hmin > hmax." -const MSGCV_BAD_RELTOL = "reltol < 0 illegal." -const MSGCV_BAD_ABSTOL = "abstol has negative component(s) (illegal)." -const MSGCV_NULL_ABSTOL = "abstol = NULL illegal." -const MSGCV_NULL_Y0 = "y0 = NULL illegal." -const MSGCV_NULL_F = "f = NULL illegal." -const MSGCV_NULL_G = "g = NULL illegal." -const MSGCV_BAD_NVECTOR = "A required vector operation is not implemented." -const MSGCV_BAD_K = "Illegal value for k." -const MSGCV_NULL_DKY = "dky = NULL illegal." -const MSGCV_BAD_T = "Illegal value for t." -const MSGCV_NO_ROOT = "Rootfinding was not initialized." -const MSGCV_NO_TOLS = "No integration tolerances for sensitivity variables have been specified." -const MSGCV_LSOLVE_NULL = "The linear solver's solve routine is NULL." -const MSGCV_YOUT_NULL = "yout = NULL illegal." -const MSGCV_TRET_NULL = "tret = NULL illegal." -const MSGCV_BAD_EWT = "Initial ewt has component(s) equal to zero (illegal)." - -# Skipping MacroDefinition: MSGCV_EWT_NOW_BAD "At " MSG_TIME ", a component of ewt has become <= 0." - -const MSGCV_BAD_ITASK = "Illegal value for itask." -const MSGCV_BAD_H0 = "h0 and tout - t0 inconsistent." - -# Skipping MacroDefinition: MSGCV_BAD_TOUT "Trouble interpolating at " MSG_TIME_TOUT ". tout too far back in direction of integration" - -const MSGCV_EWT_FAIL = "The user-provide EwtSet function failed." - -# Skipping MacroDefinition: MSGCV_EWT_NOW_FAIL "At " MSG_TIME ", the user-provide EwtSet function failed." - -const MSGCV_LINIT_FAIL = "The linear solver's init routine failed." -const MSGCV_HNIL_DONE = "The above warning has been issued mxhnil times and will not be issued again for this problem." -const MSGCV_TOO_CLOSE = "tout too close to t0 to start integration." - -# Skipping MacroDefinition: MSGCV_MAX_STEPS "At " MSG_TIME ", mxstep steps taken before reaching tout." -# Skipping MacroDefinition: MSGCV_TOO_MUCH_ACC "At " MSG_TIME ", too much accuracy requested." -# Skipping MacroDefinition: MSGCV_HNIL "Internal " MSG_TIME_H " are such that t + h = t on the next step. The solver will continue anyway." -# Skipping MacroDefinition: MSGCV_ERR_FAILS "At " MSG_TIME_H ", the error test failed repeatedly or with |h| = hmin." -# Skipping MacroDefinition: MSGCV_CONV_FAILS "At " MSG_TIME_H ", the corrector convergence test failed repeatedly or with |h| = hmin." -# Skipping MacroDefinition: MSGCV_SETUP_FAILED "At " MSG_TIME ", the setup routine failed in an unrecoverable manner." -# Skipping MacroDefinition: MSGCV_SOLVE_FAILED "At " MSG_TIME ", the solve routine failed in an unrecoverable manner." -# Skipping MacroDefinition: MSGCV_RHSFUNC_FAILED "At " MSG_TIME ", the right-hand side routine failed in an unrecoverable manner." -# Skipping MacroDefinition: MSGCV_RHSFUNC_UNREC "At " MSG_TIME ", the right-hand side failed in a recoverable manner, but no recovery is possible." -# Skipping MacroDefinition: MSGCV_RHSFUNC_REPTD "At " MSG_TIME " repeated recoverable right-hand side function errors." - -const MSGCV_RHSFUNC_FIRST = "The right-hand side routine failed at the first call." - -# Skipping MacroDefinition: MSGCV_RTFUNC_FAILED "At " MSG_TIME ", the rootfinding routine failed in an unrecoverable manner." -# Skipping MacroDefinition: MSGCV_CLOSE_ROOTS "Root found at and very near " MSG_TIME "." -# Skipping MacroDefinition: MSGCV_BAD_TSTOP "The value " MSG_TIME_TSTOP " is behind current " MSG_TIME " in the direction of integration." - -const MSGCV_INACTIVE_ROOTS = "At the end of the first step, there are still some root functions identically 0. This warning will not be issued again." - -immutable Array_13_N_Vector - d1::N_Vector - d2::N_Vector - d3::N_Vector - d4::N_Vector - d5::N_Vector - d6::N_Vector - d7::N_Vector - d8::N_Vector - d9::N_Vector - d10::N_Vector - d11::N_Vector - d12::N_Vector - d13::N_Vector -end - -zero(::Type{Array_13_N_Vector}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_13_N_Vector(fill(zero(N_Vector),13)...) - end - -immutable Array_14_realtype - d1::realtype - d2::realtype - d3::realtype - d4::realtype - d5::realtype - d6::realtype - d7::realtype - d8::realtype - d9::realtype - d10::realtype - d11::realtype - d12::realtype - d13::realtype - d14::realtype -end - -zero(::Type{Array_14_realtype}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_14_realtype(fill(zero(realtype),14)...) - end - -immutable Array_6_realtype - d1::realtype - d2::realtype - d3::realtype - d4::realtype - d5::realtype - d6::realtype -end - -zero(::Type{Array_6_realtype}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_6_realtype(fill(zero(realtype),6)...) - end - -immutable Array_13_realtype - d1::realtype - d2::realtype - d3::realtype - d4::realtype - d5::realtype - d6::realtype - d7::realtype - d8::realtype - d9::realtype - d10::realtype - d11::realtype - d12::realtype - d13::realtype -end - -zero(::Type{Array_13_realtype}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_13_realtype(fill(zero(realtype),13)...) - end - -immutable Array_4_realtype - d1::realtype - d2::realtype - d3::realtype - d4::realtype -end - -zero(::Type{Array_4_realtype}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_4_realtype(fill(zero(realtype),4)...) - end - -immutable Array_6_Array_4_realtype - d1::Array_4_realtype - d2::Array_4_realtype - d3::Array_4_realtype - d4::Array_4_realtype - d5::Array_4_realtype - d6::Array_4_realtype -end - -zero(::Type{Array_6_Array_4_realtype}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_6_Array_4_realtype(fill(zero(Array_4_realtype),6)...) - end - -type CVodeMemRec - cv_uround::realtype - cv_f::CVRhsFn - cv_user_data::Ptr{Void} - cv_lmm::Cint - cv_iter::Cint - cv_itol::Cint - cv_reltol::realtype - cv_Sabstol::realtype - cv_Vabstol::N_Vector - cv_user_efun::Cint - cv_efun::CVEwtFn - cv_e_data::Ptr{Void} - cv_zn::Array_13_N_Vector - cv_ewt::N_Vector - cv_y::N_Vector - cv_acor::N_Vector - cv_tempv::N_Vector - cv_ftemp::N_Vector - cv_tstopset::Cint - cv_tstop::realtype - cv_q::Cint - cv_qprime::Cint - cv_next_q::Cint - cv_qwait::Cint - cv_L::Cint - cv_hin::realtype - cv_h::realtype - cv_hprime::realtype - cv_next_h::realtype - cv_eta::realtype - cv_hscale::realtype - cv_tn::realtype - cv_tretlast::realtype - cv_tau::Array_14_realtype - cv_tq::Array_6_realtype - cv_l::Array_13_realtype - cv_rl1::realtype - cv_gamma::realtype - cv_gammap::realtype - cv_gamrat::realtype - cv_crate::realtype - cv_acnrm::realtype - cv_nlscoef::realtype - cv_mnewt::Cint - cv_qmax::Cint - cv_mxstep::Clong - cv_maxcor::Cint - cv_mxhnil::Cint - cv_maxnef::Cint - cv_maxncf::Cint - cv_hmin::realtype - cv_hmax_inv::realtype - cv_etamax::realtype - cv_nst::Clong - cv_nfe::Clong - cv_ncfn::Clong - cv_netf::Clong - cv_nni::Clong - cv_nsetups::Clong - cv_nhnil::Cint - cv_etaqm1::realtype - cv_etaq::realtype - cv_etaqp1::realtype - cv_lrw1::Clong - cv_liw1::Clong - cv_lrw::Clong - cv_liw::Clong - cv_linit::Ptr{Void} - cv_lsetup::Ptr{Void} - cv_lsolve::Ptr{Void} - cv_lfree::Ptr{Void} - cv_lmem::Ptr{Void} - cv_qu::Cint - cv_nstlp::Clong - cv_h0u::realtype - cv_hu::realtype - cv_saved_tq5::realtype - cv_jcur::Cint - cv_tolsf::realtype - cv_qmax_alloc::Cint - cv_indx_acor::Cint - cv_setupNonNull::Cint - cv_VabstolMallocDone::Cint - cv_MallocDone::Cint - cv_ehfun::CVErrHandlerFn - cv_eh_data::Ptr{Void} - # cv_errfp::Ptr{Void} - cv_errfp::Ptr{Void} - cv_sldeton::Cint - cv_ssdat::Array_6_Array_4_realtype - cv_nscon::Cint - cv_nor::Clong - cv_gfun::CVRootFn - cv_nrtfn::Cint - cv_iroots::Ptr{Cint} - cv_rootdir::Ptr{Cint} - cv_tlo::realtype - cv_thi::realtype - cv_trout::realtype - cv_glo::Ptr{realtype} - cv_ghi::Ptr{realtype} - cv_grout::Ptr{realtype} - cv_toutc::realtype - cv_ttol::realtype - cv_taskc::Cint - cv_irfnd::Cint - cv_nge::Clong - cv_gactive::Ptr{Cint} - cv_mxgnull::Cint -end - -typealias CVodeMem Ptr{CVodeMemRec} - -# begin enum ANONYMOUS_19 -typealias ANONYMOUS_19 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_19 - -# begin enum ANONYMOUS_20 -typealias ANONYMOUS_20 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_20 - -# begin enum ANONYMOUS_21 -typealias ANONYMOUS_21 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_21 - -# begin enum ANONYMOUS_22 -typealias ANONYMOUS_22 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_22 - -# begin enum ANONYMOUS_23 -typealias ANONYMOUS_23 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_23 - -# begin enum ANONYMOUS_24 -typealias ANONYMOUS_24 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_24 - -typealias CVLocalFnB Ptr{Void} -typealias CVCommFnB Ptr{Void} - -const CVDIAG_NO_ADJ = -101 -const MSGCV_NO_QUAD = "Quadrature integration not activated." -const MSGCV_BAD_ITOLQ = "Illegal value for itolQ. The legal values are CV_SS and CV_SV." -const MSGCV_NULL_ABSTOLQ = "abstolQ = NULL illegal." -const MSGCV_BAD_RELTOLQ = "reltolQ < 0 illegal." -const MSGCV_BAD_ABSTOLQ = "abstolQ has negative component(s) (illegal)." -const MSGCV_SENSINIT_2 = "Sensitivity analysis already initialized." -const MSGCV_NO_SENSI = "Forward sensitivity analysis not activated." -const MSGCV_BAD_ITOLS = "Illegal value for itolS. The legal values are CV_SS, CV_SV, and CV_EE." -const MSGCV_NULL_ABSTOLS = "abstolS = NULL illegal." -const MSGCV_BAD_RELTOLS = "reltolS < 0 illegal." -const MSGCV_BAD_ABSTOLS = "abstolS has negative component(s) (illegal)." -const MSGCV_BAD_PBAR = "pbar has zero component(s) (illegal)." -const MSGCV_BAD_PLIST = "plist has negative component(s) (illegal)." -const MSGCV_BAD_NS = "NS <= 0 illegal." -const MSGCV_NULL_YS0 = "yS0 = NULL illegal." -const MSGCV_BAD_ISM = "Illegal value for ism. Legal values are: CV_SIMULTANEOUS, CV_STAGGERED and CV_STAGGERED1." -const MSGCV_BAD_IFS = "Illegal value for ifS. Legal values are: CV_ALLSENS and CV_ONESENS." -const MSGCV_BAD_ISM_IFS = "Illegal ism = CV_STAGGERED1 for CVodeSensInit." -const MSGCV_BAD_IS = "Illegal value for is." -const MSGCV_NULL_DKYA = "dkyA = NULL illegal." -const MSGCV_BAD_DQTYPE = "Illegal value for DQtype. Legal values are: CV_CENTERED and CV_FORWARD." -const MSGCV_BAD_DQRHO = "DQrhomax < 0 illegal." -const MSGCV_BAD_ITOLQS = "Illegal value for itolQS. The legal values are CV_SS, CV_SV, and CV_EE." -const MSGCV_NULL_ABSTOLQS = "abstolQS = NULL illegal." -const MSGCV_BAD_RELTOLQS = "reltolQS < 0 illegal." -const MSGCV_BAD_ABSTOLQS = "abstolQS has negative component(s) (illegal)." -const MSGCV_NO_QUADSENSI = "Forward sensitivity analysis for quadrature variables not activated." -const MSGCV_NULL_YQS0 = "yQS0 = NULL illegal." -const MSGCV_NO_TOL = "No integration tolerances have been specified." -const MSGCV_NO_TOLQ = "No integration tolerances for quadrature variables have been specified." -const MSGCV_BAD_EWTQ = "Initial ewtQ has component(s) equal to zero (illegal)." - -# Skipping MacroDefinition: MSGCV_EWTQ_NOW_BAD "At " MSG_TIME ", a component of ewtQ has become <= 0." -# Skipping MacroDefinition: MSGCV_QRHSFUNC_FAILED "At " MSG_TIME ", the quadrature right-hand side routine failed in an unrecoverable manner." -# Skipping MacroDefinition: MSGCV_QRHSFUNC_UNREC "At " MSG_TIME ", the quadrature right-hand side failed in a recoverable manner, but no recovery is possible." -# Skipping MacroDefinition: MSGCV_QRHSFUNC_REPTD "At " MSG_TIME " repeated recoverable quadrature right-hand side function errors." - -const MSGCV_QRHSFUNC_FIRST = "The quadrature right-hand side routine failed at the first call." -const MSGCV_NULL_P = "p = NULL when using internal DQ for sensitivity RHS illegal." -const MSGCV_BAD_EWTS = "Initial ewtS has component(s) equal to zero (illegal)." - -# Skipping MacroDefinition: MSGCV_EWTS_NOW_BAD "At " MSG_TIME ", a component of ewtS has become <= 0." -# Skipping MacroDefinition: MSGCV_SRHSFUNC_FAILED "At " MSG_TIME ", the sensitivity right-hand side routine failed in an unrecoverable manner." -# Skipping MacroDefinition: MSGCV_SRHSFUNC_UNREC "At " MSG_TIME ", the sensitivity right-hand side failed in a recoverable manner, but no recovery is possible." -# Skipping MacroDefinition: MSGCV_SRHSFUNC_REPTD "At " MSG_TIME " repeated recoverable sensitivity right-hand side function errors." - -const MSGCV_SRHSFUNC_FIRST = "The sensitivity right-hand side routine failed at the first call." -const MSGCV_NULL_FQ = "CVODES is expected to use DQ to evaluate the RHS of quad. sensi., but quadratures were not initialized." -const MSGCV_NO_TOLQS = "No integration tolerances for quadrature sensitivity variables have been specified." -const MSGCV_BAD_EWTQS = "Initial ewtQS has component(s) equal to zero (illegal)." - -# Skipping MacroDefinition: MSGCV_EWTQS_NOW_BAD "At " MSG_TIME ", a component of ewtQS has become <= 0." -# Skipping MacroDefinition: MSGCV_QSRHSFUNC_FAILED "At " MSG_TIME ", the quadrature sensitivity right-hand side routine failed in an unrecoverable manner." -# Skipping MacroDefinition: MSGCV_QSRHSFUNC_UNREC "At " MSG_TIME ", the quadrature sensitivity right-hand side failed in a recoverable manner, but no recovery is possible." -# Skipping MacroDefinition: MSGCV_QSRHSFUNC_REPTD "At " MSG_TIME " repeated recoverable quadrature sensitivity right-hand side function errors." - -const MSGCV_QSRHSFUNC_FIRST = "The quadrature sensitivity right-hand side routine failed at the first call." -const MSGCV_NO_ADJ = "Illegal attempt to call before calling CVodeAdjMalloc." -const MSGCV_BAD_STEPS = "Steps nonpositive illegal." -const MSGCV_BAD_INTERP = "Illegal value for interp." -const MSGCV_BAD_WHICH = "Illegal value for which." -const MSGCV_NO_BCK = "No backward problems have been defined yet." -const MSGCV_NO_FWD = "Illegal attempt to call before calling CVodeF." -const MSGCV_BAD_TB0 = "The initial time tB0 for problem %d is outside the interval over which the forward problem was solved." -const MSGCV_BAD_SENSI = "At least one backward problem requires sensitivities, but they were not stored for interpolation." -const MSGCV_BAD_ITASKB = "Illegal value for itaskB. Legal values are CV_NORMAL and CV_ONE_STEP." -const MSGCV_BAD_TBOUT = "The final time tBout is outside the interval over which the forward problem was solved." -const MSGCV_BACK_ERROR = "Error occured while integrating backward problem # %d" -const MSGCV_BAD_TINTERP = "Bad t = %g for interpolation." -const MSGCV_WRONG_INTERP = "This function cannot be called for the specified interp type." - -type CVodeBMemRec - cv_index::Cint - cv_t0::realtype - cv_mem::CVodeMem - cv_f_withSensi::Cint - cv_fQ_withSensi::Cint - cv_f::CVRhsFnB - cv_fs::CVRhsFnBS - cv_fQ::CVQuadRhsFnB - cv_fQs::CVQuadRhsFnBS - cv_user_data::Ptr{Void} - cv_lmem::Ptr{Void} - cv_lfree::Ptr{Void} - cv_pmem::Ptr{Void} - cv_pfree::Ptr{Void} - cv_tout::realtype - cv_y::N_Vector - cv_next::Ptr{CVodeBMemRec} -end - -immutable Array_13_Ptr - d1::Ptr{N_Vector} - d2::Ptr{N_Vector} - d3::Ptr{N_Vector} - d4::Ptr{N_Vector} - d5::Ptr{N_Vector} - d6::Ptr{N_Vector} - d7::Ptr{N_Vector} - d8::Ptr{N_Vector} - d9::Ptr{N_Vector} - d10::Ptr{N_Vector} - d11::Ptr{N_Vector} - d12::Ptr{N_Vector} - d13::Ptr{N_Vector} -end - -zero(::Type{Array_13_Ptr}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_13_Ptr(fill(zero(Ptr{N_Vector}),13)...) - end - -type CkpntMemRec - ck_t0::realtype - ck_t1::realtype - ck_zn::Array_13_N_Vector - ck_quadr::Cint - ck_znQ::Array_13_N_Vector - ck_sensi::Cint - ck_Ns::Cint - ck_znS::Array_13_Ptr - ck_quadr_sensi::Cint - ck_znQS::Array_13_Ptr - ck_zqm::Cint - ck_nst::Clong - ck_tretlast::realtype - ck_q::Cint - ck_qprime::Cint - ck_qwait::Cint - ck_L::Cint - ck_gammap::realtype - ck_h::realtype - ck_hprime::realtype - ck_hscale::realtype - ck_eta::realtype - ck_etamax::realtype - ck_tau::Array_14_realtype - ck_tq::Array_6_realtype - ck_l::Array_13_realtype - ck_saved_tq5::realtype - ck_next::Ptr{CkpntMemRec} -end - -type DtpntMemRec - t::realtype - content::Ptr{Void} -end - -typealias cvaIMMallocFn Ptr{Void} -typealias cvaIMFreeFn Ptr{Void} -typealias cvaIMStorePntFn Ptr{Void} -typealias cvaIMGetYFn Ptr{Void} - -type CVadjMemRec - ca_tinitial::realtype - ca_tfinal::realtype - ca_firstCVodeFcall::Cint - ca_tstopCVodeFcall::Cint - ca_tstopCVodeF::realtype - cvB_mem::Ptr{CVodeBMemRec} - ca_nbckpbs::Cint - ca_bckpbCrt::Ptr{CVodeBMemRec} - ca_firstCVodeBcall::Cint - ck_mem::Ptr{CkpntMemRec} - ca_nckpnts::Cint - ca_ckpntData::Ptr{CkpntMemRec} - ca_nsteps::Clong - dt_mem::Ptr{Ptr{DtpntMemRec}} - ca_np::Clong - ca_IMtype::Cint - ca_IMmalloc::cvaIMMallocFn - ca_IMfree::cvaIMFreeFn - ca_IMstore::cvaIMStorePntFn - ca_IMget::cvaIMGetYFn - ca_IMmallocDone::Cint - ca_IMnewData::Cint - ca_IMstoreSensi::Cint - ca_IMinterpSensi::Cint - ca_Y::Array_13_N_Vector - ca_YS::Array_13_Ptr - ca_T::Array_13_realtype - ca_ytmp::N_Vector - ca_yStmp::Ptr{N_Vector} -end - -typealias CVadjMem Ptr{CVadjMemRec} -typealias CkpntMem Ptr{CkpntMemRec} -typealias DtpntMem Ptr{DtpntMemRec} -typealias CVodeBMem Ptr{CVodeBMemRec} - -type HermiteDataMemRec - y::N_Vector - yd::N_Vector - yS::Ptr{N_Vector} - ySd::Ptr{N_Vector} -end - -typealias HermiteDataMem Ptr{HermiteDataMemRec} - -type PolynomialDataMemRec - y::N_Vector - yS::Ptr{N_Vector} - order::Cint -end - -typealias PolynomialDataMem Ptr{PolynomialDataMemRec} - -# begin enum ANONYMOUS_25 -typealias ANONYMOUS_25 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_25 - -# begin enum ANONYMOUS_26 -typealias ANONYMOUS_26 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_26 - -# begin enum ANONYMOUS_27 -typealias ANONYMOUS_27 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_27 - -# begin enum ANONYMOUS_28 -typealias ANONYMOUS_28 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_28 - -# begin enum ANONYMOUS_29 -typealias ANONYMOUS_29 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_29 - -# begin enum ANONYMOUS_30 -typealias ANONYMOUS_30 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_30 - -typealias IDABBDLocalFn Ptr{Void} -typealias IDABBDCommFn Ptr{Void} - -const MAXORD_DEFAULT = 5 -const MXORDP1 = 6 -const MSG_MEM_FAIL = "A memory request failed." -const MSG_NO_MEM = "kinsol_mem = NULL illegal." -const MSG_NO_MALLOC = "Attempt to call before KINMalloc illegal." -const MSG_BAD_NVECTOR = "A required vector operation is not implemented." -const MSG_Y0_NULL = "y0 = NULL illegal." -const MSG_YP0_NULL = "yp0 = NULL illegal." -const MSG_BAD_ITOL = "Illegal value for itol. The legal values are IDA_SS, IDA_SV, and IDA_WF." -const MSG_RES_NULL = "res = NULL illegal." -const MSG_BAD_RTOL = "rtol < 0 illegal." -const MSG_ATOL_NULL = "atol = NULL illegal." -const MSG_BAD_ATOL = "Some atol component < 0.0 illegal." -const MSG_ROOT_FUNC_NULL = "g = NULL illegal." -const MSG_MISSING_ID = "id = NULL but suppressalg option on." -const MSG_NO_TOLS = "No integration tolerances have been specified." -const MSG_FAIL_EWT = "The user-provide EwtSet function failed." -const MSG_BAD_EWT = "Some initial ewt component = 0.0 illegal." -const MSG_Y0_FAIL_CONSTR = "y0 fails to satisfy constraints." -const MSG_LSOLVE_NULL = "The linear solver's solve routine is NULL." -const MSG_LINIT_FAIL = "The linear solver's init routine failed." -const MSG_IC_BAD_ICOPT = "icopt has an illegal value." -const MSG_IC_MISSING_ID = "id = NULL conflicts with icopt." -const MSG_IC_TOO_CLOSE = "tout1 too close to t0 to attempt initial condition calculation." -const MSG_IC_BAD_ID = "id has illegal values." -const MSG_IC_BAD_EWT = "Some initial ewt component = 0.0 illegal." -const MSG_IC_RES_NONREC = "The residual function failed unrecoverably. " -const MSG_IC_RES_FAIL = "The residual function failed at the first call. " -const MSG_IC_SETUP_FAIL = "The linear solver setup failed unrecoverably." -const MSG_IC_SOLVE_FAIL = "The linear solver solve failed unrecoverably." -const MSG_IC_NO_RECOVERY = "The residual routine or the linear setup or solve routine had a recoverable error, but IDACalcIC was unable to recover." -const MSG_IC_FAIL_CONSTR = "Unable to satisfy the inequality constraints." -const MSG_IC_FAILED_LINS = "The linesearch algorithm failed with too small a step." -const MSG_IC_CONV_FAILED = "Newton/Linesearch algorithm failed to converge." -const MSG_YRET_NULL = "yret = NULL illegal." -const MSG_YPRET_NULL = "ypret = NULL illegal." -const MSG_TRET_NULL = "tret = NULL illegal." -const MSG_BAD_ITASK = "itask has an illegal value." -const MSG_TOO_CLOSE = "tout too close to t0 to start integration." -const MSG_BAD_HINIT = "Initial step is not towards tout." - -# Skipping MacroDefinition: MSG_BAD_TSTOP "The value " MSG_TIME_TSTOP " is behind current " MSG_TIME "in the direction of integration." -# Skipping MacroDefinition: MSG_CLOSE_ROOTS "Root found at and very near " MSG_TIME "." -# Skipping MacroDefinition: MSG_MAX_STEPS "At " MSG_TIME ", mxstep steps taken before reaching tout." -# Skipping MacroDefinition: MSG_EWT_NOW_FAIL "At " MSG_TIME "the user-provide EwtSet function failed." -# Skipping MacroDefinition: MSG_EWT_NOW_BAD "At " MSG_TIME "some ewt component has become <= 0.0." -# Skipping MacroDefinition: MSG_TOO_MUCH_ACC "At " MSG_TIME "too much accuracy requested." - -const MSG_BAD_K = "Illegal value for k." -const MSG_NULL_DKY = "dky = NULL illegal." -const MSG_BAD_T = "Illegal value for t. " - -# Skipping MacroDefinition: MSG_BAD_TOUT "Trouble interpolating at " MSG_TIME_TOUT ". tout too far back in direction of integration." -# Skipping MacroDefinition: MSG_ERR_FAILS "At " MSG_TIME_H "the error test failed repeatedly or with |h| = hmin." -# Skipping MacroDefinition: MSG_CONV_FAILS "At " MSG_TIME_H "the corrector convergence failed repeatedly or with |h| = hmin." -# Skipping MacroDefinition: MSG_SETUP_FAILED "At " MSG_TIME "the linear solver setup failed unrecoverably." -# Skipping MacroDefinition: MSG_SOLVE_FAILED "At " MSG_TIME "the linear solver solve failed unrecoverably." -# Skipping MacroDefinition: MSG_REP_RES_ERR "At " MSG_TIME "repeated recoverable residual errors." -# Skipping MacroDefinition: MSG_RES_NONRECOV "At " MSG_TIME "the residual function failed unrecoverably." -# Skipping MacroDefinition: MSG_FAILED_CONSTR "At " MSG_TIME "unable to satisfy inequality constraints." -# Skipping MacroDefinition: MSG_RTFUNC_FAILED "At " MSG_TIME ", the rootfinding routine failed in an unrecoverable manner." - -const MSG_NO_ROOT = "Rootfinding was not initialized." -const MSG_INACTIVE_ROOTS = "At the end of the first step, there are still some root functions identically 0. This warning will not be issued again." -const MSG_NEG_MAXORD = "maxord<=0 illegal." -const MSG_BAD_MAXORD = "Illegal attempt to increase maximum order." -const MSG_NEG_HMAX = "hmax < 0 illegal." -const MSG_NEG_EPCON = "epcon <= 0.0 illegal." -const MSG_BAD_CONSTR = "Illegal values in constraints vector." -const MSG_BAD_EPICCON = "epiccon <= 0.0 illegal." -const MSG_BAD_MAXNH = "maxnh <= 0 illegal." -const MSG_BAD_MAXNJ = "maxnj <= 0 illegal." -const MSG_BAD_MAXNIT = "maxnit <= 0 illegal." -const MSG_BAD_STEPTOL = "steptol <= 0.0 illegal." -const MSG_TOO_LATE = "IDAGetConsistentIC can only be called before IDASolve." - -immutable Array_6_N_Vector - d1::N_Vector - d2::N_Vector - d3::N_Vector - d4::N_Vector - d5::N_Vector - d6::N_Vector -end - -zero(::Type{Array_6_N_Vector}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_6_N_Vector(fill(zero(N_Vector),6)...) - end - -type IDAMemRec - ida_uround::realtype - ida_res::IDAResFn - ida_user_data::Ptr{Void} - ida_itol::Cint - ida_rtol::realtype - ida_Satol::realtype - ida_Vatol::N_Vector - ida_user_efun::Cint - ida_efun::IDAEwtFn - ida_edata::Ptr{Void} - ida_setupNonNull::Cint - ida_constraintsSet::Cint - ida_suppressalg::Cint - ida_phi::Array_6_N_Vector - ida_psi::Array_6_realtype - ida_alpha::Array_6_realtype - ida_beta::Array_6_realtype - ida_sigma::Array_6_realtype - ida_gamma::Array_6_realtype - ida_ewt::N_Vector - ida_yy::N_Vector - ida_yp::N_Vector - ida_delta::N_Vector - ida_id::N_Vector - ida_constraints::N_Vector - ida_savres::N_Vector - ida_ee::N_Vector - ida_mm::N_Vector - ida_tempv1::N_Vector - ida_tempv2::N_Vector - ida_ynew::N_Vector - ida_ypnew::N_Vector - ida_delnew::N_Vector - ida_dtemp::N_Vector - ida_t0::realtype - ida_yy0::N_Vector - ida_yp0::N_Vector - ida_icopt::Cint - ida_lsoff::Cint - ida_maxnh::Cint - ida_maxnj::Cint - ida_maxnit::Cint - ida_nbacktr::Cint - ida_sysindex::Cint - ida_epiccon::realtype - ida_steptol::realtype - ida_tscale::realtype - ida_tstopset::Cint - ida_tstop::realtype - ida_kk::Cint - ida_kused::Cint - ida_knew::Cint - ida_phase::Cint - ida_ns::Cint - ida_hin::realtype - ida_h0u::realtype - ida_hh::realtype - ida_hused::realtype - ida_rr::realtype - ida_tn::realtype - ida_tretlast::realtype - ida_cj::realtype - ida_cjlast::realtype - ida_cjold::realtype - ida_cjratio::realtype - ida_ss::realtype - ida_epsNewt::realtype - ida_epcon::realtype - ida_toldel::realtype - ida_maxncf::Cint - ida_maxcor::Cint - ida_maxnef::Cint - ida_maxord::Cint - ida_maxord_alloc::Cint - ida_mxstep::Clong - ida_hmax_inv::realtype - ida_nst::Clong - ida_nre::Clong - ida_ncfn::Clong - ida_netf::Clong - ida_nni::Clong - ida_nsetups::Clong - ida_lrw1::Clong - ida_liw1::Clong - ida_lrw::Clong - ida_liw::Clong - ida_tolsf::realtype - ida_ehfun::IDAErrHandlerFn - ida_eh_data::Ptr{Void} - # ida_errfp::Ptr{Void} - ida_errfp::Ptr{Void} - ida_SetupDone::Cint - ida_VatolMallocDone::Cint - ida_constraintsMallocDone::Cint - ida_idMallocDone::Cint - ida_MallocDone::Cint - ida_linit::Ptr{Void} - ida_lsetup::Ptr{Void} - ida_lsolve::Ptr{Void} - ida_lperf::Ptr{Void} - ida_lfree::Ptr{Void} - ida_lmem::Ptr{Void} - ida_linitOK::Cint - ida_gfun::IDARootFn - ida_nrtfn::Cint - ida_iroots::Ptr{Cint} - ida_rootdir::Ptr{Cint} - ida_tlo::realtype - ida_thi::realtype - ida_trout::realtype - ida_glo::Ptr{realtype} - ida_ghi::Ptr{realtype} - ida_grout::Ptr{realtype} - ida_toutc::realtype - ida_ttol::realtype - ida_taskc::Cint - ida_irfnd::Cint - ida_nge::Clong - ida_gactive::Ptr{Cint} - ida_mxgnull::Cint -end - -typealias IDAMem Ptr{IDAMemRec} - -# begin enum ANONYMOUS_31 -typealias ANONYMOUS_31 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_31 - -# begin enum ANONYMOUS_32 -typealias ANONYMOUS_32 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_32 - -# begin enum ANONYMOUS_33 -typealias ANONYMOUS_33 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_33 - -# begin enum ANONYMOUS_34 -typealias ANONYMOUS_34 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_34 - -# begin enum ANONYMOUS_35 -typealias ANONYMOUS_35 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_35 - -# begin enum ANONYMOUS_36 -typealias ANONYMOUS_36 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_36 - -typealias IDABBDLocalFnB Ptr{Void} -typealias IDABBDCommFnB Ptr{Void} - -const IDA_NN = 0 -const IDA_SS = 1 -const IDA_SV = 2 -const IDA_WF = 3 -const IDA_EE = 4 -const MSG_BAD_ISM_CONSTR = "Constraints can not be enforced while forward sensitivity is used with simultaneous method." -const MSG_NO_QUAD = "Illegal attempt to call before calling IDAQuadInit." -const MSG_BAD_EWTQ = "Initial ewtQ has component(s) equal to zero (illegal)." -const MSG_BAD_ITOLQ = "Illegal value for itolQ. The legal values are IDA_SS and IDA_SV." -const MSG_NO_TOLQ = "No integration tolerances for quadrature variables have been specified." -const MSG_NULL_ATOLQ = "atolQ = NULL illegal." -const MSG_BAD_RTOLQ = "rtolQ < 0 illegal." -const MSG_BAD_ATOLQ = "atolQ has negative component(s) (illegal)." -const MSG_NO_SENSI = "Illegal attempt to call before calling IDASensInit." -const MSG_BAD_EWTS = "Initial ewtS has component(s) equal to zero (illegal)." -const MSG_BAD_ITOLS = "Illegal value for itolS. The legal values are IDA_SS, IDA_SV, and IDA_EE." -const MSG_NULL_ATOLS = "atolS = NULL illegal." -const MSG_BAD_RTOLS = "rtolS < 0 illegal." -const MSG_BAD_ATOLS = "atolS has negative component(s) (illegal)." -const MSG_BAD_PBAR = "pbar has zero component(s) (illegal)." -const MSG_BAD_PLIST = "plist has negative component(s) (illegal)." -const MSG_BAD_NS = "NS <= 0 illegal." -const MSG_NULL_YYS0 = "yyS0 = NULL illegal." -const MSG_NULL_YPS0 = "ypS0 = NULL illegal." -const MSG_BAD_ISM = "Illegal value for ism. Legal values are: IDA_SIMULTANEOUS and IDA_STAGGERED." -const MSG_BAD_IS = "Illegal value for is." -const MSG_NULL_DKYA = "dkyA = NULL illegal." -const MSG_BAD_DQTYPE = "Illegal value for DQtype. Legal values are: IDA_CENTERED and IDA_FORWARD." -const MSG_BAD_DQRHO = "DQrhomax < 0 illegal." -const MSG_NULL_ABSTOLQS = "abstolQS = NULL illegal parameter." -const MSG_BAD_RELTOLQS = "reltolQS < 0 illegal parameter." -const MSG_BAD_ABSTOLQS = "abstolQS has negative component(s) (illegal)." -const MSG_NO_QUADSENSI = "Forward sensitivity analysis for quadrature variables was not activated." -const MSG_NULL_YQS0 = "yQS0 = NULL illegal parameter." -const MSG_NULL_DKYP = "dkyp = NULL illegal." - -# Skipping MacroDefinition: MSG_EWTQ_NOW_BAD "At " MSG_TIME ", a component of ewtQ has become <= 0." -# Skipping MacroDefinition: MSG_QRHSFUNC_FAILED "At " MSG_TIME ", the quadrature right-hand side routine failed in an unrecoverable manner." -# Skipping MacroDefinition: MSG_QRHSFUNC_UNREC "At " MSG_TIME ", the quadrature right-hand side failed in a recoverable manner, but no recovery is possible." -# Skipping MacroDefinition: MSG_QRHSFUNC_REPTD "At " MSG_TIME "repeated recoverable quadrature right-hand side function errors." - -const MSG_QRHSFUNC_FIRST = "The quadrature right-hand side routine failed at the first call." -const MSG_NULL_P = "p = NULL when using internal DQ for sensitivity residual is illegal." - -# Skipping MacroDefinition: MSG_EWTS_NOW_BAD "At " MSG_TIME ", a component of ewtS has become <= 0." -# Skipping MacroDefinition: MSG_SRHSFUNC_FAILED "At " MSG_TIME ", the sensitivity residual routine failed in an unrecoverable manner." -# Skipping MacroDefinition: MSG_SRHSFUNC_UNREC "At " MSG_TIME ", the sensitivity residual failed in a recoverable manner, but no recovery is possible." -# Skipping MacroDefinition: MSG_SRHSFUNC_REPTD "At " MSG_TIME "repeated recoverable sensitivity residual function errors." - -const MSG_NO_TOLQS = "No integration tolerances for quadrature sensitivity variables have been specified." -const MSG_NULL_RHSQ = "IDAS is expected to use DQ to evaluate the RHS of quad. sensi., but quadratures were not initialized." -const MSG_BAD_EWTQS = "Initial ewtQS has component(s) equal to zero (illegal)." - -# Skipping MacroDefinition: MSG_EWTQS_NOW_BAD "At " MSG_TIME ", a component of ewtQS has become <= 0." -# Skipping MacroDefinition: MSG_QSRHSFUNC_FAILED "At " MSG_TIME ", the sensitivity quadrature right-hand side routine failed in an unrecoverable manner." - -const MSG_QSRHSFUNC_FIRST = "The quadrature right-hand side routine failed at the first call." -const MSGAM_NULL_IDAMEM = "ida_mem = NULL illegal." -const MSGAM_NO_ADJ = "Illegal attempt to call before calling IDAadjInit." -const MSGAM_BAD_INTERP = "Illegal value for interp." -const MSGAM_BAD_STEPS = "Steps nonpositive illegal." -const MSGAM_BAD_WHICH = "Illegal value for which." -const MSGAM_NO_BCK = "No backward problems have been defined yet." -const MSGAM_NO_FWD = "Illegal attempt to call before calling IDASolveF." -const MSGAM_BAD_TB0 = "The initial time tB0 is outside the interval over which the forward problem was solved." -const MSGAM_BAD_SENSI = "At least one backward problem requires sensitivities, but they were not stored for interpolation." -const MSGAM_BAD_ITASKB = "Illegal value for itaskB. Legal values are IDA_NORMAL and IDA_ONE_STEP." -const MSGAM_BAD_TBOUT = "The final time tBout is outside the interval over which the forward problem was solved." -const MSGAM_BACK_ERROR = "Error occured while integrating backward problem # %d" -const MSGAM_BAD_TINTERP = "Bad t = %g for interpolation." -const MSGAM_BAD_T = "Bad t for interpolation." -const MSGAM_WRONG_INTERP = "This function cannot be called for the specified interp type." -const MSGAM_MEM_FAIL = "A memory request failed." -const MSGAM_NO_INITBS = "Illegal attempt to call before calling IDAInitBS." - -immutable Array_6_Ptr - d1::Ptr{N_Vector} - d2::Ptr{N_Vector} - d3::Ptr{N_Vector} - d4::Ptr{N_Vector} - d5::Ptr{N_Vector} - d6::Ptr{N_Vector} -end - -zero(::Type{Array_6_Ptr}) = begin # /Users/jgoldfar/.julia/v0.4/Clang/src/wrap_c.jl, line 266: - Array_6_Ptr(fill(zero(Ptr{N_Vector}),6)...) - end - -type IDABMemRec - ida_index::Cint - ida_t0::realtype - IDA_mem::IDAMem - ida_res_withSensi::Cint - ida_rhsQ_withSensi::Cint - ida_res::IDAResFnB - ida_resS::IDAResFnBS - ida_rhsQ::IDAQuadRhsFnB - ida_rhsQS::IDAQuadRhsFnBS - ida_user_data::Ptr{Void} - ida_lmem::Ptr{Void} - ida_lfree::Ptr{Void} - ida_pmem::Ptr{Void} - ida_pfree::Ptr{Void} - ida_tout::realtype - ida_yy::N_Vector - ida_yp::N_Vector - ida_next::Ptr{IDABMemRec} -end - -typealias IDAAStorePntFn Ptr{Void} -typealias IDAAGetYFn Ptr{Void} -typealias IDAAMMallocFn Ptr{Void} -typealias IDAAMFreeFn Ptr{Void} - -type IDAadjMemRec - ia_tinitial::realtype - ia_tfinal::realtype - ia_firstIDAFcall::Cint - ia_tstopIDAFcall::Cint - ia_tstopIDAF::realtype - IDAB_mem::Ptr{IDABMemRec} - ia_nbckpbs::Cint - ia_bckpbCrt::Ptr{IDABMemRec} - ia_firstIDABcall::Cint - ck_mem::Ptr{CkpntMemRec} - ia_ckpntData::Ptr{CkpntMemRec} - ia_nckpnts::Cint - ia_nsteps::Clong - dt_mem::Ptr{Ptr{DtpntMemRec}} - ia_np::Clong - ia_interpType::Cint - ia_storePnt::IDAAStorePntFn - ia_getY::IDAAGetYFn - ia_malloc::IDAAMMallocFn - ia_free::IDAAMFreeFn - ia_mallocDone::Cint - ia_newData::Cint - ia_storeSensi::Cint - ia_interpSensi::Cint - ia_noInterp::Cint - ia_Y::Array_6_N_Vector - ia_YS::Array_6_Ptr - ia_T::Array_6_realtype - ia_yyTmp::N_Vector - ia_ypTmp::N_Vector - ia_yySTmp::Ptr{N_Vector} - ia_ypSTmp::Ptr{N_Vector} -end - -typealias IDAadjMem Ptr{IDAadjMemRec} -typealias IDABMem Ptr{IDABMemRec} - -# begin enum ANONYMOUS_37 -typealias ANONYMOUS_37 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_37 - -# begin enum ANONYMOUS_38 -typealias ANONYMOUS_38 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_38 - -# begin enum ANONYMOUS_39 -typealias ANONYMOUS_39 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_39 - -# begin enum ANONYMOUS_40 -typealias ANONYMOUS_40 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_40 - -# begin enum ANONYMOUS_41 -typealias ANONYMOUS_41 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_41 - -# begin enum ANONYMOUS_42 -typealias ANONYMOUS_42 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_42 - -const KINBBDPRE_SUCCESS = 0 -const KINBBDPRE_PDATA_NULL = -11 -const KINBBDPRE_FUNC_UNRECVR = -12 - -typealias KINCommFn Ptr{Void} -typealias KINLocalFn Ptr{Void} - -const PRINTFL_DEFAULT = 0 -const MXITER_DEFAULT = 200 -const MXNBCF_DEFAULT = 10 -const MSBSET_DEFAULT = 10 -const MSBSET_SUB_DEFAULT = 5 - -# Skipping MacroDefinition: OMEGA_MIN RCONST ( 0.00001 ) -# Skipping MacroDefinition: OMEGA_MAX RCONST ( 0.9 ) - -const MSG_FUNC_NULL = "func = NULL illegal." -const MSG_BAD_PRINTFL = "Illegal value for printfl." -const MSG_BAD_MXITER = "Illegal value for mxiter." -const MSG_BAD_MSBSET = "Illegal msbset < 0." -const MSG_BAD_MSBSETSUB = "Illegal msbsetsub < 0." -const MSG_BAD_ETACHOICE = "Illegal value for etachoice." -const MSG_BAD_ETACONST = "eta out of range." -const MSG_BAD_GAMMA = "gamma out of range." -const MSG_BAD_ALPHA = "alpha out of range." -const MSG_BAD_MXNEWTSTEP = "Illegal mxnewtstep < 0." -const MSG_BAD_RELFUNC = "relfunc < 0 illegal." -const MSG_BAD_FNORMTOL = "fnormtol < 0 illegal." -const MSG_BAD_SCSTEPTOL = "scsteptol < 0 illegal." -const MSG_BAD_MXNBCF = "mxbcf < 0 illegal." -const MSG_BAD_CONSTRAINTS = "Illegal values in constraints vector." -const MSG_BAD_OMEGA = "scalars < 0 illegal." -const MSG_LSOLV_NO_MEM = "The linear solver memory pointer is NULL." -const MSG_UU_NULL = "uu = NULL illegal." -const MSG_BAD_GLSTRAT = "Illegal value for global strategy." -const MSG_BAD_USCALE = "uscale = NULL illegal." -const MSG_USCALE_NONPOSITIVE = "uscale has nonpositive elements." -const MSG_BAD_FSCALE = "fscale = NULL illegal." -const MSG_FSCALE_NONPOSITIVE = "fscale has nonpositive elements." -const MSG_INITIAL_CNSTRNT = "Initial guess does NOT meet constraints." -const MSG_SYSFUNC_FAILED = "The system function failed in an unrecoverable manner." -const MSG_SYSFUNC_FIRST = "The system function failed at the first call." -const MSG_LSETUP_FAILED = "The linear solver's setup function failed in an unrecoverable manner." -const MSG_LSOLVE_FAILED = "The linear solver's solve function failed in an unrecoverable manner." -const MSG_LINSOLV_NO_RECOVERY = "The linear solver's solve function failed recoverably, but the Jacobian data is already current." -const MSG_LINESEARCH_NONCONV = "The line search algorithm was unable to find an iterate sufficiently distinct from the current iterate." -const MSG_LINESEARCH_BCFAIL = "The line search algorithm was unable to satisfy the beta-condition for nbcfails iterations." -const MSG_MAXITER_REACHED = "The maximum number of iterations was reached before convergence." -const MSG_MXNEWT_5X_EXCEEDED = "Five consecutive steps have been taken that satisfy a scaled step length test." -const MSG_SYSFUNC_REPTD = "Unable to correct repeated recoverable system function errors." -const INFO_RETVAL = "Return value: %d" -const INFO_ADJ = "no. of lambda adjustments = %ld" -const INFO_NNI = "nni = %4ld nfe = %6ld fnorm = %26.16lg" -const INFO_TOL = "scsteptol = %12.3lg fnormtol = %12.3lg" -const INFO_FMAX = "scaled f norm (for stopping) = %12.3lg" -const INFO_PNORM = "pnorm = %12.4le" -const INFO_PNORM1 = "(ivio=1) pnorm = %12.4le" -const INFO_FNORM = "fnorm(L2) = %20.8le" -const INFO_LAM = "min_lam = %11.4le f1norm = %11.4le pnorm = %11.4le" -const INFO_ALPHA = "fnorm = %15.8le f1norm = %15.8le alpha_cond = %15.8le lam = %15.8le" -const INFO_BETA = "f1norm = %15.8le beta_cond = %15.8le lam = %15.8le" -const INFO_ALPHABETA = "f1norm = %15.8le alpha_cond = %15.8le beta_cond = %15.8le lam = %15.8le" - -type KINMemRec - kin_uround::realtype - kin_func::KINSysFn - kin_user_data::Ptr{Void} - kin_fnormtol::realtype - kin_scsteptol::realtype - kin_globalstrategy::Cint - kin_printfl::Cint - kin_mxiter::Clong - kin_msbset::Clong - kin_msbset_sub::Clong - kin_mxnbcf::Clong - kin_etaflag::Cint - kin_noMinEps::Cint - kin_setupNonNull::Cint - kin_constraintsSet::Cint - kin_jacCurrent::Cint - kin_callForcingTerm::Cint - kin_noResMon::Cint - kin_retry_nni::Cint - kin_update_fnorm_sub::Cint - kin_mxnewtstep::realtype - kin_sqrt_relfunc::realtype - kin_stepl::realtype - kin_stepmul::realtype - kin_eps::realtype - kin_eta::realtype - kin_eta_gamma::realtype - kin_eta_alpha::realtype - kin_noInitSetup::Cint - kin_sthrsh::realtype - kin_nni::Clong - kin_nfe::Clong - kin_nnilset::Clong - kin_nnilset_sub::Clong - kin_nbcf::Clong - kin_nbktrk::Clong - kin_ncscmx::Clong - kin_uu::N_Vector - kin_unew::N_Vector - kin_fval::N_Vector - kin_uscale::N_Vector - kin_fscale::N_Vector - kin_pp::N_Vector - kin_constraints::N_Vector - kin_vtemp1::N_Vector - kin_vtemp2::N_Vector - kin_lrw1::Clong - kin_liw1::Clong - kin_lrw::Clong - kin_liw::Clong - kin_linit::Ptr{Void} - kin_lsetup::Ptr{Void} - kin_lsolve::Ptr{Void} - kin_lfree::Ptr{Void} - kin_inexact_ls::Cint - kin_lmem::Ptr{Void} - kin_fnorm::realtype - kin_f1norm::realtype - kin_res_norm::realtype - kin_sfdotJp::realtype - kin_sJpnorm::realtype - kin_fnorm_sub::realtype - kin_eval_omega::Cint - kin_omega::realtype - kin_omega_min::realtype - kin_omega_max::realtype - kin_MallocDone::Cint - kin_ehfun::KINErrHandlerFn - kin_eh_data::Ptr{Void} - # kin_errfp::Ptr{Void} - kin_errfp::Ptr{Void} - kin_ihfun::KINInfoHandlerFn - kin_ih_data::Ptr{Void} - # kin_infofp::Ptr{Void} - kin_infofp::Ptr{Void} -end - -typealias KINMem Ptr{KINMemRec} - -# begin enum ANONYMOUS_43 -typealias ANONYMOUS_43 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_43 - -# begin enum ANONYMOUS_44 -typealias ANONYMOUS_44 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_44 - -# begin enum ANONYMOUS_45 -typealias ANONYMOUS_45 UInt32 -const PREC_NONE = (UInt32)(0) -const PREC_LEFT = (UInt32)(1) -const PREC_RIGHT = (UInt32)(2) -const PREC_BOTH = (UInt32)(3) -# end enum ANONYMOUS_45 - -# begin enum ANONYMOUS_46 -typealias ANONYMOUS_46 UInt32 -const MODIFIED_GS = (UInt32)(1) -const CLASSICAL_GS = (UInt32)(2) -# end enum ANONYMOUS_46 diff --git a/src/types_and_consts.jl b/src/types_and_consts.jl new file mode 100644 index 00000000..954280bb --- /dev/null +++ b/src/types_and_consts.jl @@ -0,0 +1,551 @@ +# Automatically generated using Clang.jl wrap_c, version 0.0.0 + +using Compat + +const SUNDIALS_PACKAGE_VERSION = "2.5.0" +const SUNDIALS_DOUBLE_PRECISION = Cint(1) +const SUNDIALS_BLAS_LAPACK = Cint(0) +const SUNDIALS_DENSE = Cint(1) +const SUNDIALS_BAND = Cint(2) + +# Skipping MacroDefinition: DENSE_COL ( A , j ) ( ( A -> cols ) [ j ] ) +# Skipping MacroDefinition: DENSE_ELEM ( A , i , j ) ( ( A -> cols ) [ j ] [ i ] ) +# Skipping MacroDefinition: BAND_COL ( A , j ) ( ( ( A -> cols ) [ j ] ) + ( A -> s_mu ) ) +# Skipping MacroDefinition: BAND_COL_ELEM ( col_j , i , j ) ( col_j [ ( i ) - ( j ) ] ) +# Skipping MacroDefinition: BAND_ELEM ( A , i , j ) ( ( A -> cols ) [ j ] [ ( i ) - ( j ) + ( A -> s_mu ) ] ) + +typealias realtype Cdouble + +type _DlsMat + _type::Cint + M::Clong + N::Clong + ldim::Clong + mu::Clong + ml::Clong + s_mu::Clong + data::Ptr{realtype} + ldata::Clong + cols::Ptr{Ptr{realtype}} +end + +typealias DlsMat Ptr{_DlsMat} + +# begin enum ANONYMOUS_1 +typealias ANONYMOUS_1 UInt32 +const PREC_NONE = (UInt32)(0) +const PREC_LEFT = (UInt32)(1) +const PREC_RIGHT = (UInt32)(2) +const PREC_BOTH = (UInt32)(3) +# end enum ANONYMOUS_1 + +# begin enum ANONYMOUS_2 +typealias ANONYMOUS_2 UInt32 +const MODIFIED_GS = (UInt32)(1) +const CLASSICAL_GS = (UInt32)(2) +# end enum ANONYMOUS_2 + +typealias ATimesFn Ptr{Void} +typealias PSolveFn Ptr{Void} + +type _generic_N_Vector_Ops + nvclone::Ptr{Void} + nvcloneempty::Ptr{Void} + nvdestroy::Ptr{Void} + nvspace::Ptr{Void} + nvgetarraypointer::Ptr{Void} + nvsetarraypointer::Ptr{Void} + nvlinearsum::Ptr{Void} + nvconst::Ptr{Void} + nvprod::Ptr{Void} + nvdiv::Ptr{Void} + nvscale::Ptr{Void} + nvabs::Ptr{Void} + nvinv::Ptr{Void} + nvaddconst::Ptr{Void} + nvdotprod::Ptr{Void} + nvmaxnorm::Ptr{Void} + nvwrmsnorm::Ptr{Void} + nvwrmsnormmask::Ptr{Void} + nvmin::Ptr{Void} + nvwl2norm::Ptr{Void} + nvl1norm::Ptr{Void} + nvcompare::Ptr{Void} + nvinvtest::Ptr{Void} + nvconstrmask::Ptr{Void} + nvminquotient::Ptr{Void} +end + +typealias N_Vector_Ops Ptr{_generic_N_Vector_Ops} + +type _generic_N_Vector + content::Ptr{Void} + ops::Ptr{_generic_N_Vector_Ops} +end + +typealias N_Vector Ptr{_generic_N_Vector} +typealias N_Vector_S Ptr{N_Vector} + +const SPBCG_SUCCESS = Cint(0) +const SPBCG_RES_REDUCED = Cint(1) +const SPBCG_CONV_FAIL = Cint(2) +const SPBCG_PSOLVE_FAIL_REC = Cint(3) +const SPBCG_ATIMES_FAIL_REC = Cint(4) +const SPBCG_PSET_FAIL_REC = Cint(5) +const SPBCG_MEM_NULL = Cint(-1) +const SPBCG_ATIMES_FAIL_UNREC = Cint(-2) +const SPBCG_PSOLVE_FAIL_UNREC = Cint(-3) +const SPBCG_PSET_FAIL_UNREC = Cint(-4) + +# Skipping MacroDefinition: SPBCG_VTEMP ( mem ) ( mem -> r ) + +type SpbcgMemRec + l_max::Cint + r_star::N_Vector + r::N_Vector + p::N_Vector + q::N_Vector + u::N_Vector + Ap::N_Vector + vtemp::N_Vector +end + +typealias SpbcgMem Ptr{Void} + +const SPGMR_SUCCESS = Cint(0) +const SPGMR_RES_REDUCED = Cint(1) +const SPGMR_CONV_FAIL = Cint(2) +const SPGMR_QRFACT_FAIL = Cint(3) +const SPGMR_PSOLVE_FAIL_REC = Cint(4) +const SPGMR_ATIMES_FAIL_REC = Cint(5) +const SPGMR_PSET_FAIL_REC = Cint(6) +const SPGMR_MEM_NULL = Cint(-1) +const SPGMR_ATIMES_FAIL_UNREC = Cint(-2) +const SPGMR_PSOLVE_FAIL_UNREC = Cint(-3) +const SPGMR_GS_FAIL = Cint(-4) +const SPGMR_QRSOL_FAIL = Cint(-5) +const SPGMR_PSET_FAIL_UNREC = Cint(-6) + +# Skipping MacroDefinition: SPGMR_VTEMP ( mem ) ( mem -> vtemp ) + +type _SpgmrMemRec + l_max::Cint + V::Ptr{N_Vector} + Hes::Ptr{Ptr{realtype}} + givens::Ptr{realtype} + xcor::N_Vector + yg::Ptr{realtype} + vtemp::N_Vector +end + +type SpgmrMemRec + l_max::Cint + V::Ptr{N_Vector} + Hes::Ptr{Ptr{realtype}} + givens::Ptr{realtype} + xcor::N_Vector + yg::Ptr{realtype} + vtemp::N_Vector +end + +typealias SpgmrMem Ptr{_SpgmrMemRec} + +const SPTFQMR_SUCCESS = Cint(0) +const SPTFQMR_RES_REDUCED = Cint(1) +const SPTFQMR_CONV_FAIL = Cint(2) +const SPTFQMR_PSOLVE_FAIL_REC = Cint(3) +const SPTFQMR_ATIMES_FAIL_REC = Cint(4) +const SPTFQMR_PSET_FAIL_REC = Cint(5) +const SPTFQMR_MEM_NULL = Cint(-1) +const SPTFQMR_ATIMES_FAIL_UNREC = Cint(-2) +const SPTFQMR_PSOLVE_FAIL_UNREC = Cint(-3) +const SPTFQMR_PSET_FAIL_UNREC = Cint(-4) + +# Skipping MacroDefinition: SPTFQMR_VTEMP ( mem ) ( mem -> vtemp1 ) + +type SptfqmrMemRec + l_max::Cint + r_star::N_Vector + q::N_Vector + d::N_Vector + v::N_Vector + p::N_Vector + r::Ptr{N_Vector} + u::N_Vector + vtemp1::N_Vector + vtemp2::N_Vector + vtemp3::N_Vector +end + +typealias SptfqmrMem Ptr{Void} + +# Skipping MacroDefinition: RCONST ( x ) x + +const BIG_REAL = DBL_MAX +const SMALL_REAL = DBL_MIN +const UNIT_ROUNDOFF = DBL_EPSILON +const FALSE = Cint(0) +const TRUE = Cint(1) +const CV_ADAMS = Cint(1) +const CV_BDF = Cint(2) +const CV_FUNCTIONAL = Cint(1) +const CV_NEWTON = Cint(2) +const CV_NORMAL = Cint(1) +const CV_ONE_STEP = Cint(2) +const CV_SUCCESS = Cint(0) +const CV_TSTOP_RETURN = Cint(1) +const CV_ROOT_RETURN = Cint(2) +const CV_WARNING = Cint(99) +const CV_TOO_MUCH_WORK = Cint(-1) +const CV_TOO_MUCH_ACC = Cint(-2) +const CV_ERR_FAILURE = Cint(-3) +const CV_CONV_FAILURE = Cint(-4) +const CV_LINIT_FAIL = Cint(-5) +const CV_LSETUP_FAIL = Cint(-6) +const CV_LSOLVE_FAIL = Cint(-7) +const CV_RHSFUNC_FAIL = Cint(-8) +const CV_FIRST_RHSFUNC_ERR = Cint(-9) +const CV_REPTD_RHSFUNC_ERR = Cint(-10) +const CV_UNREC_RHSFUNC_ERR = Cint(-11) +const CV_RTFUNC_FAIL = Cint(-12) +const CV_MEM_FAIL = Cint(-20) +const CV_MEM_NULL = Cint(-21) +const CV_ILL_INPUT = Cint(-22) +const CV_NO_MALLOC = Cint(-23) +const CV_BAD_K = Cint(-24) +const CV_BAD_T = Cint(-25) +const CV_BAD_DKY = Cint(-26) +const CV_TOO_CLOSE = Cint(-27) + +typealias CVRhsFn Ptr{Void} + +CVRhsFn_wrapper(fp::CVRhsFn) = fp +CVRhsFn_wrapper(f) = cfunction(f,Cint,(realtype,N_Vector,N_Vector,Ptr{Void})) + +typealias CVRootFn Ptr{Void} + +CVRootFn_wrapper(fp::CVRootFn) = fp +CVRootFn_wrapper(f) = cfunction(f,Cint,(realtype,N_Vector,Ptr{realtype},Ptr{Void})) + +typealias CVEwtFn Ptr{Void} +typealias CVErrHandlerFn Ptr{Void} + +const CVDLS_SUCCESS = Cint(0) +const CVDLS_MEM_NULL = Cint(-1) +const CVDLS_LMEM_NULL = Cint(-2) +const CVDLS_ILL_INPUT = Cint(-3) +const CVDLS_MEM_FAIL = Cint(-4) +const CVDLS_JACFUNC_UNRECVR = Cint(-5) +const CVDLS_JACFUNC_RECVR = Cint(-6) + +typealias CVDlsDenseJacFn Ptr{Void} +typealias CVDlsBandJacFn Ptr{Void} + +const CVSPILS_SUCCESS = Cint(0) +const CVSPILS_MEM_NULL = Cint(-1) +const CVSPILS_LMEM_NULL = Cint(-2) +const CVSPILS_ILL_INPUT = Cint(-3) +const CVSPILS_MEM_FAIL = Cint(-4) +const CVSPILS_PMEM_NULL = Cint(-5) +const CVSPILS_MAXL = Cint(5) +const CVSPILS_MSBPRE = Cint(50) + +# Skipping MacroDefinition: CVSPILS_DGMAX RCONST ( 0.2 ) +# Skipping MacroDefinition: CVSPILS_EPLIN RCONST ( 0.05 ) + +typealias CVSpilsPrecSetupFn Ptr{Void} +typealias CVSpilsPrecSolveFn Ptr{Void} +typealias CVSpilsJacTimesVecFn Ptr{Void} + +const CV_SIMULTANEOUS = Cint(1) +const CV_STAGGERED = Cint(2) +const CV_STAGGERED1 = Cint(3) +const CV_CENTERED = Cint(1) +const CV_FORWARD = Cint(2) +const CV_HERMITE = Cint(1) +const CV_POLYNOMIAL = Cint(2) +const CV_NO_QUAD = Cint(-30) +const CV_QRHSFUNC_FAIL = Cint(-31) +const CV_FIRST_QRHSFUNC_ERR = Cint(-32) +const CV_REPTD_QRHSFUNC_ERR = Cint(-33) +const CV_UNREC_QRHSFUNC_ERR = Cint(-34) +const CV_NO_SENS = Cint(-40) +const CV_SRHSFUNC_FAIL = Cint(-41) +const CV_FIRST_SRHSFUNC_ERR = Cint(-42) +const CV_REPTD_SRHSFUNC_ERR = Cint(-43) +const CV_UNREC_SRHSFUNC_ERR = Cint(-44) +const CV_BAD_IS = Cint(-45) +const CV_NO_QUADSENS = Cint(-50) +const CV_QSRHSFUNC_FAIL = Cint(-51) +const CV_FIRST_QSRHSFUNC_ERR = Cint(-52) +const CV_REPTD_QSRHSFUNC_ERR = Cint(-53) +const CV_UNREC_QSRHSFUNC_ERR = Cint(-54) +const CV_NO_ADJ = Cint(-101) +const CV_NO_FWD = Cint(-102) +const CV_NO_BCK = Cint(-103) +const CV_BAD_TB0 = Cint(-104) +const CV_REIFWD_FAIL = Cint(-105) +const CV_FWD_FAIL = Cint(-106) +const CV_GETY_BADT = Cint(-107) + +typealias CVQuadRhsFn Ptr{Void} +typealias CVSensRhsFn Ptr{Void} +typealias CVSensRhs1Fn Ptr{Void} +typealias CVQuadSensRhsFn Ptr{Void} +typealias CVRhsFnB Ptr{Void} +typealias CVRhsFnBS Ptr{Void} +typealias CVQuadRhsFnB Ptr{Void} +typealias CVQuadRhsFnBS Ptr{Void} + +type CVadjCheckPointRec + my_addr::Ptr{Void} + next_addr::Ptr{Void} + t0::realtype + t1::realtype + nstep::Clong + order::Cint + step::realtype +end + +const CVDLS_NO_ADJ = Cint(-101) +const CVDLS_LMEMB_NULL = Cint(-102) + +typealias CVDlsDenseJacFnB Ptr{Void} +typealias CVDlsBandJacFnB Ptr{Void} + +const CVSPILS_NO_ADJ = Cint(-101) +const CVSPILS_LMEMB_NULL = Cint(-102) + +typealias CVSpilsPrecSetupFnB Ptr{Void} +typealias CVSpilsPrecSolveFnB Ptr{Void} +typealias CVSpilsJacTimesVecFnB Ptr{Void} + +const IDA_NORMAL = Cint(1) +const IDA_ONE_STEP = Cint(2) +const IDA_YA_YDP_INIT = Cint(1) +const IDA_Y_INIT = Cint(2) +const IDA_SUCCESS = Cint(0) +const IDA_TSTOP_RETURN = Cint(1) +const IDA_ROOT_RETURN = Cint(2) +const IDA_WARNING = Cint(99) +const IDA_TOO_MUCH_WORK = Cint(-1) +const IDA_TOO_MUCH_ACC = Cint(-2) +const IDA_ERR_FAIL = Cint(-3) +const IDA_CONV_FAIL = Cint(-4) +const IDA_LINIT_FAIL = Cint(-5) +const IDA_LSETUP_FAIL = Cint(-6) +const IDA_LSOLVE_FAIL = Cint(-7) +const IDA_RES_FAIL = Cint(-8) +const IDA_REP_RES_ERR = Cint(-9) +const IDA_RTFUNC_FAIL = Cint(-10) +const IDA_CONSTR_FAIL = Cint(-11) +const IDA_FIRST_RES_FAIL = Cint(-12) +const IDA_LINESEARCH_FAIL = Cint(-13) +const IDA_NO_RECOVERY = Cint(-14) +const IDA_MEM_NULL = Cint(-20) +const IDA_MEM_FAIL = Cint(-21) +const IDA_ILL_INPUT = Cint(-22) +const IDA_NO_MALLOC = Cint(-23) +const IDA_BAD_EWT = Cint(-24) +const IDA_BAD_K = Cint(-25) +const IDA_BAD_T = Cint(-26) +const IDA_BAD_DKY = Cint(-27) + +typealias IDAResFn Ptr{Void} + +IDAResFn_wrapper(fp::IDAResFn) = fp +IDAResFn_wrapper(f) = cfunction(f,Cint,(realtype,N_Vector,N_Vector,N_Vector,Ptr{Void})) + +typealias IDARootFn Ptr{Void} + +IDARootFn_wrapper(fp::IDARootFn) = fp +IDARootFn_wrapper(f) = cfunction(f,Cint,(realtype,N_Vector,N_Vector,Ptr{realtype},Ptr{Void})) + +typealias IDAEwtFn Ptr{Void} +typealias IDAErrHandlerFn Ptr{Void} + +const IDADLS_SUCCESS = Cint(0) +const IDADLS_MEM_NULL = Cint(-1) +const IDADLS_LMEM_NULL = Cint(-2) +const IDADLS_ILL_INPUT = Cint(-3) +const IDADLS_MEM_FAIL = Cint(-4) +const IDADLS_JACFUNC_UNRECVR = Cint(-5) +const IDADLS_JACFUNC_RECVR = Cint(-6) + +typealias IDADlsDenseJacFn Ptr{Void} +typealias IDADlsBandJacFn Ptr{Void} + +const IDASPILS_SUCCESS = Cint(0) +const IDASPILS_MEM_NULL = Cint(-1) +const IDASPILS_LMEM_NULL = Cint(-2) +const IDASPILS_ILL_INPUT = Cint(-3) +const IDASPILS_MEM_FAIL = Cint(-4) +const IDASPILS_PMEM_NULL = Cint(-5) + +typealias IDASpilsPrecSetupFn Ptr{Void} +typealias IDASpilsPrecSolveFn Ptr{Void} +typealias IDASpilsJacTimesVecFn Ptr{Void} + +const IDA_SIMULTANEOUS = Cint(1) +const IDA_STAGGERED = Cint(2) +const IDA_CENTERED = Cint(1) +const IDA_FORWARD = Cint(2) +const IDA_HERMITE = Cint(1) +const IDA_POLYNOMIAL = Cint(2) +const IDA_NO_QUAD = Cint(-30) +const IDA_QRHS_FAIL = Cint(-31) +const IDA_FIRST_QRHS_ERR = Cint(-32) +const IDA_REP_QRHS_ERR = Cint(-33) +const IDA_NO_SENS = Cint(-40) +const IDA_SRES_FAIL = Cint(-41) +const IDA_REP_SRES_ERR = Cint(-42) +const IDA_BAD_IS = Cint(-43) +const IDA_NO_QUADSENS = Cint(-50) +const IDA_QSRHS_FAIL = Cint(-51) +const IDA_FIRST_QSRHS_ERR = Cint(-52) +const IDA_REP_QSRHS_ERR = Cint(-53) +const IDA_NO_ADJ = Cint(-101) +const IDA_NO_FWD = Cint(-102) +const IDA_NO_BCK = Cint(-103) +const IDA_BAD_TB0 = Cint(-104) +const IDA_REIFWD_FAIL = Cint(-105) +const IDA_FWD_FAIL = Cint(-106) +const IDA_GETY_BADT = Cint(-107) + +typealias IDAQuadRhsFn Ptr{Void} +typealias IDASensResFn Ptr{Void} +typealias IDAQuadSensRhsFn Ptr{Void} +typealias IDAResFnB Ptr{Void} +typealias IDAResFnBS Ptr{Void} +typealias IDAQuadRhsFnB Ptr{Void} +typealias IDAQuadRhsFnBS Ptr{Void} + +type IDAadjCheckPointRec + my_addr::Ptr{Void} + next_addr::Ptr{Void} + t0::realtype + t1::realtype + nstep::Clong + order::Cint + step::realtype +end + +const IDADLS_NO_ADJ = Cint(-101) +const IDADLS_LMEMB_NULL = Cint(-102) + +typealias IDADlsDenseJacFnB Ptr{Void} +typealias IDADlsBandJacFnB Ptr{Void} + +const IDASPILS_NO_ADJ = Cint(-101) +const IDASPILS_LMEMB_NULL = Cint(-102) + +typealias IDASpilsPrecSetupFnB Ptr{Void} +typealias IDASpilsPrecSolveFnB Ptr{Void} +typealias IDASpilsJacTimesVecFnB Ptr{Void} + +const KIN_SUCCESS = Cint(0) +const KIN_INITIAL_GUESS_OK = Cint(1) +const KIN_STEP_LT_STPTOL = Cint(2) +const KIN_WARNING = Cint(99) +const KIN_MEM_NULL = Cint(-1) +const KIN_ILL_INPUT = Cint(-2) +const KIN_NO_MALLOC = Cint(-3) +const KIN_MEM_FAIL = Cint(-4) +const KIN_LINESEARCH_NONCONV = Cint(-5) +const KIN_MAXITER_REACHED = Cint(-6) +const KIN_MXNEWT_5X_EXCEEDED = Cint(-7) +const KIN_LINESEARCH_BCFAIL = Cint(-8) +const KIN_LINSOLV_NO_RECOVERY = Cint(-9) +const KIN_LINIT_FAIL = Cint(-10) +const KIN_LSETUP_FAIL = Cint(-11) +const KIN_LSOLVE_FAIL = Cint(-12) +const KIN_SYSFUNC_FAIL = Cint(-13) +const KIN_FIRST_SYSFUNC_ERR = Cint(-14) +const KIN_REPTD_SYSFUNC_ERR = Cint(-15) +const KIN_ETACHOICE1 = Cint(1) +const KIN_ETACHOICE2 = Cint(2) +const KIN_ETACONSTANT = Cint(3) +const KIN_NONE = Cint(0) +const KIN_LINESEARCH = Cint(1) + +typealias KINSysFn Ptr{Void} + +KINSysFn_wrapper(fp::KINSysFn) = fp +KINSysFn_wrapper(f) = cfunction(f,Cint,(N_Vector,N_Vector,Ptr{Void})) + +typealias KINErrHandlerFn Ptr{Void} +typealias KINInfoHandlerFn Ptr{Void} + +const KINDLS_SUCCESS = Cint(0) +const KINDLS_MEM_NULL = Cint(-1) +const KINDLS_LMEM_NULL = Cint(-2) +const KINDLS_ILL_INPUT = Cint(-3) +const KINDLS_MEM_FAIL = Cint(-4) +const KINDLS_JACFUNC_UNRECVR = Cint(-5) +const KINDLS_JACFUNC_RECVR = Cint(-6) + +typealias KINDlsDenseJacFn Ptr{Void} +typealias KINDlsBandJacFn Ptr{Void} + +const KINSPILS_SUCCESS = Cint(0) +const KINSPILS_MEM_NULL = Cint(-1) +const KINSPILS_LMEM_NULL = Cint(-2) +const KINSPILS_ILL_INPUT = Cint(-3) +const KINSPILS_MEM_FAIL = Cint(-4) +const KINSPILS_PMEM_NULL = Cint(-5) +const KINSPILS_MAXL = Cint(10) + +typealias KINSpilsPrecSetupFn Ptr{Void} +typealias KINSpilsPrecSolveFn Ptr{Void} +typealias KINSpilsJacTimesVecFn Ptr{Void} + +# Skipping MacroDefinition: NV_CONTENT_S ( v ) ( ( N_VectorContent_Serial ) ( v -> content ) ) +# Skipping MacroDefinition: NV_LENGTH_S ( v ) ( NV_CONTENT_S ( v ) -> length ) +# Skipping MacroDefinition: NV_OWN_DATA_S ( v ) ( NV_CONTENT_S ( v ) -> own_data ) +# Skipping MacroDefinition: NV_DATA_S ( v ) ( NV_CONTENT_S ( v ) -> data ) +# Skipping MacroDefinition: NV_Ith_S ( v , i ) ( NV_DATA_S ( v ) [ i ] ) + +type _N_VectorContent_Serial + length::Clong + own_data::Cint + data::Ptr{realtype} +end + +typealias N_VectorContent_Serial Ptr{_N_VectorContent_Serial} + +const FCMIX_CVODE = Cint(1) +const FCMIX_IDA = Cint(2) +const FCMIX_KINSOL = Cint(3) + +# Skipping MacroDefinition: MIN ( A , B ) ( ( A ) < ( B ) ? ( A ) : ( B ) ) +# Skipping MacroDefinition: MAX ( A , B ) ( ( A ) > ( B ) ? ( A ) : ( B ) ) +# Skipping MacroDefinition: SQR ( A ) ( ( A ) * ( A ) ) + +typealias CVLocalFn Ptr{Void} +typealias CVCommFn Ptr{Void} + +const CVDIAG_SUCCESS = Cint(0) +const CVDIAG_MEM_NULL = Cint(-1) +const CVDIAG_LMEM_NULL = Cint(-2) +const CVDIAG_ILL_INPUT = Cint(-3) +const CVDIAG_MEM_FAIL = Cint(-4) +const CVDIAG_INV_FAIL = Cint(-5) +const CVDIAG_RHSFUNC_UNRECVR = Cint(-6) +const CVDIAG_RHSFUNC_RECVR = Cint(-7) + +typealias CVLocalFnB Ptr{Void} +typealias CVCommFnB Ptr{Void} + +const CVDIAG_NO_ADJ = Cint(-101) + +typealias IDABBDLocalFn Ptr{Void} +typealias IDABBDCommFn Ptr{Void} +typealias IDABBDLocalFnB Ptr{Void} +typealias IDABBDCommFnB Ptr{Void} + +const KINBBDPRE_SUCCESS = Cint(0) +const KINBBDPRE_PDATA_NULL = Cint(-11) +const KINBBDPRE_FUNC_UNRECVR = Cint(-12) + +typealias KINCommFn Ptr{Void} +typealias KINLocalFn Ptr{Void} diff --git a/src/wrap_sundials.jl b/src/wrap_sundials.jl index e53fc536..e34a1aee 100644 --- a/src/wrap_sundials.jl +++ b/src/wrap_sundials.jl @@ -1,54 +1,251 @@ -# This file is not an active part of the package. This is the code -# that uses the Clang.jl package to wrap Sundials using the headers. +# This script is not an active part of the package. +# It uses Clang.jl package to parse Sundials C headers and generate +# Julia wrapper for Sundials API. +# +# To run the script from Julia console: +# include(joinpath(Pkg.dir("Sundials"), "src", "wrap_sundials.jl")); -# Find all headers -incpath = joinpath(dirname(@__FILE__), "..", "deps", "usr", "include") +using Clang.wrap_c + +# `outpath` specifies, where the julian wrappers would be generated. +# If the generated .jl files are ok, they have to be copied to the "src" folder +# overwriting the old ones +const outpath = normpath(joinpath(dirname(@__FILE__), "..", "new")) +mkpath(outpath) + +# Find all relevant Sundials headers +const incpath = normpath(joinpath(dirname(@__FILE__), "..", "deps", "usr", "include")) if !isdir(incpath) - error("Run Pkg.build(\"Sundials\") before trying to wrap C headers.") + error("Sundials C headers not found. Run Pkg.build(\"Sundials\") before trying to wrap C headers.") +end + +info("Scanning Sundials headers in $incpath...") +const sundials_folders = filter!(isdir, map!(folder -> joinpath(incpath, folder), + ["nvector", "sundials", "cvode", "cvodes", + "ida", "idas", "kinsol", "arkode"])) +const sundials_headers = similar(sundials_folders, 0) +for folder in sundials_folders + info("Processing $folder...") + append!(sundials_headers, + map(x->joinpath(folder, x), + sort!(convert(typeof(sundials_headers), readdir(folder))))) +end +# @show sundials_headers + +const clang_path = "/usr/lib/clang/3.8.0" # change to your clang location +const clang_includes = [ + joinpath(clang_path, "include"), +] + +# check_use_header(path) = true +# Callback to test if a header should actually be wrapped (for exclusion) +function wrap_header(top_hdr::AbstractString, cursor_header::AbstractString) + !ismatch(r"(_parallel|_impl)\.h$", cursor_header) && # don't wrap parallel and implementation definitions + (top_hdr == cursor_header) # don't wrap if header is included from the other header (e.g. nvector in cvode or cvode_direct from cvode_band) end -wdir = joinpath(dirname(@__FILE__), "..", "new") -mkpath(wdir) -cd(wdir) +function wrap_cursor(name::AbstractString, cursor) + if typeof(cursor) == Clang.cindex.FunctionDecl + # only wrap API functions + return ismatch(r"^(CV|KIN|IDA|N_V)", name) + else + # skip problematic definitions + return !ismatch(r"^(ABS|SQRT|EXP)$", name) + end +end -sundials_names = ["nvector", "sundials", "cvode", "cvodes", "ida", "idas", "kinsol"] -if isdir(joinpath(incpath, "arkode")) - push!(sundials_names, "arkode") +function julia_file(header::AbstractString) + src_name = basename(dirname(header)) + if src_name == "sundials" + src_name = "libsundials" # avoid having both Sundials.jl and sundials.jl + end + return joinpath(outpath, string(src_name, ".jl")) end -headers = ASCIIString[] -for name in sundials_names - path = joinpath(incpath, name) - append!(headers, map(x->joinpath(path, x),split(readall(pipeline(`ls $path`, `sort`))))) +function library_file(header::AbstractString) + header_name = basename(header) + if startswith(header_name, "nvector") + return "libsundials_nvecserial" + else + return string("libsundials_", basename(dirname(header))) + end end -# @show headers +const context = wrap_c.init( + common_file="types_and_consts.jl", + clang_args = [ + "-D", "__STDC_LIMIT_MACROS", + "-D", "__STDC_CONSTANT_MACROS", + "-v" + ], + clang_diagnostics = true, + clang_includes = [clang_includes; incpath], + header_outputfile = julia_file, + header_library = library_file, + header_wrapped=wrap_header, + cursor_wrapped=wrap_cursor +) +context.headers = sundials_headers -## Do wrapping using Clang.jl -ENV["JULIAHOME"] = "/Users/jgoldfar/Public/julia/usr/" +# 1st arg name to wrapped arg type map +const arg1_name2type = Dict( + :cvode_mem => :(CVODEMemPtr), + :kinmem => :(KINMemPtr), + :kinmemm => :(KINMemPtr), # Sundials typo? + :ida_mem => :(IDAMemPtr), + :idaa_mem => :(IDAMemPtr), # Sundials typo? + :idaadj_mem => :(IDAMemPtr), # Sundials typo? +) -using Clang.wrap_c +# substitute Ptr{Void} with the typed pointer +const ctor_return_type = Dict( + "CVodeCreate" => :(CVODEMemPtr), + "IDACreate" => :(IDAMemPtr), + "KINCreate" => :(KINMemPtr) +) + +# signatures for C function pointer types +const FnTypeSignatures = Dict( + :CVRhsFn => (:Cint, :((realtype, N_Vector, N_Vector, Ptr{Void}))), + :CVRootFn => (:Cint, :((realtype, N_Vector, Ptr{realtype}, Ptr{Void}))), + :IDAResFn => (:Cint, :((realtype, N_Vector, N_Vector, N_Vector, Ptr{Void}))), + :IDARootFn => (:Cint, :((realtype, N_Vector, N_Vector, Ptr{realtype}, Ptr{Void}))), + :KINSysFn => (:Cint, :((N_Vector, N_Vector, Ptr{Void}))), +) -if (!haskey(ENV, "JULIAHOME")) - error("Please set JULIAHOME variable to the root of your julia install") +typeify_sundials_pointers(notexpr) = Any[notexpr] + +function typeify_sundials_pointers(expr::Expr) + if expr.head == :function && + expr.args[1].head == :call + func_name = string(expr.args[1].args[1]) + convert_required = false + if ismatch(r"^(CV|KIN|IDA|N_V)", func_name) + if ismatch(r"Create$", func_name) + # create functions return typed pointers + @assert expr.args[2].args[1].args[2] == :(Ptr{Void}) + expr.args[2].args[1].args[2] = ctor_return_type[func_name] + elseif length(expr.args[1].args) > 1 + arg1_name = expr.args[1].args[2].args[1] + arg1_type = expr.args[1].args[2].args[2] + if arg1_type == :(Ptr{Void}) || arg1_type == :(Ptr{Ptr{Void}}) + # also check in the ccall list of arg types + @assert expr.args[2].args[1].args[3].args[1] == arg1_type + arg1_newtype = arg1_name2type[arg1_name] + if arg1_type == :(Ptr{Ptr{Void}}) + # adjust for void** type (for CVodeFree()-like funcs) + arg1_newtype = Expr(:curly, :Ref, arg1_newtype) + end + expr.args[1].args[2].args[2] = arg1_newtype + expr.args[2].args[1].args[3].args[1] = arg1_newtype + convert_required = true + end + end + if ismatch(r"UserDataB?$", func_name) + # replace Ptr{Void} with Any to allow passing Julia objects through user data + for (i, arg_expr) in enumerate(expr.args[1].args) + if i > 1 && ismatch(r"^user_dataB?$", string(arg_expr.args[1])) + @assert arg_expr.head == :(::) && arg_expr.args[2] == :(Ptr{Void}) + expr.args[1].args[i].args[2] = :(Any) + # replace in ccall list + @assert expr.args[2].args[1].args[3].args[i-1] == :(Ptr{Void}) + expr.args[2].args[1].args[3].args[i-1] = :(Any) + break + end + end + end + # generate a higher-level wrapper that converts 1st arg to XXXMemPtr + # and all other args from Julia objects to low-level C wrappers (e.g. NVector to N_Vector) + # create wrapers for all arguments that need wrapping + args_wrap_exprs = map(drop(expr.args[1].args, 1)) do expr + # process each argument + # return a tuple: + # 1) high-level wrapper arg name expr + # 2) expr for local var definition, nothing if not required + # 3) expr for low-level wrapper call + # if 1)==3), then no wrapping is required + arg_name_expr = expr.args[1] + arg_type_expr = expr.args[2] + if arg_type_expr == :N_Vector + # first convert argument to NVector() and store in local var, + # this guarantees that the wrapper and associated Sundials object (e.g. N_Vector) + # is not removed by GC + return (arg_name_expr, + Expr(:call, :convert, :NVector, arg_name_expr), # convert arg to NVector to store in a local var + Expr(:call, :convert, arg_type_expr, Symbol(string("__", arg_name_expr)))) # convert NVector to N_Vector + elseif arg_type_expr == :Clong || arg_type_expr == :Cint || + ismatch(r"MemPtr$", string(arg_type_expr)) + # convert(XXXMemPtr, mem), no local var required + return (arg_name_expr, nothing, + Expr(:call, :convert, arg_type_expr, arg_name_expr)) + elseif isa(arg_type_expr, Expr) && arg_type_expr.head == :curly && + arg_type_expr.args[1] == :Ptr && arg_type_expr.args[2] != :FILE + # convert julia arrays to pointer, no local var required + # FIXME sometimes these arguments are not really arrays, but just a pointer to a var to be assigned + # by the function call. Does that make sense to detect such cases and assume that input arg is a reference to Julia var? + return (arg_name_expr, nothing, + Expr(:call, :pointer, arg_name_expr)) + elseif haskey(FnTypeSignatures, arg_type_expr) # wrap Julia function to C function using a defined signature + return (arg_name_expr, nothing, + Expr(:call, Symbol(string(arg_type_expr, "_wrapper")), arg_name_expr)) + else # any other case, no argument wrapping + return (arg_name_expr, nothing, arg_name_expr) + end + end + # check which arguments are wrapped + if any(map(arg_exprs -> arg_exprs[1] != arg_exprs[3], args_wrap_exprs)) + # mangle the name of the low-level wrapper to avoid recursion + lowlevel_func_name = string("__", func_name) + expr.args[1].args[1] = Symbol(lowlevel_func_name) + + # higher-level wrapper function + wrapper_func_expr = Expr(:function, + # function declaration with argument types stripped, so it would accept any type + Expr(:call, Symbol(func_name), map(arg_exprs -> arg_exprs[1], args_wrap_exprs)...), + Expr(:block, + # local var defs + map(filter(arg_exprs -> arg_exprs[2] !== nothing, args_wrap_exprs)) do arg_exprs + Expr(:(=), Symbol("__", arg_exprs[1]), arg_exprs[2]) + end..., + # low-level function call with Julia types converted to low-level arguments + Expr(:call, Symbol(lowlevel_func_name), + map(arg_exprs -> arg_exprs[3], args_wrap_exprs)...) + ) + ) + # write down both low-level and higher level wrappers + return Any[expr, wrapper_func_expr] + else + return Any[expr] + end + end + elseif expr.head == :typealias && haskey(FnTypeSignatures, expr.args[1]) + # C functional type, generate the wrapper from Julia to C function + # dummy wrapper that accepts pointer + fn_typename = expr.args[1] + fn_rettype, fn_argtypes = FnTypeSignatures[fn_typename] + wrapper_name = Symbol(string(string(fn_typename), "_wrapper")) + c_wrapper_def = Expr(:(=), + Expr(:call, wrapper_name, Expr(:(::), :fp, fn_typename)), :fp) + jl_wrapper_def = Expr(:(=), + Expr(:call, wrapper_name, :f), + # function declaration with argument types stripped + Expr(:call, :cfunction, :f, fn_rettype, fn_argtypes)) + return Any[expr, c_wrapper_def, jl_wrapper_def] + elseif expr.head == :const && expr.args[1].head == :(=) && + isa(expr.args[1].args[2], Int) + # fix integer constants should be Cint + expr.args[1].args[2] = Expr(:call, :Cint, expr.args[1].args[2]) + end + return Any[expr] end -clang_includes = map(x->joinpath(ENV["JULIAHOME"], x), [ - "deps/llvm-3.2/build/Release/lib/clang/3.2/include", - "deps/llvm-3.2/include", - "deps/llvm-3.2/include", - "deps/llvm-3.2/build/include/", - "deps/llvm-3.2/include/" - ]) +context.rewriter = function(exprs) + mod_exprs = sizehint!(Vector{Any}(), length(exprs)) + for expr in exprs + append!(mod_exprs, typeify_sundials_pointers(expr)) + end + mod_exprs +end -# check_use_header(path) = true -header_file(str::AbstractString) = string(basename(dirname(str)), ".jl") -header_library_file(str::AbstractString) = "shlib" -clang_extraargs = [ -"-D", "__STDC_LIMIT_MACROS", "-D", "__STDC_CONSTANT_MACROS", -"-v"] -context = wrap_c.init( -common_file="sundials_h.jl", -clang_args = clang_extraargs, clang_diagnostics = true, clang_includes = [clang_includes; incpath], header_outputfile = header_file) -context.headers = headers +info("Generating .jl wrappers for Sundials in $outpath...") run(context) -mv(joinpath(wdir, "sundials.jl"), joinpath(wdir, "libsundials.jl")) # avoid a name conflict for case-insensitive file systems +info("Done generating .jl wrappers for Sundials in $outpath") diff --git a/test/runtests.jl b/test/runtests.jl index dc208774..1a081e09 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,36 +1,62 @@ using Sundials using Base.Test -# run cvode example -println("== start cvode example") -include("../examples/cvode_Roberts_simplified.jl") +examples_path = joinpath(dirname(@__FILE__), "..", "examples") +# run cvode example +println("== start cvode Roberts example (simplified)") +let +include(joinpath(examples_path, "cvode_Roberts_simplified.jl")) println("result at t=$(t[end]):") -println(res[end,:], "\n") +println(res[:,end], "\n") +end +println("== start cvode Roberts example") +let +include(joinpath(examples_path, "cvode_Roberts_dns.jl")) +end # run ida examples -println("== start ida_Roberts example") -include("../examples/ida_Roberts_simplified.jl") +println("== start ida_Roberts example (simplified)") +let +include(joinpath(examples_path, "ida_Roberts_simplified.jl")) +end +println("== start ida_Roberts example") +let +include(joinpath(examples_path, "ida_Roberts_dns.jl")) println("result at t=$(t[end]):") -println(yout[end,:], "\n") +println(yout[:,end], "\n") +end println("== start ida_Heat2D example") -include("../examples/ida_Heat2D.jl") - +let +include(joinpath(examples_path, "ida_Heat2D.jl")) println("result at t=$(t[end]):") -println(yout[end,:], "\n") +println(yout[:,end], "\n") +end -# run kinsol example -println("== start kinsol example") -include("../examples/kinsol_mkin_simplified.jl") +#= requires Grid package +println("== start ida_Cable example") +let +include(joinpath(examples_path, "ida_Cable.jl")) +end +=# +# run kinsol example +println("== start kinsol example (simplified)") +let +include(joinpath(examples_path, "kinsol_mkin_simplified.jl")) println("solution:") println(res) residual = ones(2) sysfn(res, residual) println("residual:") println(residual, "\n") +end +println("== start kinsol example") +let +include(joinpath(examples_path, "kinsol_mkinTest.jl")) @test abs(minimum(residual)) < 1e-5 +end