ROL
ROL_Solver.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_SOLVER_HPP
11 #define ROL_SOLVER_HPP
12 
17 #include "ROL_Problem.hpp"
18 
19 #include "ROL_ParameterList.hpp"
20 #include "ROL_Stream.hpp"
21 
27 namespace ROL {
28 
29 template<typename Real>
30 class Solver {
31 private:
32 
33  const Ptr<Problem<Real>> opt_;
35 
36  Ptr<TypeU::Algorithm<Real>> algoU_;
37  Ptr<TypeB::Algorithm<Real>> algoB_;
38  Ptr<TypeE::Algorithm<Real>> algoE_;
39  Ptr<TypeG::Algorithm<Real>> algoG_;
40 
41 public:
42 
50  Solver( const Ptr<Problem<Real>> &opt,
51  ParameterList &list,
52  const Ptr<Secant<Real>> &secant = nullPtr );
53 
61  int solve( const Ptr<StatusTest<Real>> &status = nullPtr,
62  bool combineStatus = true);
63 
72  int solve( std::ostream &outStream,
73  const Ptr<StatusTest<Real>> &status = nullPtr,
74  bool combineStatus = true );
75 
80  //Ptr<const AlgorithmState<Real>>& getAlgorithmState() const;
81  Ptr<const AlgorithmState<Real>> getAlgorithmState() const;
82 
92  void reset();
93 
94 }; // class Solver
95 
96 } // namespace ROL
97 
98 #include "ROL_Solver_Def.hpp"
99 
100 #endif // ROL_SOLVER_HPP
101 
102 
Provides a simplified interface for solving a wide range of optimization problems.
Definition: ROL_Solver.hpp:30
Defines a no-output stream class ROL::NullStream and a function makeStreamPtr which either wraps a re...
int solve(const Ptr< StatusTest< Real >> &status=nullPtr, bool combineStatus=true)
Solve optimization problem with no iteration output.
Ptr< TypeG::Algorithm< Real > > algoG_
Definition: ROL_Solver.hpp:39
Provides interface for and implements limited-memory secant operators.
Definition: ROL_Secant.hpp:45
Solver(const Ptr< Problem< Real >> &opt, ParameterList &list, const Ptr< Secant< Real >> &secant=nullPtr)
Constructor.
Ptr< TypeU::Algorithm< Real > > algoU_
Definition: ROL_Solver.hpp:36
const Ptr< Problem< Real > > opt_
Definition: ROL_Solver.hpp:33
Provides an interface to check status of optimization algorithms.
void reset()
Reset both Algorithm and Step.
const EProblem problemType_
Definition: ROL_Solver.hpp:34
Ptr< const AlgorithmState< Real > > getAlgorithmState() const
Return the AlgorithmState.
Ptr< TypeE::Algorithm< Real > > algoE_
Definition: ROL_Solver.hpp:38
EProblem
Definition: ROL_Types.hpp:223
Ptr< TypeB::Algorithm< Real > > algoB_
Definition: ROL_Solver.hpp:37