Skip to content

Commit

Permalink
Error on misspecifying arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 1, 2023
1 parent a70567b commit 444f69e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sensitivity_algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,12 @@ function setvjp(sensealg::SteadyStateAdjoint{CJ, CS, AD, FDT, VJP, LS, LM},
end

needs_concrete_jac(::SteadyStateAdjoint, ::SSAdjointFullJacobianLinsolve, _) = true
needs_concrete_jac(::SteadyStateAdjoint, ::SSAdjointIterativeVJPLinsolve, _) = false
function needs_concrete_jac(S::SteadyStateAdjoint, ::SSAdjointIterativeVJPLinsolve, _)
if S.linsolve !== nothing && LinearSolve.needs_concrete_A(S.linsolve)
error("$(S.linsolve) requires a concrete Matrix. Cannot be solved using the Iterative VJPs!")
end
return false
end
function needs_concrete_jac(S::SteadyStateAdjoint, L::SSAdjointHeuristicLinsolve, u0)
return length(u0) L.auto_switch_threshold
end
Expand Down

0 comments on commit 444f69e

Please sign in to comment.