TaoLineSearchGetSolution — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# TaoLineSearchGetSolution

Returns the solution to the line search

## Synopsis

    #include "petsctaolinesearch.h"
    PetscErrorCode TaoLineSearchGetSolution(TaoLineSearch ls, Vec x, PetscReal *f, Vec g, PetscReal *steplength, TaoLineSearchConvergedReason *reason)

Collective

## Input Parameter

- ls - the `TaoLineSearch` context

## Output Parameters

- x - the new solution

- f - the objective function value at `x`

- g - the gradient at `x`

- steplength - the multiple of the step direction taken by the line search

- reason - the reason why the line search terminated

## See Also

`TaoLineSearchGetStartingVector()`, `TaoLineSearchGetStepDirection()`

## Level

developer

## Location

src/tao/linesearch/interface/taolinesearch.c

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