:orphan:
# KSPCGSetObjectiveTarget
Sets the target value for the quadratic model reduction 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPCGSetObjectiveTarget(KSP ksp, PetscReal obj)
```
Logically Collective


## Input Parameters

- ***ksp -*** the iterative context
- ***obj -*** the objective value (0 is the default)





## Note
The CG process will stop when the current objective function
1/2 x_k * A * x_k - b * x_k is smaller than obj if obj is negative.
Otherwise the test is ignored.


## See Also
 [](ch_ksp), `KSP`, `KSPCG`, `KSPNASH`, `KSPSTCG`, `KSPGLTR`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/cg/cgtype.c.html#KSPCGSetObjectiveTarget">src/ksp/ksp/impls/cg/cgtype.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/cg/cg.c.html#KSPCGSetObjectiveTarget_CG">KSPCGSetObjectiveTarget_CG in src/ksp/ksp/impls/cg/cg.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/impls/cg/cgtype.c)


[Index of all KSP routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
