# SNESLINESEARCHNCGLINEAR
Special line search only for the nonlinear CG solver `SNESNCG` This line search uses the length "as if" the problem is linear (that is what is computed by the linear CG method) using the Jacobian of the function.
alpha = (r, r) / (p, Ap) = (f, f) / (y, Jy) where r (f) is the current residual (function value), p (y) is the current search direction.


## Notes
This requires a Jacobian-vector product but does not require the solution of a linear system with the Jacobian

This is a "odd-ball" line search, we don't know if it is in the literature or used in practice by anyone.




## See Also
 `SNESLineSearchCreate()`, `SNESLineSearchSetType()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ncg/snesncg.c.html#SNESLINESEARCHNCGLINEAR">src/snes/impls/ncg/snesncg.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/impls/ncg/snesncg.c)


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