NOX::MeritFunction::SumOfSquares Class Reference

Sum of squares merit function. More...

#include <NOX_MeritFunction_SumOfSquares.H>

Inheritance diagram for NOX::MeritFunction::SumOfSquares:

Inheritance graph
[legend]
Collaboration diagram for NOX::MeritFunction::SumOfSquares:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SumOfSquares (const Teuchos::RCP< NOX::Utils > &u)
 Constructor.
virtual ~SumOfSquares ()
 Destructor.
virtual double computef (const NOX::Abstract::Group &grp) const
 Computes the merit function, $ f(x) = \frac{1}{2}\| F(x) \|^2 $.
virtual void computeGradient (const NOX::Abstract::Group &group, NOX::Abstract::Vector &result) const
 Computes the gradient, $ g = \nabla f(x) = J(x)^T F(x) $.
virtual double computeSlope (const NOX::Abstract::Vector &dir, const NOX::Abstract::Group &grp) const
 Computes the slope, $ s(x,d) = d^T \nabla f(x) = d^T J(x)^T F(x) $.
virtual double computeQuadraticModel (const NOX::Abstract::Vector &dir, const NOX::Abstract::Group &grp) const
 Computes the quadratic model, $ m(x,d) = f(x) + \nabla f(x)^T d + d^T \nabla^2 f(x) d $.
virtual void computeQuadraticMinimizer (const NOX::Abstract::Group &grp, NOX::Abstract::Vector &result) const
 Computes the vector in the steepest descent direction that minimizes, the quadratic model.
virtual const string & name () const
 Returns the name of the merit function.

Private Member Functions

 SumOfSquares ()
 Disallow default ctor.
virtual double computeSlopeWithoutJacobian (const NOX::Abstract::Vector &dir, const NOX::Abstract::Group &grp) const
 This is a variant of the computeSlope() method above optimized to work with out having to compute an explicit Jacobian.

Private Attributes

Teuchos::RCP< Utilsutils
 Printing utilities.
Teuchos::RCP
< NOX::Abstract::Vector
tmpVecPtr
 Temporary vector for computations.
Teuchos::RCP
< NOX::Abstract::Group
tmpGrpPtr
 Temporary vector for computations.
string meritFunctionName
 Name of this function.


Detailed Description

Sum of squares merit function.

A basic merit function used in many nonlinear equation solvers:

\[ f = \frac{1}{2} \| F(x) \| ^2 \]

Where the norm is the 2-Norm using the NOX::Abstract::Vector's inner product.

This is the default merit function used in nox.

This merit function is taken from: J. E. Dennis Jr. and Robert B. Schnabel, "Numerical Methods for Unconstrained Optimization and Nonlinear Equations," Prentice Hall, 1983

Definition at line 72 of file NOX_MeritFunction_SumOfSquares.H.


Constructor & Destructor Documentation

NOX::MeritFunction::SumOfSquares::SumOfSquares ( const Teuchos::RCP< NOX::Utils > &  u  ) 

Constructor.

Definition at line 48 of file NOX_MeritFunction_SumOfSquares.C.

References utils.

NOX::MeritFunction::SumOfSquares::~SumOfSquares (  )  [virtual]

Destructor.

Definition at line 54 of file NOX_MeritFunction_SumOfSquares.C.

NOX::MeritFunction::SumOfSquares::SumOfSquares (  )  [inline, private]

Disallow default ctor.

Definition at line 123 of file NOX_MeritFunction_SumOfSquares.H.


Member Function Documentation

double NOX::MeritFunction::SumOfSquares::computef ( const NOX::Abstract::Group grp  )  const [virtual]

Computes the merit function, $ f(x) = \frac{1}{2}\| F(x) \|^2 $.

Implements NOX::MeritFunction::Generic.

Definition at line 59 of file NOX_MeritFunction_SumOfSquares.C.

References NOX::Abstract::Group::getNormF(), NOX::Abstract::Group::isF(), and utils.

Referenced by computeQuadraticModel().

void NOX::MeritFunction::SumOfSquares::computeGradient ( const NOX::Abstract::Group group,
NOX::Abstract::Vector result 
) const [virtual]

double NOX::MeritFunction::SumOfSquares::computeSlope ( const NOX::Abstract::Vector dir,
const NOX::Abstract::Group grp 
) const [virtual]

Computes the slope, $ s(x,d) = d^T \nabla f(x) = d^T J(x)^T F(x) $.

If the Jacobian is not computed in the grp object, then the slope can be approximated using directional derivatives. More information can be found in the method computeSlopeWithoutJac.

Implements NOX::MeritFunction::Generic.

Definition at line 108 of file NOX_MeritFunction_SumOfSquares.C.

References NOX::Abstract::Vector::clone(), computeGradient(), computeSlopeWithoutJacobian(), NOX::Abstract::Group::getF(), NOX::Abstract::Vector::innerProduct(), NOX::Abstract::Group::isJacobian(), and tmpVecPtr.

Referenced by computeQuadraticModel().

double NOX::MeritFunction::SumOfSquares::computeQuadraticModel ( const NOX::Abstract::Vector dir,
const NOX::Abstract::Group grp 
) const [virtual]

void NOX::MeritFunction::SumOfSquares::computeQuadraticMinimizer ( const NOX::Abstract::Group grp,
NOX::Abstract::Vector result 
) const [virtual]

const string & NOX::MeritFunction::SumOfSquares::name (  )  const [virtual]

Returns the name of the merit function.

Implements NOX::MeritFunction::Generic.

Definition at line 230 of file NOX_MeritFunction_SumOfSquares.C.

References meritFunctionName.

double NOX::MeritFunction::SumOfSquares::computeSlopeWithoutJacobian ( const NOX::Abstract::Vector dir,
const NOX::Abstract::Group grp 
) const [private, virtual]

This is a variant of the computeSlope() method above optimized to work with out having to compute an explicit Jacobian.

Calculates and returns

\[ \zeta = d^T \nabla f(x) = d^TJ^TF \]

Here $d$ represents the input parameter dir $\nabla f(x)$ is the gradient associated with the given group (for nonlinear solves this equates to $ J^TF $ where $ J $ is the Jacobian and $ F $ is the original nonlinear function).

We can rewrite this equation as:

\[ d^TJ^TF = F^TJd \]

which allows us to use directional derivatives to estimate $ J^TF $:

\[ F^TJd = F^T \frac{F(x + \eta d) - F(x)}{\eta} \]

This may allow for faster computations of the slope if the Jacobian is expensive to evaluate.

where $\eta$ is a scalar perturbation calculated by:

\[ \eta = \lambda * (\lambda + \frac{\| x\|}{\| d\|} ) \]

$ \lambda $ is a constant fixed at 1.0e-6.

Definition at line 145 of file NOX_MeritFunction_SumOfSquares.C.

References NOX::Abstract::Group::clone(), NOX::Abstract::Vector::clone(), NOX::Abstract::Group::getF(), NOX::Abstract::Group::getX(), NOX::Abstract::Vector::norm(), NOX::ShapeCopy, tmpGrpPtr, and tmpVecPtr.

Referenced by computeSlope().


Member Data Documentation

Printing utilities.

Definition at line 162 of file NOX_MeritFunction_SumOfSquares.H.

Referenced by computef(), computeGradient(), computeQuadraticMinimizer(), and SumOfSquares().

Temporary vector for computations.

Definition at line 165 of file NOX_MeritFunction_SumOfSquares.H.

Referenced by computeQuadraticMinimizer(), computeQuadraticModel(), computeSlope(), and computeSlopeWithoutJacobian().

Temporary vector for computations.

Only allocated if the method computeJacobianWithOutJac is called.

Definition at line 169 of file NOX_MeritFunction_SumOfSquares.H.

Referenced by computeSlopeWithoutJacobian().

Name of this function.

Definition at line 172 of file NOX_MeritFunction_SumOfSquares.H.

Referenced by name().


The documentation for this class was generated from the following files:

Generated on Wed Oct 21 14:28:48 2009 for Nonlinear Solver Project by  doxygen 1.5.9