Skip to content

Commit b71300d

Browse files
committed
similar doesn't preserve the sparsity pattern
1 parent 04810f5 commit b71300d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SparseDiffTools"
22
uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
33
authors = ["Pankaj Mishra <pankajmishra1511@gmail.com>", "Chris Rackauckas <contact@chrisrackauckas.com>"]
4-
version = "2.7.0"
4+
version = "2.8.0"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

src/highlevel/common.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ function init_jacobian(c::AbstractMaybeSparseJacobianCache)
260260
end
261261
init_jacobian(::Nothing, ::Type{T}, fx, x) where {T} = similar(fx, T, length(fx), length(x))
262262
init_jacobian(J, ::Type{T}, _, _) where {T} = similar(J, T, size(J, 1), size(J, 2))
263+
init_jacobian(J::SparseMatrixCSC, ::Type{T}, _, _) where {T} = T.(J)
263264

264265
__maybe_copy_x(_, x) = x
265266
__maybe_copy_x(_, ::Nothing) = nothing

0 commit comments

Comments
 (0)