ROL
ROL::OptimizationSolver< Real > Class Template Reference

Provides a simplified interface for solving a wide range of optimization problems. More...

#include <ROL_OptimizationSolver.hpp>

Public Member Functions

 OptimizationSolver (OptimizationProblem< Real > &opt, ROL::ParameterList &parlist)
 Constructor.
std::vector< std::string > getOutput (void) const
 Returns iteration history as a vector of strings.
int solve (const ROL::Ptr< StatusTest< Real > > &status=ROL::nullPtr, const bool combineStatus=true)
 Solve optimization problem with no iteration output.
int solve (std::ostream &outStream, const ROL::Ptr< StatusTest< Real > > &status=ROL::nullPtr, const bool combineStatus=true)
 Solve optimization problem.
ROL::Ptr< const AlgorithmState< Real > > getAlgorithmState (void) const
 Return the AlgorithmState.
void resetAlgorithmState (void)
 Reset the AlgorithmState.
void reset (const bool resetAlgo=true)
 Reset both Algorithm and Step.
std::string getStepName (void) const
 Grab step name (after check for consistency).

Private Attributes

ROL::Ptr< Algorithm< Real > > algo_
ROL::Ptr< Step< Real > > step_
ROL::Ptr< StatusTest< Real > > status0_
ROL::Ptr< CombinedStatusTest< Real > > status_
ROL::Ptr< AlgorithmState< Real > > state_
ROL::Ptr< Vector< Real > > x_
ROL::Ptr< Vector< Real > > g_
ROL::Ptr< Vector< Real > > l_
ROL::Ptr< Vector< Real > > c_
ROL::Ptr< Objective< Real > > obj_
ROL::Ptr< BoundConstraint< Real > > bnd_
ROL::Ptr< Constraint< Real > > con_
std::vector< std::string > output_
EProblem problemType_
EStep stepType_
std::string stepname_
Real pen_

Detailed Description

template<class Real>
class ROL::OptimizationSolver< Real >

Provides a simplified interface for solving a wide range of optimization problems.

Definition at line 29 of file ROL_OptimizationSolver.hpp.

Constructor & Destructor Documentation

◆ OptimizationSolver()

Member Function Documentation

◆ getOutput()

template<class Real>
std::vector< std::string > ROL::OptimizationSolver< Real >::getOutput ( void ) const
inline

Returns iteration history as a vector of strings.


Definition at line 169 of file ROL_OptimizationSolver.hpp.

References output_.

◆ solve() [1/2]

template<class Real>
int ROL::OptimizationSolver< Real >::solve ( const ROL::Ptr< StatusTest< Real > > & status = ROL::nullPtr,
const bool combineStatus = true )
inline

Solve optimization problem with no iteration output.

Parameters
[in]statusis a user-defined StatusTest
[in]combineStatusif true, the user-defined StatusTest will be combined with the default StatusTest

Definition at line 180 of file ROL_OptimizationSolver.hpp.

References solve().

Referenced by main(), solve(), and ROL::SROMGenerator< Real >::SROMGenerator().

◆ solve() [2/2]

template<class Real>
int ROL::OptimizationSolver< Real >::solve ( std::ostream & outStream,
const ROL::Ptr< StatusTest< Real > > & status = ROL::nullPtr,
const bool combineStatus = true )
inline

Solve optimization problem.

Parameters
[in]outStreamis the output stream to collect iteration history
[in]statusis a user-defined StatusTest
[in]combineStatusif true, the user-defined StatusTest will be combined with the default StatusTest

Definition at line 194 of file ROL_OptimizationSolver.hpp.

References algo_, bnd_, c_, con_, g_, l_, obj_, output_, problemType_, state_, status0_, status_, step_, ROL::TYPE_B, ROL::TYPE_E, ROL::TYPE_EB, ROL::TYPE_LAST, ROL::TYPE_U, and x_.

◆ getAlgorithmState()

template<class Real>
ROL::Ptr< const AlgorithmState< Real > > ROL::OptimizationSolver< Real >::getAlgorithmState ( void ) const
inline

Return the AlgorithmState.


Definition at line 238 of file ROL_OptimizationSolver.hpp.

References state_.

Referenced by main().

◆ resetAlgorithmState()

template<class Real>
void ROL::OptimizationSolver< Real >::resetAlgorithmState ( void )
inline

Reset the AlgorithmState.

This function does not reset the Step or the StepState.


Definition at line 248 of file ROL_OptimizationSolver.hpp.

References state_.

Referenced by reset().

◆ reset()

template<class Real>
void ROL::OptimizationSolver< Real >::reset ( const bool resetAlgo = true)
inline

Reset both Algorithm and Step.

Parameters
[in]resetAlgoif true, then AlgorithmState will be reset

This function will reset the AlgorithmState and reinitialize the Step. This function does not permit changing the Step specified upon construction. To change the Step, reinitialize the OptimizationSolver.


Definition at line 263 of file ROL_OptimizationSolver.hpp.

References l_, obj_, pen_, reset(), resetAlgorithmState(), step_, ROL::STEP_AUGMENTEDLAGRANGIAN, ROL::STEP_INTERIORPOINT, ROL::STEP_MOREAUYOSIDAPENALTY, and stepType_.

Referenced by reset().

◆ getStepName()

template<class Real>
std::string ROL::OptimizationSolver< Real >::getStepName ( void ) const
inline

Grab step name (after check for consistency).

Parameters
[out]stepnameName of step

This function returns the algorithmic step name.


Definition at line 290 of file ROL_OptimizationSolver.hpp.

References stepname_.

Member Data Documentation

◆ algo_

template<class Real>
ROL::Ptr<Algorithm<Real> > ROL::OptimizationSolver< Real >::algo_
private

Definition at line 32 of file ROL_OptimizationSolver.hpp.

Referenced by solve().

◆ step_

template<class Real>
ROL::Ptr<Step<Real> > ROL::OptimizationSolver< Real >::step_
private

Definition at line 33 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), reset(), and solve().

◆ status0_

template<class Real>
ROL::Ptr<StatusTest<Real> > ROL::OptimizationSolver< Real >::status0_
private

Definition at line 34 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and solve().

◆ status_

template<class Real>
ROL::Ptr<CombinedStatusTest<Real> > ROL::OptimizationSolver< Real >::status_
private

Definition at line 35 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and solve().

◆ state_

template<class Real>
ROL::Ptr<AlgorithmState<Real> > ROL::OptimizationSolver< Real >::state_
private

◆ x_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::OptimizationSolver< Real >::x_
private

Definition at line 38 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and solve().

◆ g_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::OptimizationSolver< Real >::g_
private

Definition at line 39 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and solve().

◆ l_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::OptimizationSolver< Real >::l_
private

Definition at line 40 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), reset(), and solve().

◆ c_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::OptimizationSolver< Real >::c_
private

Definition at line 41 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and solve().

◆ obj_

template<class Real>
ROL::Ptr<Objective<Real> > ROL::OptimizationSolver< Real >::obj_
private

Definition at line 43 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), reset(), and solve().

◆ bnd_

template<class Real>
ROL::Ptr<BoundConstraint<Real> > ROL::OptimizationSolver< Real >::bnd_
private

Definition at line 44 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and solve().

◆ con_

template<class Real>
ROL::Ptr<Constraint<Real> > ROL::OptimizationSolver< Real >::con_
private

Definition at line 45 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and solve().

◆ output_

template<class Real>
std::vector<std::string> ROL::OptimizationSolver< Real >::output_
private

Definition at line 47 of file ROL_OptimizationSolver.hpp.

Referenced by getOutput(), and solve().

◆ problemType_

template<class Real>
EProblem ROL::OptimizationSolver< Real >::problemType_
private

Definition at line 49 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and solve().

◆ stepType_

template<class Real>
EStep ROL::OptimizationSolver< Real >::stepType_
private

Definition at line 50 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and reset().

◆ stepname_

template<class Real>
std::string ROL::OptimizationSolver< Real >::stepname_
private

Definition at line 51 of file ROL_OptimizationSolver.hpp.

Referenced by getStepName(), and OptimizationSolver().

◆ pen_

template<class Real>
Real ROL::OptimizationSolver< Real >::pen_
private

Definition at line 53 of file ROL_OptimizationSolver.hpp.

Referenced by OptimizationSolver(), and reset().


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