Skip to content

Commit

Permalink
fix KLU and sparse matrix support
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Apr 5, 2020
1 parent 81e7955 commit 6643177
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/types_and_consts_additions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function Base.convert(::Type{SparseArrays.SparseMatrixCSC}, J::SUNMatrix)
# TODO: Get rid of allocation for 1-based index change
rowval = unsafe_wrap(Array, mat.indexvals, (mat.NNZ), own=false)
colptr = unsafe_wrap(Array, mat.indexptrs, (mat.NP+1), own=false)
colptr .+= 1
m = mat.M
n = mat.N
nzval = unsafe_wrap(Array,mat.data, (mat.NNZ), own=false)
Expand Down
5 changes: 3 additions & 2 deletions test/common_interface/jacobians.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ Lotka_f = ODEFunction(Lotka,jac=Lotka_jac,

prob = ODEProblem(Lotka_f,ones(2),(0.0,10.0))
jac_called = false
@test_broken sol9 = solve(prob,CVODE_BDF(linear_solver=:KLU))
@test_broken jac_called == true
sol9 = solve(prob,CVODE_BDF(linear_solver=:KLU))
@test jac_called == true
@test Array(sol9) Array(good_sol)

Lotka_fj = ODEFunction(Lotka,
jac_prototype = JacVecOperator{Float64}(Lotka,ones(2)))
Expand Down

0 comments on commit 6643177

Please sign in to comment.