ROL
ROL::Problem< Real > Class Template Reference

#include <ROL_Problem.hpp>

Inheritance diagram for ROL::Problem< Real >:

Public Member Functions

virtual ~Problem ()
 Problem (const Ptr< Objective< Real > > &obj, const Ptr< Vector< Real > > &x, const Ptr< Vector< Real > > &g=nullPtr)
 Default constructor for OptimizationProblem.
 Problem (const Problem &problem)
 Copy constructor for OptimizationProblem.
void addBoundConstraint (const Ptr< BoundConstraint< Real > > &bnd)
 Add a bound constraint.
void removeBoundConstraint ()
 Remove an existing bound constraint.
void addProxObjective (const Ptr< ProxObjective< Real > > &prox)
 Add a prox objective.
void removeProxObjective ()
 Remove an existing prox objective.
void addConstraint (std::string name, const Ptr< Constraint< Real > > &econ, const Ptr< Vector< Real > > &emul, const Ptr< Vector< Real > > &eres=nullPtr, bool reset=false)
 Add an equality constraint.
void addConstraint (std::string name, const Ptr< Constraint< Real > > &icon, const Ptr< Vector< Real > > &imul, const Ptr< BoundConstraint< Real > > &ibnd, const Ptr< Vector< Real > > &ires=nullPtr, bool reset=false)
 Add an inequality constraint.
void removeConstraint (std::string name)
 Remove an existing constraint.
void addLinearConstraint (std::string name, const Ptr< Constraint< Real > > &linear_econ, const Ptr< Vector< Real > > &linear_emul, const Ptr< Vector< Real > > &linear_eres=nullPtr, bool reset=false)
 Add a linear equality constraint.
void addLinearConstraint (std::string name, const Ptr< Constraint< Real > > &linear_icon, const Ptr< Vector< Real > > &linear_imul, const Ptr< BoundConstraint< Real > > &linear_ibnd, const Ptr< Vector< Real > > &linear_ires=nullPtr, bool reset=false)
 Add a linear inequality constraint.
void removeLinearConstraint (std::string name)
 Remove an existing linear constraint.
void setProjectionAlgorithm (ParameterList &parlist)
 Set polyhedral projection algorithm.
const Ptr< Objective< Real > > & getObjective ()
 Get the objective function.
const Ptr< Vector< Real > > & getPrimalOptimizationVector ()
 Get the primal optimization space vector.
const Ptr< Vector< Real > > & getDualOptimizationVector ()
 Get the dual optimization space vector.
const Ptr< BoundConstraint< Real > > & getBoundConstraint ()
 Get the bound constraint.
const Ptr< Constraint< Real > > & getConstraint ()
 Get the equality constraint.
const Ptr< Vector< Real > > & getMultiplierVector ()
 Get the dual constraint space vector.
const Ptr< Vector< Real > > & getResidualVector ()
 Get the primal constraint space vector.
const Ptr< PolyhedralProjection< Real > > & getPolyhedralProjection ()
 Get the polyhedral projection object. This is a null pointer if no linear constraints and/or bounds are present.
EProblem getProblemType ()
 Get the optimization problem type (U, B, E, or G).
Real checkLinearity (bool printToStream=false, std::ostream &outStream=std::cout) const
 Check if user-supplied linear constraints are affine.
void checkVectors (bool printToStream=false, std::ostream &outStream=std::cout) const
 Run vector checks for user-supplied vectors.
void checkDerivatives (bool printToStream=false, std::ostream &outStream=std::cout) const
 Run derivative checks for user-supplied objective function and constraints.
void check (bool printToStream=false, std::ostream &outStream=std::cout) const
 Run vector, linearity and derivative checks for user-supplied vectors, objective function and constraints.
virtual void finalize (bool lumpConstraints=false, bool printToStream=false, std::ostream &outStream=std::cout)
 Tranform user-supplied constraints to consist of only bounds and equalities. Optimization problem cannot be modified after finalize has been called without calling the edit function.
bool isFinalized () const
 Indicate whether or no finalize has been called.
virtual void edit ()
 Resume editting optimization problem after finalize has been called.
void finalizeIteration ()
 Transform the optimization variables to the native parameterization after an optimization algorithm has finished.
virtual ~Problem ()
 Problem (const Ptr< Objective< Real > > &obj, const Ptr< Vector< Real > > &x, const Ptr< Vector< Real > > &g=nullPtr)
 Default constructor for OptimizationProblem.
 Problem (const Problem &problem)
 Copy constructor for OptimizationProblem.
void addBoundConstraint (const Ptr< BoundConstraint< Real > > &bnd)
 Add a bound constraint.
void removeBoundConstraint ()
 Remove an existing bound constraint.
void addConstraint (std::string name, const Ptr< Constraint< Real > > &econ, const Ptr< Vector< Real > > &emul, const Ptr< Vector< Real > > &eres=nullPtr, bool reset=false)
 Add an equality constraint.
void addConstraint (std::string name, const Ptr< Constraint< Real > > &icon, const Ptr< Vector< Real > > &imul, const Ptr< BoundConstraint< Real > > &ibnd, const Ptr< Vector< Real > > &ires=nullPtr, bool reset=false)
 Add an inequality constraint.
void removeConstraint (std::string name)
 Remove an existing constraint.
void addLinearConstraint (std::string name, const Ptr< Constraint< Real > > &linear_econ, const Ptr< Vector< Real > > &linear_emul, const Ptr< Vector< Real > > &linear_eres=nullPtr, bool reset=false)
 Add a linear equality constraint.
void addLinearConstraint (std::string name, const Ptr< Constraint< Real > > &linear_icon, const Ptr< Vector< Real > > &linear_imul, const Ptr< BoundConstraint< Real > > &linear_ibnd, const Ptr< Vector< Real > > &linear_ires=nullPtr, bool reset=false)
 Add a linear inequality constraint.
void removeLinearConstraint (std::string name)
 Remove an existing linear constraint.
void setProjectionAlgorithm (ParameterList &parlist)
 Set polyhedral projection algorithm.
void addProximableObjective (const Ptr< Objective< Real > > &nobj)
void removeProximableObjective ()
const Ptr< Objective< Real > > & getObjective ()
 Get the objective function.
const Ptr< Objective< Real > > & getProximableObjective ()
 Get proximable objective.
const Ptr< Vector< Real > > & getPrimalOptimizationVector ()
 Get the primal optimization space vector.
const Ptr< Vector< Real > > & getDualOptimizationVector ()
 Get the dual optimization space vector.
const Ptr< BoundConstraint< Real > > & getBoundConstraint ()
 Get the bound constraint.
const Ptr< Constraint< Real > > & getConstraint ()
 Get the equality constraint.
const Ptr< Vector< Real > > & getMultiplierVector ()
 Get the dual constraint space vector.
const Ptr< Vector< Real > > & getResidualVector ()
 Get the primal constraint space vector.
const Ptr< PolyhedralProjection< Real > > & getPolyhedralProjection ()
 Get the polyhedral projection object. This is a null pointer if no linear constraints and/or bounds are present.
EProblem getProblemType ()
 Get the optimization problem type (U, B, E, G, or P).
Real checkLinearity (bool printToStream=false, std::ostream &outStream=std::cout) const
 Check if user-supplied linear constraints are affine.
void checkVectors (bool printToStream=false, std::ostream &outStream=std::cout) const
 Run vector checks for user-supplied vectors.
void checkDerivatives (bool printToStream=false, std::ostream &outStream=std::cout, const Ptr< Vector< Real > > &x0=nullPtr, Real scale=Real(1)) const
 Run derivative checks for user-supplied objective function and constraints.
void check (bool printToStream=false, std::ostream &outStream=std::cout, const Ptr< Vector< Real > > &x0=nullPtr, Real scale=Real(1)) const
 Run vector, linearity and derivative checks for user-supplied vectors, objective function and constraints.
virtual void finalize (bool lumpConstraints=false, bool printToStream=false, std::ostream &outStream=std::cout)
 Tranform user-supplied constraints to consist of only bounds and equalities. Optimization problem cannot be modified after finalize has been called without calling the edit function.
bool isFinalized () const
 Indicate whether or no finalize has been called.
virtual void edit ()
 Resume editting optimization problem after finalize has been called.
void finalizeIteration ()
 Transform the optimization variables to the native parameterization after an optimization algorithm has finished.

Protected Attributes

Ptr< Objective< Real > > INPUT_obj_
Ptr< Vector< Real > > INPUT_xprim_
Ptr< Vector< Real > > INPUT_xdual_
Ptr< BoundConstraint< Real > > INPUT_bnd_
std::unordered_map< std::string, ConstraintData< Real > > INPUT_con_
std::unordered_map< std::string, ConstraintData< Real > > INPUT_linear_con_
Ptr< ProxObjective< Real > > INPUT_prox_
Ptr< Objective< Real > > INPUT_nobj_

Private Attributes

bool isFinalized_
bool hasBounds_
bool hasEquality_
bool hasInequality_
bool hasLinearEquality_
bool hasLinearInequality_
bool hasProx_
unsigned cnt_econ_
unsigned cnt_icon_
unsigned cnt_linear_econ_
unsigned cnt_linear_icon_
ParameterList ppa_list_
Ptr< Objective< Real > > obj_
Ptr< Vector< Real > > xprim_
Ptr< Vector< Real > > xdual_
Ptr< BoundConstraint< Real > > bnd_
Ptr< Constraint< Real > > con_
Ptr< Vector< Real > > mul_
Ptr< Vector< Real > > res_
Ptr< PolyhedralProjection< Real > > proj_
Ptr< ProxObjective< Real > > prox_
Ptr< Vector< Real > > xfeas_
Ptr< ReduceLinearConstraint< Real > > rlc_
EProblem problemType_
bool hasProximableObjective_
Ptr< Objective< Real > > nobj_

Detailed Description

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

Definition at line 27 of file function/prox/ROL_Problem.hpp.

Constructor & Destructor Documentation

◆ ~Problem() [1/2]

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

Definition at line 69 of file function/prox/ROL_Problem.hpp.

◆ Problem() [1/4]

template<typename Real>
ROL::Problem< Real >::Problem ( const Ptr< Objective< Real > > & obj,
const Ptr< Vector< Real > > & x,
const Ptr< Vector< Real > > & g = nullPtr )

◆ Problem() [2/4]

template<typename Real>
ROL::Problem< Real >::Problem ( const Problem< Real > & problem)
inline

◆ ~Problem() [2/2]

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

Definition at line 68 of file algorithm/ROL_Problem.hpp.

◆ Problem() [3/4]

template<typename Real>
ROL::Problem< Real >::Problem ( const Ptr< Objective< Real > > & obj,
const Ptr< Vector< Real > > & x,
const Ptr< Vector< Real > > & g = nullPtr )

Default constructor for OptimizationProblem.

Parameters
[in]objobjective function object
[in]xprimal optimization space vector
[in]gdual optimization space vector

◆ Problem() [4/4]

template<typename Real>
ROL::Problem< Real >::Problem ( const Problem< Real > & problem)
inline

Member Function Documentation

◆ addBoundConstraint() [1/2]

◆ removeBoundConstraint() [1/2]

template<typename Real>
void ROL::Problem< Real >::removeBoundConstraint ( )

Remove an existing bound constraint.

Definition at line 47 of file function/prox/ROL_Problem_Def.hpp.

References hasBounds_, INPUT_bnd_, and isFinalized_.

◆ addProxObjective()

template<typename Real>
void ROL::Problem< Real >::addProxObjective ( const Ptr< ProxObjective< Real > > & prox)

Add a prox objective.

Parameters
[in]proxprox objective object

Definition at line 56 of file function/prox/ROL_Problem_Def.hpp.

References hasProx_, INPUT_prox_, and isFinalized_.

◆ removeProxObjective()

template<typename Real>
void ROL::Problem< Real >::removeProxObjective ( )

Remove an existing prox objective.

Definition at line 65 of file function/prox/ROL_Problem_Def.hpp.

References hasProx_, INPUT_prox_, and isFinalized_.

◆ addConstraint() [1/4]

template<typename Real>
void ROL::Problem< Real >::addConstraint ( std::string name,
const Ptr< Constraint< Real > > & econ,
const Ptr< Vector< Real > > & emul,
const Ptr< Vector< Real > > & eres = nullPtr,
bool reset = false )

◆ addConstraint() [2/4]

template<typename Real>
void ROL::Problem< Real >::addConstraint ( std::string name,
const Ptr< Constraint< Real > > & icon,
const Ptr< Vector< Real > > & imul,
const Ptr< BoundConstraint< Real > > & ibnd,
const Ptr< Vector< Real > > & ires = nullPtr,
bool reset = false )

Add an inequality constraint.

Parameters
[in]namethe unique constraint identifier
[in]iconconstraint object
[in]imuldual constraint space vector
[in]ibndbound constraint
[in]iresprimal constraint space vector
[in]resetwhether or not to clear constraint container

Definition at line 94 of file function/prox/ROL_Problem_Def.hpp.

References cnt_icon_, hasInequality_, INPUT_con_, and isFinalized_.

◆ removeConstraint() [1/2]

template<typename Real>
void ROL::Problem< Real >::removeConstraint ( std::string name)

◆ addLinearConstraint() [1/4]

template<typename Real>
void ROL::Problem< Real >::addLinearConstraint ( std::string name,
const Ptr< Constraint< Real > > & linear_econ,
const Ptr< Vector< Real > > & linear_emul,
const Ptr< Vector< Real > > & linear_eres = nullPtr,
bool reset = false )

◆ addLinearConstraint() [2/4]

template<typename Real>
void ROL::Problem< Real >::addLinearConstraint ( std::string name,
const Ptr< Constraint< Real > > & linear_icon,
const Ptr< Vector< Real > > & linear_imul,
const Ptr< BoundConstraint< Real > > & linear_ibnd,
const Ptr< Vector< Real > > & linear_ires = nullPtr,
bool reset = false )

Add a linear inequality constraint.

Parameters
[in]namethe unique constraint identifier
[in]linear_iconconstraint object
[in]linear_imuldual constraint space vector
[in]linear_ibndbound constraint
[in]linear_iresprimal constraint space vector
[in]resetwhether or not to clear linear constraint container

Definition at line 150 of file function/prox/ROL_Problem_Def.hpp.

References cnt_linear_icon_, hasLinearInequality_, INPUT_linear_con_, and isFinalized_.

◆ removeLinearConstraint() [1/2]

template<typename Real>
void ROL::Problem< Real >::removeLinearConstraint ( std::string name)

◆ setProjectionAlgorithm() [1/2]

template<typename Real>
void ROL::Problem< Real >::setProjectionAlgorithm ( ParameterList & parlist)

Set polyhedral projection algorithm.

Parameters
[in]ppapolyhedral projection algorithm

Definition at line 186 of file function/prox/ROL_Problem_Def.hpp.

References isFinalized_, and ppa_list_.

Referenced by ROL::TypeG::StabilizedLCLAlgorithm< Real >::run().

◆ getObjective() [1/2]

◆ getPrimalOptimizationVector() [1/2]

template<typename Real>
const Ptr< Vector< Real > > & ROL::Problem< Real >::getPrimalOptimizationVector ( )

◆ getDualOptimizationVector() [1/2]

template<typename Real>
const Ptr< Vector< Real > > & ROL::Problem< Real >::getDualOptimizationVector ( )

◆ getBoundConstraint() [1/2]

template<typename Real>
const Ptr< BoundConstraint< Real > > & ROL::Problem< Real >::getBoundConstraint ( )

◆ getConstraint() [1/2]

template<typename Real>
const Ptr< Constraint< Real > > & ROL::Problem< Real >::getConstraint ( )

◆ getMultiplierVector() [1/2]

template<typename Real>
const Ptr< Vector< Real > > & ROL::Problem< Real >::getMultiplierVector ( )

◆ getResidualVector() [1/2]

template<typename Real>
const Ptr< Vector< Real > > & ROL::Problem< Real >::getResidualVector ( )

◆ getPolyhedralProjection() [1/2]

template<typename Real>
const Ptr< PolyhedralProjection< Real > > & ROL::Problem< Real >::getPolyhedralProjection ( )

◆ getProblemType() [1/2]

◆ checkLinearity() [1/2]

template<typename Real>
Real ROL::Problem< Real >::checkLinearity ( bool printToStream = false,
std::ostream & outStream = std::cout ) const

Check if user-supplied linear constraints are affine.

This function computes the error

\[ \|c(x+\alpha y) - (c(x)+\alpha (c(y)-c(0)))\| \]

for each user-supplied linear constraint and returns the maximum.

Parameters
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

Definition at line 495 of file function/prox/ROL_Problem_Def.hpp.

References INPUT_linear_con_, INPUT_xprim_, ROL::ROL_EPSILON(), and ROL::Temp.

Referenced by check(), and check().

◆ checkVectors() [1/2]

template<typename Real>
void ROL::Problem< Real >::checkVectors ( bool printToStream = false,
std::ostream & outStream = std::cout ) const

Run vector checks for user-supplied vectors.

Parameters
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

Definition at line 544 of file function/prox/ROL_Problem_Def.hpp.

References INPUT_con_, INPUT_linear_con_, INPUT_xdual_, and INPUT_xprim_.

Referenced by check(), and check().

◆ checkDerivatives() [1/2]

template<typename Real>
void ROL::Problem< Real >::checkDerivatives ( bool printToStream = false,
std::ostream & outStream = std::cout ) const

Run derivative checks for user-supplied objective function and constraints.

Parameters
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

Definition at line 603 of file function/prox/ROL_Problem_Def.hpp.

References INPUT_con_, INPUT_linear_con_, INPUT_obj_, INPUT_xdual_, and INPUT_xprim_.

Referenced by check(), check(), and checkDerivatives().

◆ check() [1/2]

template<typename Real>
void ROL::Problem< Real >::check ( bool printToStream = false,
std::ostream & outStream = std::cout ) const

Run vector, linearity and derivative checks for user-supplied vectors, objective function and constraints.

Parameters
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

Definition at line 644 of file function/prox/ROL_Problem_Def.hpp.

References checkDerivatives(), checkLinearity(), checkVectors(), hasLinearEquality_, and hasLinearInequality_.

Referenced by check(), ROL::TypeE::StabilizedLCLAlgorithm< Real >::run(), and ROL::TypeG::StabilizedLCLAlgorithm< Real >::run().

◆ finalize() [1/2]

template<typename Real>
void ROL::Problem< Real >::finalize ( bool lumpConstraints = false,
bool printToStream = false,
std::ostream & outStream = std::cout )
virtual

Tranform user-supplied constraints to consist of only bounds and equalities. Optimization problem cannot be modified after finalize has been called without calling the edit function.

Parameters
[in]lumpConstraintscombine both linear and nonlinear constraints
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

Reimplemented in ROL::StochasticProblem< Real >.

Definition at line 194 of file function/prox/ROL_Problem_Def.hpp.

References bnd_, cnt_econ_, cnt_icon_, cnt_linear_econ_, cnt_linear_icon_, con_, ROL::ConstraintAssembler< Real >::getBoundConstraint(), ROL::ConstraintAssembler< Real >::getConstraint(), ROL::ConstraintAssembler< Real >::getDualOptVector(), ROL::ConstraintAssembler< Real >::getLinearConstraint(), ROL::ConstraintAssembler< Real >::getLinearMultiplier(), ROL::ConstraintAssembler< Real >::getLinearResidual(), ROL::ConstraintAssembler< Real >::getMultiplier(), ROL::ConstraintAssembler< Real >::getOptVector(), ROL::ConstraintAssembler< Real >::getResidual(), hasBounds_, hasEquality_, ROL::ConstraintAssembler< Real >::hasInequality(), hasInequality_, hasLinearEquality_, hasLinearInequality_, hasProx_, INPUT_bnd_, INPUT_con_, INPUT_linear_con_, INPUT_obj_, INPUT_prox_, INPUT_xdual_, INPUT_xprim_, isFinalized_, mul_, obj_, ROL::PolyhedralProjectionFactory(), ppa_list_, problemType_, proj_, prox_, res_, rlc_, ROL::TYPE_B, ROL::TYPE_E, ROL::TYPE_EB, ROL::TYPE_U, xdual_, xfeas_, and xprim_.

Referenced by ROL::StochasticProblem< Real >::finalize(), getBoundConstraint(), getConstraint(), getDualOptimizationVector(), getMultiplierVector(), getObjective(), getPolyhedralProjection(), getPrimalOptimizationVector(), getProblemType(), getProximableObjective(), getResidualVector(), ROL::TypeB::Algorithm< Real >::run(), ROL::TypeB::Algorithm< Real >::run(), ROL::TypeE::StabilizedLCLAlgorithm< Real >::run(), ROL::TypeE::StabilizedLCLAlgorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::Algorithm< Real >::run(), ROL::TypeG::StabilizedLCLAlgorithm< Real >::run(), and ROL::TypeG::StabilizedLCLAlgorithm< Real >::run().

◆ isFinalized() [1/2]

◆ edit() [1/2]

template<typename Real>
void ROL::Problem< Real >::edit ( void )
virtual

Resume editting optimization problem after finalize has been called.

Reimplemented in ROL::StochasticProblem< Real >.

Definition at line 658 of file function/prox/ROL_Problem_Def.hpp.

References isFinalized_, proj_, and rlc_.

Referenced by ROL::StochasticProblem< Real >::edit(), ROL::TypeE::StabilizedLCLAlgorithm< Real >::run(), and ROL::TypeG::StabilizedLCLAlgorithm< Real >::run().

◆ finalizeIteration() [1/2]

template<typename Real>
void ROL::Problem< Real >::finalizeIteration ( )

◆ addBoundConstraint() [2/2]

template<typename Real>
void ROL::Problem< Real >::addBoundConstraint ( const Ptr< BoundConstraint< Real > > & bnd)

Add a bound constraint.

Parameters
[in]bndbound constraint object

◆ removeBoundConstraint() [2/2]

template<typename Real>
void ROL::Problem< Real >::removeBoundConstraint ( )

Remove an existing bound constraint.

◆ addConstraint() [3/4]

template<typename Real>
void ROL::Problem< Real >::addConstraint ( std::string name,
const Ptr< Constraint< Real > > & econ,
const Ptr< Vector< Real > > & emul,
const Ptr< Vector< Real > > & eres = nullPtr,
bool reset = false )

Add an equality constraint.

Parameters
[in]namethe unique constraint identifier
[in]econconstraint object
[in]emuldual constraint space vector
[in]eresprimal constraint space vector
[in]resetwhether or not to clear constraint container

◆ addConstraint() [4/4]

template<typename Real>
void ROL::Problem< Real >::addConstraint ( std::string name,
const Ptr< Constraint< Real > > & icon,
const Ptr< Vector< Real > > & imul,
const Ptr< BoundConstraint< Real > > & ibnd,
const Ptr< Vector< Real > > & ires = nullPtr,
bool reset = false )

Add an inequality constraint.

Parameters
[in]namethe unique constraint identifier
[in]iconconstraint object
[in]imuldual constraint space vector
[in]ibndbound constraint
[in]iresprimal constraint space vector
[in]resetwhether or not to clear constraint container

◆ removeConstraint() [2/2]

template<typename Real>
void ROL::Problem< Real >::removeConstraint ( std::string name)

Remove an existing constraint.

Parameters
[in]namethe unique constraint identifier

◆ addLinearConstraint() [3/4]

template<typename Real>
void ROL::Problem< Real >::addLinearConstraint ( std::string name,
const Ptr< Constraint< Real > > & linear_econ,
const Ptr< Vector< Real > > & linear_emul,
const Ptr< Vector< Real > > & linear_eres = nullPtr,
bool reset = false )

Add a linear equality constraint.

Parameters
[in]namethe unique constraint identifier
[in]linear_econconstraint object
[in]linear_emuldual constraint space vector
[in]linear_eresprimal constraint space vector
[in]resetwhether or not to clear linear constraint container

◆ addLinearConstraint() [4/4]

template<typename Real>
void ROL::Problem< Real >::addLinearConstraint ( std::string name,
const Ptr< Constraint< Real > > & linear_icon,
const Ptr< Vector< Real > > & linear_imul,
const Ptr< BoundConstraint< Real > > & linear_ibnd,
const Ptr< Vector< Real > > & linear_ires = nullPtr,
bool reset = false )

Add a linear inequality constraint.

Parameters
[in]namethe unique constraint identifier
[in]linear_iconconstraint object
[in]linear_imuldual constraint space vector
[in]linear_ibndbound constraint
[in]linear_iresprimal constraint space vector
[in]resetwhether or not to clear linear constraint container

◆ removeLinearConstraint() [2/2]

template<typename Real>
void ROL::Problem< Real >::removeLinearConstraint ( std::string name)

Remove an existing linear constraint.

Parameters
[in]namethe unique constraint identifier

◆ setProjectionAlgorithm() [2/2]

template<typename Real>
void ROL::Problem< Real >::setProjectionAlgorithm ( ParameterList & parlist)

Set polyhedral projection algorithm.

Parameters
[in]ppapolyhedral projection algorithm

◆ addProximableObjective()

template<typename Real>
void ROL::Problem< Real >::addProximableObjective ( const Ptr< Objective< Real > > & nobj)

Set Proximable objective function

Definition at line 58 of file algorithm/ROL_Problem_Def.hpp.

References addProximableObjective(), hasProximableObjective_, INPUT_nobj_, and isFinalized_.

Referenced by addProximableObjective().

◆ removeProximableObjective()

template<typename Real>
void ROL::Problem< Real >::removeProximableObjective ( )

Remove Proximable objective function

Definition at line 67 of file algorithm/ROL_Problem_Def.hpp.

References hasProximableObjective_, INPUT_nobj_, isFinalized_, and removeProximableObjective().

Referenced by removeProximableObjective().

◆ getObjective() [2/2]

template<typename Real>
const Ptr< Objective< Real > > & ROL::Problem< Real >::getObjective ( )

Get the objective function.

◆ getProximableObjective()

template<typename Real>
const Ptr< Objective< Real > > & ROL::Problem< Real >::getProximableObjective ( )

Get proximable objective.

Definition at line 455 of file algorithm/ROL_Problem_Def.hpp.

References finalize(), getProximableObjective(), and nobj_.

Referenced by getProximableObjective(), and ROL::TypeP::Algorithm< Real >::run().

◆ getPrimalOptimizationVector() [2/2]

template<typename Real>
const Ptr< Vector< Real > > & ROL::Problem< Real >::getPrimalOptimizationVector ( )

Get the primal optimization space vector.

◆ getDualOptimizationVector() [2/2]

template<typename Real>
const Ptr< Vector< Real > > & ROL::Problem< Real >::getDualOptimizationVector ( )

Get the dual optimization space vector.

◆ getBoundConstraint() [2/2]

template<typename Real>
const Ptr< BoundConstraint< Real > > & ROL::Problem< Real >::getBoundConstraint ( )

Get the bound constraint.

◆ getConstraint() [2/2]

template<typename Real>
const Ptr< Constraint< Real > > & ROL::Problem< Real >::getConstraint ( )

Get the equality constraint.

◆ getMultiplierVector() [2/2]

template<typename Real>
const Ptr< Vector< Real > > & ROL::Problem< Real >::getMultiplierVector ( )

Get the dual constraint space vector.

◆ getResidualVector() [2/2]

template<typename Real>
const Ptr< Vector< Real > > & ROL::Problem< Real >::getResidualVector ( )

Get the primal constraint space vector.

◆ getPolyhedralProjection() [2/2]

template<typename Real>
const Ptr< PolyhedralProjection< Real > > & ROL::Problem< Real >::getPolyhedralProjection ( )

Get the polyhedral projection object. This is a null pointer if no linear constraints and/or bounds are present.

◆ getProblemType() [2/2]

template<typename Real>
EProblem ROL::Problem< Real >::getProblemType ( )

Get the optimization problem type (U, B, E, G, or P).

◆ checkLinearity() [2/2]

template<typename Real>
Real ROL::Problem< Real >::checkLinearity ( bool printToStream = false,
std::ostream & outStream = std::cout ) const

Check if user-supplied linear constraints are affine.

This function computes the error

\[ \|c(x+\alpha y) - (c(x)+\alpha (c(y)-c(0)))\| \]

for each user-supplied linear constraint and returns the maximum.

Parameters
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

◆ checkVectors() [2/2]

template<typename Real>
void ROL::Problem< Real >::checkVectors ( bool printToStream = false,
std::ostream & outStream = std::cout ) const

Run vector checks for user-supplied vectors.

Parameters
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

◆ checkDerivatives() [2/2]

template<typename Real>
void ROL::Problem< Real >::checkDerivatives ( bool printToStream = false,
std::ostream & outStream = std::cout,
const Ptr< Vector< Real > > & x0 = nullPtr,
Real scale = Real(1) ) const

Run derivative checks for user-supplied objective function and constraints.

Parameters
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

Definition at line 617 of file algorithm/ROL_Problem_Def.hpp.

References checkDerivatives(), INPUT_con_, INPUT_linear_con_, INPUT_obj_, INPUT_xdual_, and INPUT_xprim_.

◆ check() [2/2]

template<typename Real>
void ROL::Problem< Real >::check ( bool printToStream = false,
std::ostream & outStream = std::cout,
const Ptr< Vector< Real > > & x0 = nullPtr,
Real scale = Real(1) ) const

Run vector, linearity and derivative checks for user-supplied vectors, objective function and constraints.

Parameters
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

Definition at line 656 of file algorithm/ROL_Problem_Def.hpp.

References check(), checkDerivatives(), checkLinearity(), checkVectors(), hasLinearEquality_, and hasLinearInequality_.

◆ finalize() [2/2]

template<typename Real>
virtual void ROL::Problem< Real >::finalize ( bool lumpConstraints = false,
bool printToStream = false,
std::ostream & outStream = std::cout )
virtual

Tranform user-supplied constraints to consist of only bounds and equalities. Optimization problem cannot be modified after finalize has been called without calling the edit function.

Parameters
[in]lumpConstraintscombine both linear and nonlinear constraints
[in]printToStreamdetermines whether to print to the supplied std::ostream
[in,out]outStreamuser supplied std::ostream

Reimplemented in ROL::StochasticProblem< Real >.

◆ isFinalized() [2/2]

template<typename Real>
bool ROL::Problem< Real >::isFinalized ( ) const

Indicate whether or no finalize has been called.

◆ edit() [2/2]

template<typename Real>
virtual void ROL::Problem< Real >::edit ( )
virtual

Resume editting optimization problem after finalize has been called.

Reimplemented in ROL::StochasticProblem< Real >.

◆ finalizeIteration() [2/2]

template<typename Real>
void ROL::Problem< Real >::finalizeIteration ( )

Transform the optimization variables to the native parameterization after an optimization algorithm has finished.

Member Data Documentation

◆ isFinalized_

◆ hasBounds_

template<typename Real>
bool ROL::Problem< Real >::hasBounds_
private

◆ hasEquality_

template<typename Real>
bool ROL::Problem< Real >::hasEquality_
private

◆ hasInequality_

template<typename Real>
bool ROL::Problem< Real >::hasInequality_
private

◆ hasLinearEquality_

template<typename Real>
bool ROL::Problem< Real >::hasLinearEquality_
private

◆ hasLinearInequality_

template<typename Real>
bool ROL::Problem< Real >::hasLinearInequality_
private

◆ hasProx_

template<typename Real>
bool ROL::Problem< Real >::hasProx_
private

Definition at line 35 of file function/prox/ROL_Problem.hpp.

Referenced by addProxObjective(), finalize(), and removeProxObjective().

◆ cnt_econ_

template<typename Real>
unsigned ROL::Problem< Real >::cnt_econ_
private

◆ cnt_icon_

template<typename Real>
unsigned ROL::Problem< Real >::cnt_icon_
private

◆ cnt_linear_econ_

template<typename Real>
unsigned ROL::Problem< Real >::cnt_linear_econ_
private

◆ cnt_linear_icon_

template<typename Real>
unsigned ROL::Problem< Real >::cnt_linear_icon_
private

◆ ppa_list_

template<typename Real>
ParameterList ROL::Problem< Real >::ppa_list_
private

Definition at line 41 of file function/prox/ROL_Problem.hpp.

Referenced by finalize(), Problem(), and setProjectionAlgorithm().

◆ obj_

template<typename Real>
Ptr< Objective< Real > > ROL::Problem< Real >::obj_
private

Definition at line 43 of file function/prox/ROL_Problem.hpp.

Referenced by finalize(), getObjective(), and Problem().

◆ xprim_

template<typename Real>
Ptr< Vector< Real > > ROL::Problem< Real >::xprim_
private

◆ xdual_

template<typename Real>
Ptr< Vector< Real > > ROL::Problem< Real >::xdual_
private

Definition at line 45 of file function/prox/ROL_Problem.hpp.

Referenced by finalize(), getDualOptimizationVector(), and Problem().

◆ bnd_

template<typename Real>
Ptr< BoundConstraint< Real > > ROL::Problem< Real >::bnd_
private

Definition at line 46 of file function/prox/ROL_Problem.hpp.

Referenced by finalize(), getBoundConstraint(), and Problem().

◆ con_

template<typename Real>
Ptr< Constraint< Real > > ROL::Problem< Real >::con_
private

Definition at line 47 of file function/prox/ROL_Problem.hpp.

Referenced by finalize(), getConstraint(), and Problem().

◆ mul_

template<typename Real>
Ptr< Vector< Real > > ROL::Problem< Real >::mul_
private

Definition at line 48 of file function/prox/ROL_Problem.hpp.

Referenced by finalize(), getMultiplierVector(), and Problem().

◆ res_

template<typename Real>
Ptr< Vector< Real > > ROL::Problem< Real >::res_
private

Definition at line 49 of file function/prox/ROL_Problem.hpp.

Referenced by finalize(), getResidualVector(), and Problem().

◆ proj_

template<typename Real>
Ptr< PolyhedralProjection< Real > > ROL::Problem< Real >::proj_
private

Definition at line 50 of file function/prox/ROL_Problem.hpp.

Referenced by edit(), finalize(), getPolyhedralProjection(), and Problem().

◆ prox_

template<typename Real>
Ptr<ProxObjective<Real> > ROL::Problem< Real >::prox_
private

Definition at line 51 of file function/prox/ROL_Problem.hpp.

Referenced by finalize().

◆ xfeas_

template<typename Real>
Ptr< Vector< Real > > ROL::Problem< Real >::xfeas_
private

Definition at line 53 of file function/prox/ROL_Problem.hpp.

Referenced by finalize().

◆ rlc_

template<typename Real>
Ptr< ReduceLinearConstraint< Real > > ROL::Problem< Real >::rlc_
private

Definition at line 54 of file function/prox/ROL_Problem.hpp.

Referenced by edit(), finalize(), and finalizeIteration().

◆ problemType_

template<typename Real>
EProblem ROL::Problem< Real >::problemType_
private

Definition at line 56 of file function/prox/ROL_Problem.hpp.

Referenced by finalize(), getProblemType(), and Problem().

◆ INPUT_obj_

◆ INPUT_xprim_

◆ INPUT_xdual_

◆ INPUT_bnd_

◆ INPUT_con_

◆ INPUT_linear_con_

◆ INPUT_prox_

template<typename Real>
Ptr<ProxObjective<Real> > ROL::Problem< Real >::INPUT_prox_
protected

Definition at line 66 of file function/prox/ROL_Problem.hpp.

Referenced by addProxObjective(), finalize(), and removeProxObjective().

◆ hasProximableObjective_

template<typename Real>
bool ROL::Problem< Real >::hasProximableObjective_
private

◆ nobj_

template<typename Real>
Ptr<Objective<Real> > ROL::Problem< Real >::nobj_
private

Definition at line 43 of file algorithm/ROL_Problem.hpp.

Referenced by getProximableObjective().

◆ INPUT_nobj_

template<typename Real>
Ptr<Objective<Real> > ROL::Problem< Real >::INPUT_nobj_
protected

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