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 
18 #include "ROL_Problem.hpp"
19 
20 #include "ROL_ParameterList.hpp"
21 #include "ROL_Stream.hpp"
22 
28 namespace ROL {
29 
30 template<typename Real>
31 class Solver {
32 private:
33 
34  const Ptr<Problem<Real>> opt_;
36 
37  Ptr<TypeU::Algorithm<Real>> algoU_;
38  Ptr<TypeB::Algorithm<Real>> algoB_;
39  Ptr<TypeE::Algorithm<Real>> algoE_;
40  Ptr<TypeG::Algorithm<Real>> algoG_;
41  Ptr<TypeP::Algorithm<Real>> algoP_;
42 
43 public:
44 
52  Solver( const Ptr<Problem<Real>> &opt,
53  ParameterList &list,
54  const Ptr<Secant<Real>> &secant = nullPtr );
55 
63  int solve( const Ptr<StatusTest<Real>> &status = nullPtr,
64  bool combineStatus = true);
65 
74  int solve( std::ostream &outStream,
75  const Ptr<StatusTest<Real>> &status = nullPtr,
76  bool combineStatus = true );
77 
82  //Ptr<const AlgorithmState<Real>>& getAlgorithmState() const;
83  Ptr<const AlgorithmState<Real>> getAlgorithmState() const;
84 
94  void reset();
95 
96 }; // class Solver
97 
98 } // namespace ROL
99 
100 #include "ROL_Solver_Def.hpp"
101 
102 #endif // ROL_SOLVER_HPP
103 
104 
Provides a simplified interface for solving a wide range of optimization problems.
Definition: ROL_Solver.hpp:31
Defines a no-output stream class ROL::NullStream and a function makeStreamPtr which either wraps a re...
Ptr< TypeP::Algorithm< Real > > algoP_
Definition: ROL_Solver.hpp:41
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:40
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:37
const Ptr< Problem< Real > > opt_
Definition: ROL_Solver.hpp:34
Provides an interface to check status of optimization algorithms.
void reset()
Reset both Algorithm and Step.
const EProblem problemType_
Definition: ROL_Solver.hpp:35
Ptr< const AlgorithmState< Real > > getAlgorithmState() const
Return the AlgorithmState.
Ptr< TypeE::Algorithm< Real > > algoE_
Definition: ROL_Solver.hpp:39
EProblem
Definition: ROL_Types.hpp:223
Ptr< TypeB::Algorithm< Real > > algoB_
Definition: ROL_Solver.hpp:38