ROL
Public Member Functions | Private Attributes | List of all members
ROL::StochasticProblem< Real > Class Template Reference

#include <ROL_StochasticProblem.hpp>

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

Public Member Functions

 StochasticProblem (const Ptr< Objective< Real >> &obj, const Ptr< Vector< Real >> &x, const Ptr< Vector< Real >> &g=nullPtr)
 Default constructor for StochasticProblem. More...
 
 StochasticProblem (const Problem< Real > &problem)
 
void makeObjectiveStochastic (ParameterList &list, const Ptr< SampleGenerator< Real >> &fsampler, const Ptr< SampleGenerator< Real >> &gsampler=nullPtr, const Ptr< SampleGenerator< Real >> &hsampler=nullPtr)
 
void makeObjectiveStochastic (const Ptr< RandVarFunctional< Real >> &rvf, ParameterList &list, const Ptr< SampleGenerator< Real >> &fsampler, const Ptr< SampleGenerator< Real >> &gsampler=nullPtr, const Ptr< SampleGenerator< Real >> &hsampler=nullPtr)
 
void makeConstraintStochastic (std::string name, ParameterList &list, const Ptr< SampleGenerator< Real >> &sampler, const Ptr< BatchManager< Real >> &bman=nullPtr)
 
void makeLinearConstraintStochastic (std::string name, ParameterList &list, const Ptr< SampleGenerator< Real >> &sampler, const Ptr< BatchManager< Real >> &bman=nullPtr)
 
void resetStochasticObjective (void)
 
void resetStochasticConstraint (std::string name)
 
void resetStochasticLinearConstraint (std::string name)
 
void resetStochastic (void)
 
std::vector< Real > getObjectiveStatistic (void) const
 
std::vector< Real > getConstraintStatistic (std::string name) const
 
Real getSolutionStatistic (int comp=0, std::string name="") const
 
void finalize (bool lumpConstraints=false, bool printToStream=false, std::ostream &outStream=std::cout) override
 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. More...
 
void edit (void) override
 Resume editting optimization problem after finalize has been called. More...
 
- Public Member Functions inherited from ROL::Problem< Real >
virtual ~Problem ()
 
 Problem (const Ptr< Objective< Real >> &obj, const Ptr< Vector< Real >> &x, const Ptr< Vector< Real >> &g=nullPtr)
 Default constructor for OptimizationProblem. More...
 
 Problem (const Problem &problem)
 Copy constructor for OptimizationProblem. More...
 
void addBoundConstraint (const Ptr< BoundConstraint< Real >> &bnd)
 Add a bound constraint. More...
 
void removeBoundConstraint ()
 Remove an existing bound constraint. More...
 
void addProxObjective (const Ptr< ProxObjective< Real >> &prox)
 Add a prox objective. More...
 
void removeProxObjective ()
 Remove an existing prox objective. More...
 
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. More...
 
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. More...
 
void removeConstraint (std::string name)
 Remove an existing constraint. More...
 
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. More...
 
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. More...
 
void removeLinearConstraint (std::string name)
 Remove an existing linear constraint. More...
 
void setProjectionAlgorithm (ParameterList &parlist)
 Set polyhedral projection algorithm. More...
 
const Ptr< Objective< Real > > & getObjective ()
 Get the objective function. More...
 
const Ptr< Vector< Real > > & getPrimalOptimizationVector ()
 Get the primal optimization space vector. More...
 
const Ptr< Vector< Real > > & getDualOptimizationVector ()
 Get the dual optimization space vector. More...
 
const Ptr< BoundConstraint
< Real > > & 
getBoundConstraint ()
 Get the bound constraint. More...
 
const Ptr< Constraint< Real > > & getConstraint ()
 Get the equality constraint. More...
 
const Ptr< Vector< Real > > & getMultiplierVector ()
 Get the dual constraint space vector. More...
 
const Ptr< Vector< Real > > & getResidualVector ()
 Get the primal constraint space vector. More...
 
const Ptr
< PolyhedralProjection< Real > > & 
getPolyhedralProjection ()
 Get the polyhedral projection object. This is a null pointer if no linear constraints and/or bounds are present. More...
 
EProblem getProblemType ()
 Get the optimization problem type (U, B, E, or G). More...
 
Real checkLinearity (bool printToStream=false, std::ostream &outStream=std::cout) const
 Check if user-supplied linear constraints are affine. More...
 
void checkVectors (bool printToStream=false, std::ostream &outStream=std::cout) const
 Run vector checks for user-supplied vectors. More...
 
void checkDerivatives (bool printToStream=false, std::ostream &outStream=std::cout) const
 Run derivative checks for user-supplied objective function and constraints. More...
 
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. More...
 
bool isFinalized () const
 Indicate whether or no finalize has been called. More...
 
void finalizeIteration ()
 Transform the optimization variables to the native parameterization after an optimization algorithm has finished. More...
 
virtual ~Problem ()
 
 Problem (const Ptr< Objective< Real >> &obj, const Ptr< Vector< Real >> &x, const Ptr< Vector< Real >> &g=nullPtr)
 Default constructor for OptimizationProblem. More...
 
 Problem (const Problem &problem)
 Copy constructor for OptimizationProblem. More...
 
void addBoundConstraint (const Ptr< BoundConstraint< Real >> &bnd)
 Add a bound constraint. More...
 
void removeBoundConstraint ()
 Remove an existing bound constraint. More...
 
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. More...
 
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. More...
 
void removeConstraint (std::string name)
 Remove an existing constraint. More...
 
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. More...
 
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. More...
 
void removeLinearConstraint (std::string name)
 Remove an existing linear constraint. More...
 
void setProjectionAlgorithm (ParameterList &parlist)
 Set polyhedral projection algorithm. More...
 
const Ptr< Objective< Real > > & getObjective ()
 Get the objective function. More...
 
const Ptr< Vector< Real > > & getPrimalOptimizationVector ()
 Get the primal optimization space vector. More...
 
const Ptr< Vector< Real > > & getDualOptimizationVector ()
 Get the dual optimization space vector. More...
 
const Ptr< BoundConstraint
< Real > > & 
getBoundConstraint ()
 Get the bound constraint. More...
 
const Ptr< Constraint< Real > > & getConstraint ()
 Get the equality constraint. More...
 
const Ptr< Vector< Real > > & getMultiplierVector ()
 Get the dual constraint space vector. More...
 
const Ptr< Vector< Real > > & getResidualVector ()
 Get the primal constraint space vector. More...
 
const Ptr
< PolyhedralProjection< Real > > & 
getPolyhedralProjection ()
 Get the polyhedral projection object. This is a null pointer if no linear constraints and/or bounds are present. More...
 
EProblem getProblemType ()
 Get the optimization problem type (U, B, E, or G). More...
 
Real checkLinearity (bool printToStream=false, std::ostream &outStream=std::cout) const
 Check if user-supplied linear constraints are affine. More...
 
void checkVectors (bool printToStream=false, std::ostream &outStream=std::cout) const
 Run vector checks for user-supplied vectors. More...
 
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. More...
 
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. More...
 
bool isFinalized () const
 Indicate whether or no finalize has been called. More...
 
void finalizeIteration ()
 Transform the optimization variables to the native parameterization after an optimization algorithm has finished. More...
 

Private Attributes

Ptr< Objective< Real > > ORIGINAL_obj_
 
Ptr< Vector< Real > > ORIGINAL_xprim_
 
Ptr< Vector< Real > > ORIGINAL_xdual_
 
Ptr< BoundConstraint< Real > > ORIGINAL_bnd_
 
std::unordered_map
< std::string, ConstraintData
< Real > > 
ORIGINAL_con_
 
std::unordered_map
< std::string, ConstraintData
< Real > > 
ORIGINAL_linear_con_
 
bool needRiskLessObj_
 
bool risk_
 
std::vector< bool > needRiskLessCon_
 
Ptr< ParameterList > objList_
 
std::unordered_map
< std::string, std::pair< Ptr
< ParameterList >, bool > > 
conList_
 
std::unordered_map
< std::string, size_t > 
statMap_
 

Additional Inherited Members

- Protected Attributes inherited from ROL::Problem< Real >
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_
 

Detailed Description

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

Definition at line 67 of file ROL_StochasticProblem.hpp.

Constructor & Destructor Documentation

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

Default constructor for StochasticProblem.

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

Definition at line 50 of file ROL_StochasticProblem_Def.hpp.

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

Definition at line 101 of file ROL_StochasticProblem.hpp.

Member Function Documentation

template<typename Real >
void ROL::StochasticProblem< Real >::makeObjectiveStochastic ( ParameterList &  list,
const Ptr< SampleGenerator< Real >> &  fsampler,
const Ptr< SampleGenerator< Real >> &  gsampler = nullPtr,
const Ptr< SampleGenerator< Real >> &  hsampler = nullPtr 
)

Definition at line 56 of file ROL_StochasticProblem_Def.hpp.

template<typename Real >
void ROL::StochasticProblem< Real >::makeObjectiveStochastic ( const Ptr< RandVarFunctional< Real >> &  rvf,
ParameterList &  list,
const Ptr< SampleGenerator< Real >> &  fsampler,
const Ptr< SampleGenerator< Real >> &  gsampler = nullPtr,
const Ptr< SampleGenerator< Real >> &  hsampler = nullPtr 
)

Definition at line 99 of file ROL_StochasticProblem_Def.hpp.

template<typename Real >
void ROL::StochasticProblem< Real >::makeConstraintStochastic ( std::string  name,
ParameterList &  list,
const Ptr< SampleGenerator< Real >> &  sampler,
const Ptr< BatchManager< Real >> &  bman = nullPtr 
)
template<typename Real >
void ROL::StochasticProblem< Real >::makeLinearConstraintStochastic ( std::string  name,
ParameterList &  list,
const Ptr< SampleGenerator< Real >> &  sampler,
const Ptr< BatchManager< Real >> &  bman = nullPtr 
)
template<typename Real >
void ROL::StochasticProblem< Real >::resetStochasticObjective ( void  )

Definition at line 248 of file ROL_StochasticProblem_Def.hpp.

template<typename Real >
void ROL::StochasticProblem< Real >::resetStochasticConstraint ( std::string  name)
template<typename Real >
void ROL::StochasticProblem< Real >::resetStochasticLinearConstraint ( std::string  name)
template<typename Real >
void ROL::StochasticProblem< Real >::resetStochastic ( void  )

Definition at line 295 of file ROL_StochasticProblem_Def.hpp.

template<typename Real >
std::vector< Real > ROL::StochasticProblem< Real >::getObjectiveStatistic ( void  ) const

Definition at line 334 of file ROL_StochasticProblem_Def.hpp.

template<typename Real >
std::vector< Real > ROL::StochasticProblem< Real >::getConstraintStatistic ( std::string  name) const

Definition at line 349 of file ROL_StochasticProblem_Def.hpp.

template<typename Real >
Real ROL::StochasticProblem< Real >::getSolutionStatistic ( int  comp = 0,
std::string  name = "" 
) const

Definition at line 367 of file ROL_StochasticProblem_Def.hpp.

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

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 from ROL::Problem< Real >.

Definition at line 399 of file ROL_StochasticProblem_Def.hpp.

References ROL::Problem< Real >::addConstraint(), ROL::Problem< Real >::addLinearConstraint(), ROL::Problem< Real >::finalize(), ROL::Problem< Real >::removeConstraint(), and ROL::Problem< Real >::removeLinearConstraint().

template<typename Real >
void ROL::StochasticProblem< Real >::edit ( void  )
overridevirtual

Member Data Documentation

template<typename Real >
Ptr<Objective<Real> > ROL::StochasticProblem< Real >::ORIGINAL_obj_
private

Definition at line 69 of file ROL_StochasticProblem.hpp.

template<typename Real >
Ptr<Vector<Real> > ROL::StochasticProblem< Real >::ORIGINAL_xprim_
private

Definition at line 70 of file ROL_StochasticProblem.hpp.

template<typename Real >
Ptr<Vector<Real> > ROL::StochasticProblem< Real >::ORIGINAL_xdual_
private

Definition at line 71 of file ROL_StochasticProblem.hpp.

template<typename Real >
Ptr<BoundConstraint<Real> > ROL::StochasticProblem< Real >::ORIGINAL_bnd_
private

Definition at line 72 of file ROL_StochasticProblem.hpp.

template<typename Real >
std::unordered_map<std::string,ConstraintData<Real> > ROL::StochasticProblem< Real >::ORIGINAL_con_
private

Definition at line 73 of file ROL_StochasticProblem.hpp.

template<typename Real >
std::unordered_map<std::string,ConstraintData<Real> > ROL::StochasticProblem< Real >::ORIGINAL_linear_con_
private

Definition at line 74 of file ROL_StochasticProblem.hpp.

template<typename Real >
bool ROL::StochasticProblem< Real >::needRiskLessObj_
private

Definition at line 76 of file ROL_StochasticProblem.hpp.

template<typename Real >
bool ROL::StochasticProblem< Real >::risk_
private

Definition at line 76 of file ROL_StochasticProblem.hpp.

template<typename Real >
std::vector<bool> ROL::StochasticProblem< Real >::needRiskLessCon_
private

Definition at line 77 of file ROL_StochasticProblem.hpp.

template<typename Real >
Ptr<ParameterList> ROL::StochasticProblem< Real >::objList_
private

Definition at line 78 of file ROL_StochasticProblem.hpp.

template<typename Real >
std::unordered_map<std::string,std::pair<Ptr<ParameterList>,bool> > ROL::StochasticProblem< Real >::conList_
private

Definition at line 79 of file ROL_StochasticProblem.hpp.

template<typename Real >
std::unordered_map<std::string,size_t> ROL::StochasticProblem< Real >::statMap_
private

Definition at line 80 of file ROL_StochasticProblem.hpp.


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