:orphan: # TaoSetRecycleHistory Sets the boolean flag to enable/disable re-using iterate information from the previous `TaoSolve()`. This feature is disabled by default. ## Synopsis ``` #include "petsctao.h" PetscErrorCode TaoSetRecycleHistory(Tao tao, PetscBool recycle) ``` Logically Collective ## Input Parameters - ***tao -*** the `Tao` context - ***recycle -*** boolean flag ## Options Database Key - ***-tao_recycle_history -*** reuse the history ## Notes For conjugate gradient methods (`TAOBNCG`), this re-uses the latest search direction from the previous `TaoSolve()` call when computing the first search direction in a new solution. By default, CG methods set the first search direction to the negative gradient. For quasi-Newton family of methods (`TAOBQNLS`, `TAOBQNKLS`, `TAOBQNKTR`, `TAOBQNKTL`), this re-uses the accumulated quasi-Newton Hessian approximation from the previous `TaoSolve()` call. By default, QN family of methods reset the initial Hessian approximation to the identity matrix. For any other algorithm, this setting has no effect. ## See Also [](ch_tao), `Tao`, `TaoGetRecycleHistory()`, `TAOBNCG`, `TAOBQNLS`, `TAOBQNKLS`, `TAOBQNKTR`, `TAOBQNKTL` ## Level intermediate ## Location src/tao/interface/taosolver.c ## Examples src/tao/unconstrained/tutorials/rosenbrock3.c
--- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/tao/interface/taosolver.c) [Index of all Tao routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)