Skip to content

Commit dcb416d

Browse files
fix: implement recursive_unwrap for SparseMatrixCSC
1 parent 11f33f7 commit dcb416d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/systems/problem_utils.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@ function recursive_unwrap(x::AbstractArray)
245245
symbolic_type(x) == ArraySymbolic() ? unwrap(x) : recursive_unwrap.(x)
246246
end
247247

248+
function recursive_unwrap(x::SparseMatrixCSC)
249+
I, J, V = findnz(x)
250+
V = recursive_unwrap(V)
251+
m, n = size(x)
252+
return sparse(I, J, V, m, n)
253+
end
254+
248255
recursive_unwrap(x) = unwrap(x)
249256

250257
function recursive_unwrap(x::AbstractDict)

0 commit comments

Comments
 (0)