File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,5 +198,11 @@ The method may be implemented by particular solvers if they store the cost at th
198198iterate in the state, but by default it is obtained by calling `get_cost(p, get_iterate(s))`.
199199"""
200200function get_cost (p:: AbstractManoptProblem , s:: AbstractManoptSolverState )
201+ return _get_cost (p, s, dispatch_state_decorator (s))
202+ end
203+ function _get_cost (p:: AbstractManoptProblem , s:: AbstractManoptSolverState , :: Val{false} )
201204 return get_cost (p, get_iterate (s))
202205end
206+ function _get_cost (p:: AbstractManoptProblem , s:: AbstractManoptSolverState , :: Val{true} )
207+ return get_cost (p, s. state)
208+ end
Original file line number Diff line number Diff line change 572572 solve! (mp, qns)
573573 @test get_cost (mp, qns) == f (M, get_iterate (qns))
574574
575+ @testset " get_cost with DebugSolverState" begin
576+ dqns = DebugSolverState (qns, DebugMessages (:Info , :Always ))
577+ @test get_cost (mp, dqns) == f (M, get_iterate (dqns))
578+ end
575579 end
576580end
You can’t perform that action at this time.
0 commit comments