Skip to content

Commit

Permalink
add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rveltz committed Nov 29, 2016
1 parent d1195a9 commit 864ff4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ end
"""
lsoda(f::Function, y0::Vector{Float64}, tspan::Vector{Float64}; userdata::Any=nothing, reltol::Union{Float64,Vector}=1e-4, abstol::Union{Float64,Vector}=1e-10)
Solves a set of ordinary differential equations using the LSODA algorithm.
Solves a set of ordinary differential equations using the LSODA algorithm. The vector field encoded in an inplace f::Function needs to have the self-explanatory arguments f(t, y, ydot, data)
"""
function lsoda(f::Function, y0::Vector{Float64}, tspan::Vector{Float64}; userdata::Any=nothing, reltol::Union{Float64,Vector}=1e-4, abstol::Union{Float64,Vector}=1e-10)
neq = Int32(length(y0))
Expand Down Expand Up @@ -113,6 +113,11 @@ function lsoda(f::Function, y0::Vector{Float64}, tspan::Vector{Float64}; userdat
return ctx, yres
end

"""
lsoda_evolve!(ctx::lsoda_context_t,y::Vector{Float64},tspan::Vector{Float64};data=nothing)
Solves a set of ordinary differential equations using the LSODA algorithm and the context variable ctx. This avoid re-allocating ctx.
"""
function lsoda_evolve!(ctx::lsoda_context_t,y::Vector{Float64},tspan::Vector{Float64};data=nothing)
if data != nothing
ctx.data.userdata = data
Expand Down

0 comments on commit 864ff4d

Please sign in to comment.