|
ROL
|
#include <ROL_StochasticProblem.hpp>
Public Member Functions | |
| StochasticProblem (const Ptr< Objective< Real > > &obj, const Ptr< Vector< Real > > &x, const Ptr< Vector< Real > > &g=nullPtr) | |
| Default constructor for StochasticProblem. | |
| 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. | |
| void | edit (void) override |
| Resume editting optimization problem after finalize has been called. | |
| 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. | |
| 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. | |
| bool | isFinalized () const |
| Indicate whether or no 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. | |
| bool | isFinalized () const |
| Indicate whether or no finalize has been called. | |
| void | finalizeIteration () |
| Transform the optimization variables to the native parameterization after an optimization algorithm has finished. | |
Private Attributes | |
| Ptr< Objective< Real > > | ORIGINAL_obj_ |
| Ptr< Objective< Real > > | ORIGINAL_nobj_ |
| 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_ |
| Ptr< Objective< Real > > | INPUT_nobj_ |
Definition at line 33 of file ROL_StochasticProblem.hpp.
| ROL::StochasticProblem< Real >::StochasticProblem | ( | const Ptr< Objective< Real > > & | obj, |
| const Ptr< Vector< Real > > & | x, | ||
| const Ptr< Vector< Real > > & | g = nullPtr ) |
Default constructor for StochasticProblem.
| [in] | obj | objective function object |
| [in] | x | primal optimization space vector |
| [in] | g | dual optimization space vector |
Definition at line 16 of file ROL_StochasticProblem_Def.hpp.
References needRiskLessObj_, and ROL::Problem< Real >::Problem().
|
inline |
Definition at line 69 of file ROL_StochasticProblem.hpp.
References ROL::Problem< Real >::Problem().
| 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 22 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::INPUT_obj_, ROL::Problem< Real >::isFinalized(), needRiskLessObj_, objList_, and ORIGINAL_obj_.
| 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 65 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::INPUT_obj_, ROL::Problem< Real >::isFinalized(), needRiskLessObj_, objList_, and ORIGINAL_obj_.
| void ROL::StochasticProblem< Real >::makeConstraintStochastic | ( | std::string | name, |
| ParameterList & | list, | ||
| const Ptr< SampleGenerator< Real > > & | sampler, | ||
| const Ptr< BatchManager< Real > > & | bman = nullPtr ) |
Definition at line 94 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::addConstraint(), conList_, ROL::Problem< Real >::INPUT_con_, ROL::Problem< Real >::isFinalized(), ORIGINAL_con_, and ROL::Problem< Real >::removeConstraint().
| void ROL::StochasticProblem< Real >::makeLinearConstraintStochastic | ( | std::string | name, |
| ParameterList & | list, | ||
| const Ptr< SampleGenerator< Real > > & | sampler, | ||
| const Ptr< BatchManager< Real > > & | bman = nullPtr ) |
Definition at line 160 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::addLinearConstraint(), ROL::Problem< Real >::INPUT_linear_con_, ROL::Problem< Real >::isFinalized(), ORIGINAL_linear_con_, and ROL::Problem< Real >::removeLinearConstraint().
| void ROL::StochasticProblem< Real >::resetStochasticObjective | ( | void | ) |
Definition at line 214 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::INPUT_obj_, ROL::Problem< Real >::isFinalized(), needRiskLessObj_, objList_, and ORIGINAL_obj_.
Referenced by resetStochastic().
| void ROL::StochasticProblem< Real >::resetStochasticConstraint | ( | std::string | name | ) |
Definition at line 226 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::addConstraint(), conList_, ROL::Problem< Real >::isFinalized(), ORIGINAL_con_, and ROL::Problem< Real >::removeConstraint().
Referenced by resetStochastic().
| void ROL::StochasticProblem< Real >::resetStochasticLinearConstraint | ( | std::string | name | ) |
Definition at line 244 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::addLinearConstraint(), ROL::Problem< Real >::isFinalized(), ORIGINAL_linear_con_, and ROL::Problem< Real >::removeLinearConstraint().
Referenced by resetStochastic().
| void ROL::StochasticProblem< Real >::resetStochastic | ( | void | ) |
Definition at line 261 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::INPUT_bnd_, ROL::Problem< Real >::INPUT_con_, ROL::Problem< Real >::INPUT_linear_con_, ROL::Problem< Real >::INPUT_xdual_, ROL::Problem< Real >::INPUT_xprim_, ROL::Problem< Real >::isFinalized(), ORIGINAL_bnd_, ORIGINAL_xdual_, ORIGINAL_xprim_, resetStochasticConstraint(), resetStochasticLinearConstraint(), and resetStochasticObjective().
| std::vector< Real > ROL::StochasticProblem< Real >::getObjectiveStatistic | ( | void | ) | const |
Definition at line 300 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::INPUT_xprim_, and ROL::Problem< Real >::isFinalized().
| std::vector< Real > ROL::StochasticProblem< Real >::getConstraintStatistic | ( | std::string | name | ) | const |
Definition at line 315 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::INPUT_xprim_, ROL::Problem< Real >::isFinalized(), and statMap_.
| Real ROL::StochasticProblem< Real >::getSolutionStatistic | ( | int | comp = 0, |
| std::string | name = "" ) const |
Definition at line 333 of file ROL_StochasticProblem_Def.hpp.
References computeStatistic(), ROL::Problem< Real >::INPUT_con_, ROL::Problem< Real >::INPUT_obj_, ROL::Problem< Real >::INPUT_xprim_, ROL::Problem< Real >::isFinalized(), and statMap_.
|
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.
| [in] | lumpConstraints | combine both linear and nonlinear constraints |
| [in] | printToStream | determines whether to print to the supplied std::ostream |
| [in,out] | outStream | user supplied std::ostream |
Reimplemented from ROL::Problem< Real >.
Definition at line 365 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::addConstraint(), ROL::Problem< Real >::addLinearConstraint(), conList_, ROL::Problem< Real >::finalize(), ROL::Problem< Real >::INPUT_bnd_, ROL::Problem< Real >::INPUT_con_, ROL::Problem< Real >::INPUT_linear_con_, ROL::Problem< Real >::INPUT_obj_, ROL::Problem< Real >::INPUT_xdual_, ROL::Problem< Real >::INPUT_xprim_, ROL::Problem< Real >::isFinalized(), needRiskLessCon_, needRiskLessObj_, objList_, ORIGINAL_bnd_, ORIGINAL_con_, ORIGINAL_linear_con_, ORIGINAL_xdual_, ORIGINAL_xprim_, ROL::Problem< Real >::removeConstraint(), ROL::Problem< Real >::removeLinearConstraint(), risk_, and statMap_.
|
overridevirtual |
Resume editting optimization problem after finalize has been called.
Reimplemented from ROL::Problem< Real >.
Definition at line 468 of file ROL_StochasticProblem_Def.hpp.
References ROL::Problem< Real >::addConstraint(), ROL::Problem< Real >::addLinearConstraint(), ROL::Problem< Real >::edit(), ROL::Problem< Real >::INPUT_bnd_, ROL::Problem< Real >::INPUT_con_, ROL::Problem< Real >::INPUT_linear_con_, ROL::Problem< Real >::INPUT_obj_, ROL::Problem< Real >::INPUT_xdual_, ROL::Problem< Real >::INPUT_xprim_, needRiskLessCon_, needRiskLessObj_, ORIGINAL_bnd_, ORIGINAL_con_, ORIGINAL_linear_con_, ORIGINAL_obj_, ORIGINAL_xdual_, ORIGINAL_xprim_, ROL::Problem< Real >::removeConstraint(), ROL::Problem< Real >::removeLinearConstraint(), risk_, and statMap_.
|
private |
Definition at line 35 of file ROL_StochasticProblem.hpp.
Referenced by edit(), makeObjectiveStochastic(), makeObjectiveStochastic(), and resetStochasticObjective().
|
private |
Definition at line 36 of file ROL_StochasticProblem.hpp.
|
private |
Definition at line 37 of file ROL_StochasticProblem.hpp.
Referenced by edit(), finalize(), and resetStochastic().
|
private |
Definition at line 38 of file ROL_StochasticProblem.hpp.
Referenced by edit(), finalize(), and resetStochastic().
|
private |
Definition at line 39 of file ROL_StochasticProblem.hpp.
Referenced by edit(), finalize(), and resetStochastic().
|
private |
Definition at line 40 of file ROL_StochasticProblem.hpp.
Referenced by edit(), finalize(), makeConstraintStochastic(), and resetStochasticConstraint().
|
private |
Definition at line 41 of file ROL_StochasticProblem.hpp.
Referenced by edit(), finalize(), makeLinearConstraintStochastic(), and resetStochasticLinearConstraint().
|
private |
Definition at line 43 of file ROL_StochasticProblem.hpp.
Referenced by edit(), finalize(), makeObjectiveStochastic(), makeObjectiveStochastic(), resetStochasticObjective(), and StochasticProblem().
|
private |
Definition at line 43 of file ROL_StochasticProblem.hpp.
Referenced by edit(), and finalize().
|
private |
Definition at line 44 of file ROL_StochasticProblem.hpp.
Referenced by edit(), and finalize().
|
private |
Definition at line 45 of file ROL_StochasticProblem.hpp.
Referenced by finalize(), makeObjectiveStochastic(), makeObjectiveStochastic(), and resetStochasticObjective().
|
private |
Definition at line 46 of file ROL_StochasticProblem.hpp.
Referenced by finalize(), makeConstraintStochastic(), and resetStochasticConstraint().
|
private |
Definition at line 47 of file ROL_StochasticProblem.hpp.
Referenced by edit(), finalize(), getConstraintStatistic(), and getSolutionStatistic().