ROL
ROL::ROL::Objective< Real > Class Template Referenceabstract

#include <ROL_Constraint_SerialSimOpt.hpp>

+ Inheritance diagram for ROL::ROL::Objective< Real >:

Public Member Functions

virtual ~Objective ()
 
 Objective ()
 
virtual void update (const Vector< Real > &x, UpdateType type, int iter=-1)
 Update objective function.
 
virtual void update (const Vector< Real > &x, bool flag=true, int iter=-1)
 Update objective function.
 
virtual Real value (const Vector< Real > &x, Real &tol)=0
 Compute value.
 
virtual void gradient (Vector< Real > &g, const Vector< Real > &x, Real &tol)
 Compute gradient.
 
virtual Real dirDeriv (const Vector< Real > &x, const Vector< Real > &d, Real &tol)
 Compute directional derivative.
 
virtual void hessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply Hessian approximation to vector.
 
virtual void invHessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply inverse Hessian approximation to vector.
 
virtual void precond (Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply preconditioner to vector.
 
virtual std::vector< std::vector< Real > > checkGradient (const Vector< Real > &x, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference gradient check.
 
virtual std::vector< std::vector< Real > > checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference gradient check.
 
virtual std::vector< std::vector< Real > > checkGradient (const Vector< Real > &x, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference gradient check with specified step sizes.
 
virtual std::vector< std::vector< Real > > checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference gradient check with specified step sizes.
 
virtual std::vector< std::vector< Real > > checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference Hessian-applied-to-vector check.
 
virtual std::vector< std::vector< Real > > checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference Hessian-applied-to-vector check.
 
virtual std::vector< std::vector< Real > > checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference Hessian-applied-to-vector check with specified step sizes.
 
virtual std::vector< std::vector< Real > > checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference Hessian-applied-to-vector check with specified step sizes.
 
virtual std::vector< Real > checkHessSym (const Vector< Real > &x, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout)
 Hessian symmetry check.
 
virtual std::vector< Real > checkHessSym (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout)
 Hessian symmetry check.
 
virtual void setParameter (const std::vector< Real > &param)
 

Protected Member Functions

const std::vector< Real > getParameter (void) const
 

Private Attributes

Ptr< Vector< Real > > prim_
 
Ptr< Vector< Real > > dual_
 
Ptr< Vector< Real > > basis_
 
std::vector< Real > param_
 

Detailed Description

template<typename Real>
class ROL::ROL::Objective< Real >

Definition at line 78 of file ROL_Constraint_SerialSimOpt.hpp.

Constructor & Destructor Documentation

◆ ~Objective()

template<typename Real>
virtual ROL::ROL::Objective< Real >::~Objective ( )
inlinevirtual

Definition at line 85 of file ROL_Constraint_SerialSimOpt.hpp.

◆ Objective()

template<typename Real>
ROL::ROL::Objective< Real >::Objective ( )
inline

Definition at line 87 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by ROL::AffineTransformObjective< Real >::AffineTransformObjective(), ROL::AffineTransformObjective< Real >::AffineTransformObjective(), ROL::AffineTransformObjective< Real >::AffineTransformObjective(), ROL::ROL::AffineTransformObjective< Real >::AffineTransformObjective(), ROL::ROL::AffineTransformObjective< Real >::AffineTransformObjective(), ROL::ROL::AffineTransformObjective< Real >::AffineTransformObjective(), ROL::AugmentedLagrangian< Real >::AugmentedLagrangian(), ROL::AugmentedLagrangian< Real >::AugmentedLagrangian(), ROL::AugmentedLagrangianObjective< Real >::AugmentedLagrangianObjective(), ROL::AugmentedLagrangianObjective< Real >::AugmentedLagrangianObjective(), ROL::CDFObjective< Real >::CDFObjective(), ROL::CompositeObjective< Real >::CompositeObjective(), ROL::ElasticObjective< Real >::ElasticObjective(), ROL::ElasticObjective< Real >::ElasticObjective(), ROL::FletcherBase< Real >::FletcherBase(), ROL::FletcherObjectiveBase< Real >::FletcherObjectiveBase(), ROL::InteriorPointObjective< Real >::InteriorPointObjective(), ROL::InteriorPointObjective< Real >::InteriorPointObjective(), ROL::InteriorPointPenalty< Real >::InteriorPointPenalty(), ROL::LinearCombinationObjective< Real >::LinearCombinationObjective(), ROL::LinearCombinationObjective< Real >::LinearCombinationObjective(), ROL::MeanValueObjective< Real >::MeanValueObjective(), ROL::MomentObjective< Real >::MomentObjective(), ROL::MomentObjective< Real >::MomentObjective(), ROL::MoreauYosidaObjective< Real >::MoreauYosidaObjective(), ROL::MoreauYosidaObjective< Real >::MoreauYosidaObjective(), ROL::MoreauYosidaObjective< Real >::MoreauYosidaObjective(), ROL::MoreauYosidaObjective< Real >::MoreauYosidaObjective(), ROL::MoreauYosidaPenalty< Real >::MoreauYosidaPenalty(), ROL::MoreauYosidaPenalty< Real >::MoreauYosidaPenalty(), ROL::MoreauYosidaPenalty< Real >::MoreauYosidaPenalty(), ROL::ObjectiveMMA< Real >::ObjectiveMMA(), ROL::InteriorPoint::PenalizedObjective< Real >::PenalizedObjective(), ROL::PH_bPOEObjective< Real >::PH_bPOEObjective(), ROL::PH_DeviationObjective< Real >::PH_DeviationObjective(), ROL::PH_ErrorObjective< Real >::PH_ErrorObjective(), ROL::PH_Objective< Real >::PH_Objective(), ROL::PH_ProbObjective< Real >::PH_ProbObjective(), ROL::PH_RegretObjective< Real >::PH_RegretObjective(), ROL::PH_RiskObjective< Real >::PH_RiskObjective(), ROL::PointwiseCDFObjective< Real >::PointwiseCDFObjective(), ROL::ProjectedObjective< Real >::ProjectedObjective(), ROL::RiskLessObjective< Real >::RiskLessObjective(), ROL::RiskNeutralObjective< Real >::RiskNeutralObjective(), ROL::RiskNeutralObjective< Real >::RiskNeutralObjective(), ROL::RiskNeutralObjective< Real >::RiskNeutralObjective(), ROL::ScaledObjective< Real >::ScaledObjective(), ROL::TrustRegionModel_U< Real >::setData(), ROL::SlacklessObjective< Real >::SlacklessObjective(), ROL::StochasticObjective< Real >::StochasticObjective(), ROL::StochasticObjective< Real >::StochasticObjective(), ROL::StochasticObjective< Real >::StochasticObjective(), ROL::StochasticObjective< Real >::StochasticObjective(), ROL::StochasticObjective< Real >::StochasticObjective(), ROL::StochasticObjective< Real >::StochasticObjective(), ROL::TrustRegionModel< Real >::TrustRegionModel(), ROL::TrustRegionModel< Real >::update(), ROL::TrustRegionModel_U< Real >::validate(), and ROL::StdObjective< Real >::value().

Member Function Documentation

◆ update() [1/2]

template<typename Real>
virtual void ROL::ROL::Objective< Real >::update ( const Vector< Real > & x,
UpdateType type,
int iter = -1 )
inlinevirtual

Update objective function.

This function updates the objective function at new iterations.

Parameters
[in]xis the new iterate.
[in]typeis the type of update requested.
[in]iteris the outer algorithm iterations count.

Reimplemented in ROL::ROL::AffineTransformObjective< Real >, ROL::ROL::AugmentedLagrangianObjective< Real >, and ROL::ROL::NonlinearLeastSquaresObjective< Real >.

Definition at line 96 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by ROL::ROL::TypeU::LineSearchAlgorithm< Real >::initialize(), and ROL::ROL::TypeU::LineSearchAlgorithm< Real >::run().

◆ update() [2/2]

template<typename Real>
virtual void ROL::ROL::Objective< Real >::update ( const Vector< Real > & x,
bool flag = true,
int iter = -1 )
inlinevirtual

Update objective function.

This function updates the objective function at new iterations.

Parameters
[in]xis the new iterate.
[in]flagis true if the iterate has changed.
[in]iteris the outer algorithm iterations count.

Reimplemented in ROL::ROL::AffineTransformObjective< Real >, ROL::ROL::NonlinearLeastSquaresObjective< Real >, and ROL::ROL::QuadraticPenalty< Real >.

Definition at line 109 of file ROL_Constraint_SerialSimOpt.hpp.

◆ value()

template<typename Real>
virtual Real ROL::ROL::Objective< Real >::value ( const Vector< Real > & x,
Real & tol )
pure virtual

◆ gradient()

template<typename Real>
void ROL::ROL::Objective< Real >::gradient ( Vector< Real > & g,
const Vector< Real > & x,
Real & tol )
virtual

Compute gradient.

This function returns the objective function gradient.

Parameters
[out]gis the gradient.
[in]xis the current iterate.
[in]tolis a tolerance for inexact objective function computation.

The default implementation is a finite-difference approximation based on the function value. This requires the definition of a basis \(\{\phi_i\}\) for the optimization vectors x and the definition of a basis \(\{\psi_j\}\) for the dual optimization vectors (gradient vectors g). The bases must be related through the Riesz map, i.e., \( R \{\phi_i\} = \{\psi_j\}\), and this must be reflected in the implementation of the ROL::Vector::dual() method.

Reimplemented in ROL::ROL::AffineTransformObjective< Real >, ROL::ROL::AugmentedLagrangianObjective< Real >, ROL::ROL::NonlinearLeastSquaresObjective< Real >, ROL::ROL::Objective_FSsolver< Real >, ROL::ROL::QuadraticPenalty< Real >, and ROL::ROL::TrustRegionModel_U< Real >.

Definition at line 74 of file ROL_ObjectiveDef.hpp.

References ROL::ROL::Vector< Real >::axpy(), ROL::ROL::Vector< Real >::basis(), basis_, ROL::ROL::Vector< Real >::clone(), ROL::ROL::Vector< Real >::dimension(), ROL::ROL::Vector< Real >::dot(), prim_, ROL::ROL::Revert, ROL::ROL::ROL_EPSILON(), ROL::ROL::Temp, ROL::update(), ROL::value(), ROL::ROL::Vector< Real >::zero(), and zero.

Referenced by checkGradient(), checkHessVec(), dirDeriv(), ROL::FletcherBase< Real >::getGradient(), ROL::FletcherObjectiveBase< Real >::getGradient(), hessVec(), ROL::ROL::TypeU::LineSearchAlgorithm< Real >::initialize(), ROL::ROL::TypeU::LineSearchAlgorithm< Real >::run(), and ROL::FletcherStep< Real >::update().

◆ dirDeriv()

template<typename Real>
Real ROL::ROL::Objective< Real >::dirDeriv ( const Vector< Real > & x,
const Vector< Real > & d,
Real & tol )
virtual

Compute directional derivative.

This function returns the directional derivative of the objective function in the \(d\) direction.

Parameters
[in]xis the current iterate.
[in]dis the direction.
[in]tolis a tolerance for inexact objective function computation.

Definition at line 54 of file ROL_ObjectiveDef.hpp.

References ROL::ROL::Vector< Real >::apply(), ROL::ROL::Vector< Real >::clone(), ROL::ROL::Vector< Real >::dual(), dual_, and gradient().

◆ hessVec()

template<typename Real>
void ROL::ROL::Objective< Real >::hessVec ( Vector< Real > & hv,
const Vector< Real > & v,
const Vector< Real > & x,
Real & tol )
virtual

Apply Hessian approximation to vector.

This function applies the Hessian of the objective function to the vector \(v\).

Parameters
[out]hvis the the action of the Hessian on \(v\).
[in]vis the direction vector.
[in]xis the current iterate.
[in]tolis a tolerance for inexact objective function computation.

Reimplemented in ROL::ROL::AffineTransformObjective< Real >, ROL::ROL::AugmentedLagrangianObjective< Real >, ROL::ROL::NonlinearLeastSquaresObjective< Real >, ROL::ROL::Objective_FSsolver< Real >, ROL::ROL::QuadraticPenalty< Real >, and ROL::ROL::TrustRegionModel_U< Real >.

Definition at line 95 of file ROL_ObjectiveDef.hpp.

References ROL::ROL::Vector< Real >::axpy(), ROL::ROL::Vector< Real >::clone(), dual_, gradient(), ROL::ROL::Vector< Real >::norm(), prim_, ROL::ROL::Revert, ROL::ROL::Vector< Real >::scale(), ROL::ROL::Temp, ROL::update(), ROL::ROL::Vector< Real >::zero(), and zero.

Referenced by checkHessSym(), checkHessVec(), ROL::ZOO::Objective_DiodeCircuit< Real >::hessVec(), and main().

◆ invHessVec()

template<typename Real>
virtual void ROL::ROL::Objective< Real >::invHessVec ( Vector< Real > & hv,
const Vector< Real > & v,
const Vector< Real > & x,
Real & tol )
inlinevirtual

Apply inverse Hessian approximation to vector.

This function applies the inverse Hessian of the objective function to the vector \(v\).

Parameters
[out]hvis the action of the inverse Hessian on \(v\).
[in]vis the direction vector.
[in]xis the current iterate.
[in]tolis a tolerance for inexact objective function computation.

Reimplemented in ROL::ROL::TrustRegionModel_U< Real >.

Definition at line 165 of file ROL_Constraint_SerialSimOpt.hpp.

◆ precond()

template<typename Real>
virtual void ROL::ROL::Objective< Real >::precond ( Vector< Real > & Pv,
const Vector< Real > & v,
const Vector< Real > & x,
Real & tol )
inlinevirtual

Apply preconditioner to vector.

This function applies a preconditioner for the Hessian of the objective function to the vector \(v\).

Parameters
[out]Pvis the action of the Hessian preconditioner on \(v\).
[in]vis the direction vector.
[in]xis the current iterate.
[in]tolis a tolerance for inexact objective function computation.

Reimplemented in ROL::ROL::NonlinearLeastSquaresObjective< Real >, and ROL::ROL::TrustRegionModel_U< Real >.

Definition at line 183 of file ROL_Constraint_SerialSimOpt.hpp.

◆ checkGradient() [1/4]

template<typename Real>
virtual std::vector< std::vector< Real > > ROL::ROL::Objective< Real >::checkGradient ( const Vector< Real > & x,
const Vector< Real > & d,
const bool printToStream = true,
std::ostream & outStream = std::cout,
const int numSteps = ROL_NUM_CHECKDERIV_STEPS,
const int order = 1 )
inlinevirtual

Finite-difference gradient check.

This function computes a sequence of one-sided finite-difference checks for the gradient.
At each step of the sequence, the finite difference step size is decreased. The output compares the error

\[ \left| \frac{f(x+td) - f(x)}{t} - \langle \nabla f(x),d\rangle_{\mathcal{X}^*,\mathcal{X}}\right|. \]

if the approximation is first order. More generally, difference approximation is

\[ \frac{1}{t} \sum\limits_{i=1}^m w_i f(x+t c_i d) \]

where m = order+1, \(w_i\) are the difference weights and \(c_i\) are the difference steps

Parameters
[in]xis an optimization variable.
[in]dis a direction vector.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.
[in]numStepsis a parameter which dictates the number of finite difference steps.
[in]orderis the order of the finite difference approximation (1,2,3,4)

Definition at line 209 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by checkGradient(), and main().

◆ checkGradient() [2/4]

template<typename Real>
std::vector< std::vector< Real > > ROL::ROL::Objective< Real >::checkGradient ( const Vector< Real > & x,
const Vector< Real > & g,
const Vector< Real > & d,
const bool printToStream = true,
std::ostream & outStream = std::cout,
const int numSteps = ROL_NUM_CHECKDERIV_STEPS,
const int order = 1 )
virtual

Finite-difference gradient check.

This function computes a sequence of one-sided finite-difference checks for the gradient.
At each step of the sequence, the finite difference step size is decreased. The output compares the error

\[ \left| \frac{f(x+td) - f(x)}{t} - \langle \nabla f(x),d\rangle_{\mathcal{X}^*,\mathcal{X}}\right|. \]

if the approximation is first order. More generally, difference approximation is

\[ \frac{1}{t} \sum\limits_{i=1}^m w_i f(x+t c_i d) \]

where m = order+1, \(w_i\) are the difference weights and \(c_i\) are the difference steps

Parameters
[in]xis an optimization variable.
[in]gis used to create a temporary gradient vector.
[in]dis a direction vector.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.
[in]numStepsis a parameter which dictates the number of finite difference steps.
[in]orderis the order of the finite difference approximation (1,2,3,4)

Definition at line 119 of file ROL_ObjectiveDef.hpp.

References checkGradient().

◆ checkGradient() [3/4]

template<typename Real>
virtual std::vector< std::vector< Real > > ROL::ROL::Objective< Real >::checkGradient ( const Vector< Real > & x,
const Vector< Real > & d,
const std::vector< Real > & steps,
const bool printToStream = true,
std::ostream & outStream = std::cout,
const int order = 1 )
inlinevirtual

Finite-difference gradient check with specified step sizes.

This function computes a sequence of one-sided finite-difference checks for the gradient.
At each step of the sequence, the finite difference step size is decreased. The output compares the error

\[ \left| \frac{f(x+td) - f(x)}{t} - \langle \nabla f(x),d\rangle_{\mathcal{X}^*,\mathcal{X}}\right|. \]

if the approximation is first order. More generally, difference approximation is

\[ \frac{1}{t} \sum\limits_{i=1}^m w_i f(x+t c_i d) \]

where m = order+1, \(w_i\) are the difference weights and \(c_i\) are the difference steps

Parameters
[in]xis an optimization variable.
[in]dis a direction vector.
[in]stepsis vector of steps of user-specified size.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.
[in]orderis the order of the finite difference approximation (1,2,3,4)

Definition at line 269 of file ROL_Constraint_SerialSimOpt.hpp.

◆ checkGradient() [4/4]

template<typename Real>
std::vector< std::vector< Real > > ROL::ROL::Objective< Real >::checkGradient ( const Vector< Real > & x,
const Vector< Real > & g,
const Vector< Real > & d,
const std::vector< Real > & steps,
const bool printToStream = true,
std::ostream & outStream = std::cout,
const int order = 1 )
virtual

Finite-difference gradient check with specified step sizes.

This function computes a sequence of one-sided finite-difference checks for the gradient.
At each step of the sequence, the finite difference step size is decreased. The output compares the error

\[ \left| \frac{f(x+td) - f(x)}{t} - \langle \nabla f(x),d\rangle_{\mathcal{X}^*,\mathcal{X}}\right|. \]

if the approximation is first order. More generally, difference approximation is

\[ \frac{1}{t} \sum\limits_{i=1}^m w_i f(x+t c_i d) \]

where m = order+1, \(w_i\) are the difference weights and \(c_i\) are the difference steps

Parameters
[in]xis an optimization variable.
[in]gis used to create a temporary gradient vector.
[in]dis a direction vector.
[in]stepsis vector of steps of user-specified size.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.
[in]orderis the order of the finite difference approximation (1,2,3,4)

Definition at line 138 of file ROL_ObjectiveDef.hpp.

References ROL::ROL::Vector< Real >::apply(), ROL::ROL::Vector< Real >::clone(), gradient(), ROL::ROL::ROL_EPSILON(), ROL::ROL::Finite_Difference_Arrays::shifts, ROL::ROL::Temp, ROL::update(), ROL::value(), and ROL::ROL::Finite_Difference_Arrays::weights.

◆ checkHessVec() [1/4]

template<typename Real>
virtual std::vector< std::vector< Real > > ROL::ROL::Objective< Real >::checkHessVec ( const Vector< Real > & x,
const Vector< Real > & v,
const bool printToStream = true,
std::ostream & outStream = std::cout,
const int numSteps = ROL_NUM_CHECKDERIV_STEPS,
const int order = 1 )
inlinevirtual

Finite-difference Hessian-applied-to-vector check.

This function computes a sequence of one-sided finite-difference checks for the Hessian.
At each step of the sequence, the finite difference step size is decreased. The output compares the error

\[ \left\| \frac{\nabla f(x+tv) - \nabla f(x)}{t} - \nabla^2 f(x)v\right\|_{\mathcal{X}^*}, \]

if the approximation is first order. More generally, difference approximation is

\[ \frac{1}{t} \sum\limits_{i=1}^m w_i \nabla f(x+t c_i v), \]

where m = order+1, \(w_i\) are the difference weights and \(c_i\) are the difference steps

Parameters
[in]xis an optimization variable.
[in]vis a direction vector.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.
[in]numStepsis a parameter which dictates the number of finite difference steps.
[in]orderis the order of the finite difference approximation (1,2,3,4)

Definition at line 331 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by checkHessVec(), and main().

◆ checkHessVec() [2/4]

template<typename Real>
std::vector< std::vector< Real > > ROL::ROL::Objective< Real >::checkHessVec ( const Vector< Real > & x,
const Vector< Real > & hv,
const Vector< Real > & v,
const bool printToStream = true,
std::ostream & outStream = std::cout,
const int numSteps = ROL_NUM_CHECKDERIV_STEPS,
const int order = 1 )
virtual

Finite-difference Hessian-applied-to-vector check.

This function computes a sequence of one-sided finite-difference checks for the Hessian.
At each step of the sequence, the finite difference step size is decreased. The output compares the error

\[ \left\| \frac{\nabla f(x+tv) - \nabla f(x)}{t} - \nabla^2 f(x)v\right\|_{\mathcal{X}^*}, \]

if the approximation is first order. More generally, difference approximation is

\[ \frac{1}{t} \sum\limits_{i=1}^m w_i \nabla f(x+t c_i v), \]

where m = order+1, \(w_i\) are the difference weights and \(c_i\) are the difference steps

Parameters
[in]xis an optimization variable.
[in]hvis used to create temporary gradient and Hessian-times-vector vectors.
[in]vis a direction vector.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.
[in]numStepsis a parameter which dictates the number of finite difference steps.
[in]orderis the order of the finite difference approximation (1,2,3,4)

Definition at line 234 of file ROL_ObjectiveDef.hpp.

References checkHessVec().

◆ checkHessVec() [3/4]

template<typename Real>
virtual std::vector< std::vector< Real > > ROL::ROL::Objective< Real >::checkHessVec ( const Vector< Real > & x,
const Vector< Real > & v,
const std::vector< Real > & steps,
const bool printToStream = true,
std::ostream & outStream = std::cout,
const int order = 1 )
inlinevirtual

Finite-difference Hessian-applied-to-vector check with specified step sizes.

This function computes a sequence of one-sided finite-difference checks for the Hessian.
At each step of the sequence, the finite difference step size is decreased. The output compares the error

\[ \left\| \frac{\nabla f(x+tv) - \nabla f(x)}{t} - \nabla^2 f(x)v\right\|_{\mathcal{X}^*}, \]

if the approximation is first order. More generally, difference approximation is

\[ \frac{1}{t} \sum\limits_{i=1}^m w_i \nabla f(x+t c_i v), \]

where m = order+1, \(w_i\) are the difference weights and \(c_i\) are the difference steps

Parameters
[in]xis an optimization variable.
[in]vis a direction vector.
[in]stepsis vector of steps of user-specified size.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.
[in]orderis the order of the finite difference approximation (1,2,3,4)

Definition at line 392 of file ROL_Constraint_SerialSimOpt.hpp.

◆ checkHessVec() [4/4]

template<typename Real>
std::vector< std::vector< Real > > ROL::ROL::Objective< Real >::checkHessVec ( const Vector< Real > & x,
const Vector< Real > & hv,
const Vector< Real > & v,
const std::vector< Real > & steps,
const bool printToStream = true,
std::ostream & outStream = std::cout,
const int order = 1 )
virtual

Finite-difference Hessian-applied-to-vector check with specified step sizes.

This function computes a sequence of one-sided finite-difference checks for the Hessian.
At each step of the sequence, the finite difference step size is decreased. The output compares the error

\[ \left\| \frac{\nabla f(x+tv) - \nabla f(x)}{t} - \nabla^2 f(x)v\right\|_{\mathcal{X}^*}, \]

if the approximation is first order. More generally, difference approximation is

\[ \frac{1}{t} \sum\limits_{i=1}^m w_i \nabla f(x+t c_i v), \]

where m = order+1, \(w_i\) are the difference weights and \(c_i\) are the difference steps

Parameters
[in]xis an optimization variable.
[in]hvis used to create temporary gradient and Hessian-times-vector vectors.
[in]vis a direction vector.
[in]stepsis vector of steps of user-specified size.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.
[in]orderis the order of the finite difference approximation (1,2,3,4)

Definition at line 253 of file ROL_ObjectiveDef.hpp.

References ROL::ROL::Vector< Real >::clone(), gradient(), hessVec(), ROL::ROL::ROL_EPSILON(), ROL::ROL::Finite_Difference_Arrays::shifts, ROL::ROL::Temp, ROL::update(), and ROL::ROL::Finite_Difference_Arrays::weights.

◆ checkHessSym() [1/2]

template<typename Real>
virtual std::vector< Real > ROL::ROL::Objective< Real >::checkHessSym ( const Vector< Real > & x,
const Vector< Real > & v,
const Vector< Real > & w,
const bool printToStream = true,
std::ostream & outStream = std::cout )
inlinevirtual

Hessian symmetry check.

This function checks the symmetry of the Hessian by comparing

\[ \langle \nabla^2f(x)v,w\rangle_{\mathcal{X}^*,\mathcal{X}} \quad\text{and}\quad \langle \nabla^2f(x)w,v\rangle_{\mathcal{X}^*,\mathcal{X}}. \]

Parameters
[in]xis an optimization variable.
[in]vis a direction vector.
[in]wis a direction vector.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.

Definition at line 447 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by main().

◆ checkHessSym() [2/2]

template<typename Real>
std::vector< Real > ROL::ROL::Objective< Real >::checkHessSym ( const Vector< Real > & x,
const Vector< Real > & hv,
const Vector< Real > & v,
const Vector< Real > & w,
const bool printToStream = true,
std::ostream & outStream = std::cout )
virtual

Hessian symmetry check.

This function checks the symmetry of the Hessian by comparing

\[ \langle \nabla^2f(x)v,w\rangle_{\mathcal{X}^*,\mathcal{X}} \quad\text{and}\quad \langle \nabla^2f(x)w,v\rangle_{\mathcal{X}^*,\mathcal{X}}. \]

Parameters
[in]xis an optimization variable.
[in]hvis used to create temporary Hessian-times-vector vectors.
[in]vis a direction vector.
[in]wis a direction vector.
[in]printToStreamis a flag that turns on/off output.
[out]outStreamis the output stream.

Definition at line 350 of file ROL_ObjectiveDef.hpp.

References ROL::ROL::Vector< Real >::apply(), ROL::ROL::Vector< Real >::clone(), hessVec(), ROL::ROL::ROL_EPSILON(), ROL::ROL::Temp, and ROL::update().

◆ getParameter()

template<typename Real>
const std::vector< Real > ROL::ROL::Objective< Real >::getParameter ( void ) const
inlineprotected

◆ setParameter()

Member Data Documentation

◆ prim_

template<typename Real>
Ptr<Vector<Real> > ROL::ROL::Objective< Real >::prim_
private

Definition at line 81 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by gradient(), and hessVec().

◆ dual_

template<typename Real>
Ptr<Vector<Real> > ROL::ROL::Objective< Real >::dual_
private

Definition at line 81 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by dirDeriv(), and hessVec().

◆ basis_

template<typename Real>
Ptr<Vector<Real> > ROL::ROL::Objective< Real >::basis_
private

Definition at line 81 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by gradient().

◆ param_

template<typename Real>
std::vector<Real> ROL::ROL::Objective< Real >::param_
private

Definition at line 481 of file ROL_Constraint_SerialSimOpt.hpp.


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