From be5fc0877fbae71b8a993bc6e3c7c2416776629c Mon Sep 17 00:00:00 2001 From: jClugstor Date: Wed, 27 Nov 2024 14:57:21 -0500 Subject: [PATCH] densify sparse W for inv --- lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl b/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl index 233f45f5bd..ad507a091b 100644 --- a/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl +++ b/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl @@ -17,7 +17,8 @@ struct StaticWOperator{isinv, T, F} <: AbstractSciMLOperator{T} # when constructing W for the first time for the type # inv(W) can be singular _W = if isinv && callinv - inv(W) + # W may be sparse, needs to be dense to inv + inv(Matrix(W)) else W end