SNESLineSearchGetLambda — PETSc 3.25.2 documentation

Skip to main content
`Ctrl`+`K`

# SNESLineSearchGetLambda

Gets the last line search `lambda` used

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode SNESLineSearchGetLambda(SNESLineSearch linesearch, PetscReal *lambda)

Not Collective

## Input Parameter

- linesearch - the line search context

## Output Parameter

- lambda - The last `lambda` (scaling of the solution update) computed during `SNESLineSearchApply()`

## Note

This is useful in methods where the solver is ill-scaled and requires some adaptive notion of the difference in scale between the solution and the function. For instance, `SNESQN` may be scaled by the line search `lambda` using the argument -snes_qn_scaling ls.

## See Also

SNES: Nonlinear Solvers, `SNES`, `SNESLineSearch`, `SNESLineSearchSetLambda()`, `SNESLineSearchGetDamping()`, `SNESLineSearchApply()`

## Level

advanced

## Location

src/snes/linesearch/interface/linesearch.c

Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages