10 #ifndef ROL_PROBLEM_HPP
11 #define ROL_PROBLEM_HPP
14 #include <unordered_map>
16 #include "ROL_Ptr.hpp"
25 template<
typename Real>
42 Ptr<Objective<Real>>
obj_;
46 Ptr<BoundConstraint<Real>>
bnd_;
47 Ptr<Constraint<Real>>
con_;
48 Ptr<Vector<Real>>
mul_;
49 Ptr<Vector<Real>>
res_;
50 Ptr<PolyhedralProjection<Real>>
proj_;
53 Ptr<ReduceLinearConstraint<Real>>
rlc_;
64 std::unordered_map<std::string,ConstraintData<Real>>
INPUT_con_;
265 Real
checkLinearity(
bool printToStream =
false, std::ostream &outStream = std::cout)
const;
272 void checkVectors(
bool printToStream =
false, std::ostream &outStream = std::cout)
const;
279 void checkDerivatives(
bool printToStream =
false, std::ostream &outStream = std::cout,
const Ptr<
Vector<Real>> &x0 = nullPtr, Real scale = Real(1))
const;
287 void check(
bool printToStream =
false, std::ostream &outStream = std::cout,
const Ptr<
Vector<Real>> &x0 = nullPtr, Real scale = Real(1))
const;
301 virtual void finalize(
bool lumpConstraints =
false,
bool printToStream =
false,
302 std::ostream &outStream = std::cout);
323 #endif // ROL_NEWOPTIMIZATIONPROBLEM_HPP
void check(bool printToStream=false, std::ostream &outStream=std::cout) const
Run vector, linearity and derivative checks for user-supplied vectors, objective function and constra...
Provides the interface to evaluate objective functions.
const Ptr< Constraint< Real > > & getConstraint()
Get the equality constraint.
Ptr< BoundConstraint< Real > > bnd_
void checkDerivatives(bool printToStream=false, std::ostream &outStream=std::cout) const
Run derivative checks for user-supplied objective function and constraints.
bool hasLinearInequality_
const Ptr< Vector< Real > > & getPrimalOptimizationVector()
Get the primal optimization space vector.
void addBoundConstraint(const Ptr< BoundConstraint< Real >> &bnd)
Add a bound constraint.
Ptr< Objective< Real > > INPUT_nobj_
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 removeBoundConstraint()
Remove an existing bound constraint.
Contains definitions of custom data types in ROL.
void removeLinearConstraint(std::string name)
Remove an existing linear constraint.
const Ptr< BoundConstraint< Real > > & getBoundConstraint()
Get the bound constraint.
unsigned cnt_linear_econ_
Ptr< ReduceLinearConstraint< Real > > rlc_
Defines the linear algebra or vector space interface.
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 can...
Ptr< Objective< Real > > INPUT_obj_
Ptr< Objective< Real > > obj_
bool isFinalized() const
Indicate whether or no finalize has been called.
Ptr< Vector< Real > > res_
Ptr< Vector< Real > > INPUT_xprim_
unsigned cnt_linear_icon_
const Ptr< Objective< Real > > & getObjective()
Get the objective function.
Problem(const Ptr< Objective< Real >> &obj, const Ptr< Vector< Real >> &x, const Ptr< Vector< Real >> &g=nullPtr)
Default constructor for OptimizationProblem.
std::unordered_map< std::string, ConstraintData< Real > > INPUT_linear_con_
std::unordered_map< std::string, ConstraintData< Real > > INPUT_con_
Ptr< Vector< Real > > INPUT_xdual_
const Ptr< Vector< Real > > & getResidualVector()
Get the primal constraint space vector.
const Ptr< Vector< Real > > & getMultiplierVector()
Get the dual constraint space vector.
void finalizeIteration()
Transform the optimization variables to the native parameterization after an optimization algorithm h...
Ptr< Vector< Real > > xdual_
Problem(const Problem &problem)
Copy constructor for OptimizationProblem.
void removeProximableObjective()
Ptr< Objective< Real > > nobj_
Ptr< Constraint< Real > > con_
void addProximableObjective(const Ptr< Objective< Real >> &nobj)
Provides the interface to apply upper and lower bound constraints.
Real checkLinearity(bool printToStream=false, std::ostream &outStream=std::cout) const
Check if user-supplied linear constraints are affine.
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.
const Ptr< PolyhedralProjection< Real > > & getPolyhedralProjection()
Get the polyhedral projection object. This is a null pointer if no linear constraints and/or bounds a...
EProblem getProblemType()
Get the optimization problem type (U, B, E, or G).
void removeConstraint(std::string name)
Remove an existing constraint.
Ptr< Vector< Real > > xfeas_
Ptr< BoundConstraint< Real > > INPUT_bnd_
virtual void edit()
Resume editting optimization problem after finalize has been called.
const Ptr< Objective< Real > > & getProximableObjective()
Get proximable objective.
const Ptr< Vector< Real > > & getDualOptimizationVector()
Get the dual optimization space vector.
void checkVectors(bool printToStream=false, std::ostream &outStream=std::cout) const
Run vector checks for user-supplied vectors.
bool hasProximableObjective_
Ptr< Vector< Real > > xprim_
Ptr< Vector< Real > > mul_
Defines the general constraint operator interface.
void setProjectionAlgorithm(ParameterList &parlist)
Set polyhedral projection algorithm.
Ptr< PolyhedralProjection< Real > > proj_