# SNESLINESEARCHL2
Secant search in the L2 norm of the function or the objective function, if it is provided with `SNESSetObjective()`. Attempts to solve min_lambda f(x + lambda y) using the secant method with the initial bracketing of lambda between [0,damping]. Differences of f()
are used to approximate the first and second derivative of f() with respect to lambda, f'() and f''(). The secant method is run for maxit iterations.

When an objective function is provided f(w) is the objective function otherwise f(w) = ||F(w)||^2. x is the current step and y is the search direction.

This has no checks on whether the secant method is actually converging.


## Options Database Keys

- ***-snes_linesearch_max_it <maxit> -*** maximum number of iterations, default is 1
- ***-snes_linesearch_maxstep <length> -*** the algorithm insures that a step length is never longer than this value
- ***-snes_linesearch_damping <damping> -*** initial step is scaled back by this factor, default is 1.0
- ***-snes_linesearch_minlambda <minlambda> -*** minimum allowable lambda





## Developer Note
A better name for this method might be `SNESLINESEARCHSECANT`, L2 is not descriptive


## See Also
 `SNESLINESEARCHBT`, `SNESLINESEARCHCP`, `SNESLineSearch`, `SNESLineSearchType`, `SNESLineSearchCreate()`, `SNESLineSearchSetType()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/impls/l2/linesearchl2.c.html#SNESLINESEARCHL2">src/snes/linesearch/impls/l2/linesearchl2.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/linesearch/impls/l2/linesearchl2.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)  
