Skip to content

Commit

Permalink
Add test for linear_solver kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna Störiko authored and aseyboldt committed Aug 17, 2021
1 parent ec4a094 commit b13d83b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sunode/test_solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,26 @@ def rhs(t, y, p):

solver = AdjointSolver(problem)
check_call_solve(solver, param_vals, "backward")


def test_linear_solver_kwarg():
def rhs(t, y, p):
return {
'x': y.x,
}

states = {
'x': (),
}

params = {
'b': ()
}
param_vals = {
'b': 0.2
}
problem = SympyProblem(params, states, rhs, derivative_params=[])
linear_solver_opts = ["dense", "dense_finitediff", "spgmr_finitediff", "spgmr"]
for linear_solver in linear_solver_opts:
solver = Solver(problem, linear_solver=linear_solver)
check_call_solve(solver, param_vals, None)

0 comments on commit b13d83b

Please sign in to comment.