:orphan: # TaoComputeResidual Computes a least-squares residual vector at a given point ## Synopsis ``` #include "petsctao.h" PetscErrorCode TaoComputeResidual(Tao tao, Vec X, Vec F) ``` Collective ## Input Parameters - ***tao -*** the `Tao` context - ***X -*** input vector ## Output Parameter - ***f -*** Objective vector at `X` ## Notes `TaoComputeResidual()` is typically used within the implementation of the optimization algorithm, so most users would not generally call this routine themselves. ## See Also [](ch_tao), `Tao`, `TaoSetResidualRoutine()` ## Level advanced ## Location src/tao/interface/taosolver_fg.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/tao/interface/taosolver_fg.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)