:orphan: # TaoSetUpdate Sets the general-purpose update function called at the beginning of every iteration of the optimization algorithm. Called after the new solution and the gradient is determined, but before the Hessian is computed (if applicable). ## Synopsis ``` #include "petsctao.h" PetscErrorCode TaoSetUpdate(Tao tao, PetscErrorCode (*func)(Tao, PetscInt, void *), void *ctx) ``` Logically Collective ## Input Parameters - ***tao -*** The `Tao` solver context - ***func -*** The function ## Calling sequence of `func` ```none PetscErrorCode func(Tao tao, PetscInt step); ``` - ***tao -*** the optimizer context - ***step -*** The current step of the iteration ## See Also [](ch_tao), `Tao`, `TaoSolve()` ## Level advanced ## Location src/tao/interface/taosolver.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)