:orphan: # SNESComputeObjective Computes the objective function that has been provided by `SNESSetObjective()` ## Synopsis ``` PetscErrorCode SNESComputeObjective(SNES snes, Vec X, PetscReal *ob) ``` Collective ## Input Parameters - ***snes -*** the `SNES` context - ***X -*** the state vector ## Output Parameter - ***ob -*** the objective value ## See Also `SNESLineSearch`, `SNES`, `SNESSetObjective()`, `SNESGetSolution()` ## Level developer ## Location src/snes/interface/snesob.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/interface/snesob.c) [Index of all SNES routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)