Skip to main content
`Ctrl`+`K`

# KSPQCGGetQuadratic

Gets the value of the quadratic function, evaluated at the new iterate

## Synopsis

    #include "petscksp.h"
    PetscErrorCode KSPQCGGetQuadratic(KSP ksp, PetscReal *quadratic)

Collective

## Input Parameter

- ksp - the iterative context

## Output Parameter

- quadratic - the quadratic function evaluated at the new iterate

## Note

The quadratic function is

\[ q(s) = g^T * s + 0.5 * s^T * H * s \]

which satisfies the Euclidean Norm trust region constraint

\[ || D * s || \le delta, \]

where

      delta is the trust region radius,
      g is the gradient vector, and
      H is Hessian matrix,
      D is a scaling matrix.

## See Also

KSP: Linear System Solvers, `KSPQCG`

## Level

advanced

## Location

src/ksp/ksp/impls/qcg/qcg.c

## Implementations

KSPQCGGetQuadratic_QCG() in src/ksp/ksp/impls/qcg/qcg.c

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