Reusing the struct Rootfinder in order to call Rootfinder.solve() several times on different models is one of the goal of the solver.
One can find such a use case in situation in which the different models are quite similar and one want to reuse the same solver settings.
However, the Rootfinder struct holds currently information about the resolution process and is not resetted in between each run.
The tasks are the following:
[ ] #22
[ ] force the reset of the internal solver placeholders (iter, jacobian, ...) when reusing the solve method
[ ] allow, when calling Rootfinder.solve(), to provide an optional information jacobian
Providing an optional information jacobian to Rootfinder.solve() allows to NOT compute the jacobian at the first step when using quasi-newton methods and thus saving computational time. The jacobian could be provided based on some heuristic, or could be reused from a previous computation with a slightly different model (exactly in the same way as for the initial_guess parameter, justifying the choice of moving it from the constructor to the solve method)
Reusing the struct
Rootfinder
in order to callRootfinder.solve()
several times on different models is one of the goal of the solver. One can find such a use case in situation in which the different models are quite similar and one want to reuse the same solver settings.However, the
Rootfinder
struct holds currently information about the resolution process and is not resetted in between each run.The tasks are the following:
iter
,jacobian
, ...) when reusing thesolve
methodRootfinder.solve()
, to provide an optional informationjacobian
Providing an optional information
jacobian
toRootfinder.solve()
allows to NOT compute the jacobian at the first step when using quasi-newton methods and thus saving computational time. The jacobian could be provided based on some heuristic, or could be reused from a previous computation with a slightly different model (exactly in the same way as for theinitial_guess
parameter, justifying the choice of moving it from the constructor to thesolve
method)