44 #ifndef ROL_OPTIMIZATIONSOLVER_HPP 45 #define ROL_OPTIMIZATIONSOLVER_HPP 47 #define OPTIMIZATION_PROBLEM_REFACTOR 52 #include "Teuchos_oblackholestream.hpp" 71 Teuchos::RCP<Algorithm<Real> >
algo_;
72 Teuchos::RCP<Step<Real> >
step_;
74 Teuchos::RCP<AlgorithmState<Real> >
state_;
92 Teuchos::ParameterList &parlist ) {
94 using Teuchos::RCP;
using Teuchos::rcp;
96 std::string stepname = parlist.sublist(
"Step").get(
"Type",
"Last Type (Dummy)");
102 TEUCHOS_TEST_FOR_EXCEPTION( !
isValidStep(stepType), std::invalid_argument,
103 "Invalid step name in OptimizationSolver constructor!" );
105 TEUCHOS_TEST_FOR_EXCEPTION( !
isCompatibleStep(problemType_, stepType), std::logic_error,
106 "Error in OptimizationSolver constructor: Step type " << stepname <<
" does not support " 112 step_ = stepFactory.
getStep(stepname,parlist);
119 g_ = x_->dual().clone();
124 c_ = l_->dual().clone();
156 Teuchos::oblackholestream bhs;
160 virtual int solve( std::ostream &outStream ) {
162 switch(problemType_) {
164 output_ = algo_->run(*x_,*g_,*obj_,
true,outStream);
167 output_ = algo_->run(*x_,*g_,*obj_,*bnd_,
true,outStream);
170 output_ = algo_->run(*x_,*g_,*l_,*c_,*obj_,*eqcon_,
true,outStream);
173 output_ = algo_->run(*x_,*g_,*l_,*c_,*obj_,*eqcon_,*bnd_,
true,outStream);
176 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
177 "Error in OptimizationSolver::solve() : Unsupported problem type");
199 #endif // ROL_OPTIMIZATIONSOLVER_HPP Provides the interface to evaluate objective functions.
Provides the interface to evaluate the augmented Lagrangian.
Teuchos::RCP< AlgorithmState< Real > > state_
EStep StringToEStep(std::string s)
Teuchos::RCP< Algorithm< Real > > algo_
Teuchos::RCP< StatusTest< Real > > status_
BoundConstraint< Real > BND
void stepFactory(Teuchos::ParameterList &parlist, Teuchos::RCP< ROL::Step< Real > > &step)
A minimalist step factory which specializes the Step Type depending on whether a Trust-Region or Line...
Teuchos::RCP< Step< Real > > getStep(const std::string &type, Teuchos::ParameterList &parlist) const
std::vector< std::string > output_
Teuchos::RCP< EQCON > eqcon_
virtual std::vector< std::string > getOutput()
Defines the linear algebra or vector space interface.
Teuchos::RCP< BoundConstraint< Real > > getBoundConstraint(void)
State for algorithm class. Will be used for restarts.
Teuchos::RCP< Step< Real > > step_
Defines the equality constraint operator interface.
Provides an interface to run optimization algorithms.
Provides the interface to evaluate the Moreau-Yosida penalty function.
virtual int solve(std::ostream &outStream)
EProblem getProblemType(void)
std::string EProblemToString(EProblem p)
Teuchos::RCP< Vector< Real > > getMultiplierVector(void)
Provides the interface to apply upper and lower bound constraints.
OptimizationSolver(OptimizationProblem< Real > &opt, Teuchos::ParameterList &parlist)
Provides a simplified interface for solving a wide range of optimization problems.
int isValidStep(EStep ls)
Verifies validity of a TrustRegion enum.
int isCompatibleStep(EProblem p, EStep s)
Teuchos::RCP< EqualityConstraint< Real > > getEqualityConstraint(void)
Teuchos::RCP< const AlgorithmState< Real > > getAlgorithmState()
Teuchos::RCP< Vector< Real > > getSolutionVector(void)
Teuchos::RCP< StatusTest< Real > > getStatusTest(const std::string step, Teuchos::ParameterList &parlist)
EStep
Enumeration of step types.
EqualityConstraint< Real > EQCON
Teuchos::RCP< Objective< Real > > getObjective(void)