- 3.0.2 optimal control module.
ct::optcon::tpl::NlpSolver< SCALAR > Class Template Referenceabstract

Abstract base class for the NLP solvers. More...

#include <NlpSolver.h>

Inheritance diagram for ct::optcon::tpl::NlpSolver< SCALAR >:
ct::optcon::SnoptSolver ct::optcon::tpl::IpoptSolver< SCALAR >

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW NlpSolver ()
 Default constructor. More...
 
 NlpSolver (std::shared_ptr< Nlp< SCALAR >> nlp)
 Custom Constructor 1. More...
 
 NlpSolver (std::shared_ptr< Nlp< SCALAR >> nlp, NlpSolverSettings settings)
 Custom constructor 2. More...
 
virtual ~NlpSolver ()=default
 Destructor. More...
 
void configure (const NlpSolverSettings &settings)
 Configures the solver with new settings. More...
 
virtual void configureDerived (const NlpSolverSettings &settings)=0
 Forwards the settings to the corresponding nlp solver. More...
 
virtual bool solve ()=0
 Solves the nlp. More...
 
virtual void prepareWarmStart (const size_t maxIterations)=0
 Prepares the solver for a warmstarting scenario with available (good) initial guess. More...
 
bool isInitialized ()
 

Protected Attributes

std::shared_ptr< Nlp< SCALAR > > nlp_
 
NlpSolverSettings settings_
 
bool isInitialized_
 

Detailed Description

template<typename SCALAR>
class ct::optcon::tpl::NlpSolver< SCALAR >

Abstract base class for the NLP solvers.

Constructor & Destructor Documentation

◆ NlpSolver() [1/3]

template<typename SCALAR >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ct::optcon::tpl::NlpSolver< SCALAR >::NlpSolver ( )
inline

Default constructor.

◆ NlpSolver() [2/3]

template<typename SCALAR >
ct::optcon::tpl::NlpSolver< SCALAR >::NlpSolver ( std::shared_ptr< Nlp< SCALAR >>  nlp)
inline

Custom Constructor 1.

Parameters
[in]nlpThe nlp

◆ NlpSolver() [3/3]

template<typename SCALAR >
ct::optcon::tpl::NlpSolver< SCALAR >::NlpSolver ( std::shared_ptr< Nlp< SCALAR >>  nlp,
NlpSolverSettings  settings 
)
inline

Custom constructor 2.

Parameters
[in]nlpThe nlp
[in]settingsCustom user settings

References ct::optcon::tpl::NlpSolver< SCALAR >::~NlpSolver().

◆ ~NlpSolver()

template<typename SCALAR >
virtual ct::optcon::tpl::NlpSolver< SCALAR >::~NlpSolver ( )
virtualdefault

Member Function Documentation

◆ configure()

template<typename SCALAR >
void ct::optcon::tpl::NlpSolver< SCALAR >::configure ( const NlpSolverSettings settings)
inline

◆ configureDerived()

template<typename SCALAR >
virtual void ct::optcon::tpl::NlpSolver< SCALAR >::configureDerived ( const NlpSolverSettings settings)
pure virtual

Forwards the settings to the corresponding nlp solver.

Parameters
[in]settingsThe nlp settings

Implemented in ct::optcon::SnoptSolver, and ct::optcon::tpl::IpoptSolver< SCALAR >.

Referenced by ct::optcon::tpl::NlpSolver< SCALAR >::configure().

◆ solve()

template<typename SCALAR >
virtual bool ct::optcon::tpl::NlpSolver< SCALAR >::solve ( )
pure virtual

Solves the nlp.

Returns
Returns true of solve succeeded

Implemented in ct::optcon::SnoptSolver, and ct::optcon::tpl::IpoptSolver< SCALAR >.

Referenced by ct::optcon::tpl::NlpSolver< SCALAR >::configure().

◆ prepareWarmStart()

template<typename SCALAR >
virtual void ct::optcon::tpl::NlpSolver< SCALAR >::prepareWarmStart ( const size_t  maxIterations)
pure virtual

Prepares the solver for a warmstarting scenario with available (good) initial guess.

Parameters
[in]maxIterationsSpecifies the maximum number of nlp iteration the user is willing to spend

Implemented in ct::optcon::SnoptSolver, and ct::optcon::tpl::IpoptSolver< SCALAR >.

Referenced by ct::optcon::tpl::NlpSolver< SCALAR >::configure().

◆ isInitialized()

template<typename SCALAR >
bool ct::optcon::tpl::NlpSolver< SCALAR >::isInitialized ( )
inline

Member Data Documentation

◆ nlp_

template<typename SCALAR >
std::shared_ptr<Nlp<SCALAR> > ct::optcon::tpl::NlpSolver< SCALAR >::nlp_
protected

The non linear program

◆ settings_

template<typename SCALAR >
NlpSolverSettings ct::optcon::tpl::NlpSolver< SCALAR >::settings_
protected

The nlp settings

Referenced by ct::optcon::tpl::NlpSolver< SCALAR >::configure().

◆ isInitialized_

template<typename SCALAR >
bool ct::optcon::tpl::NlpSolver< SCALAR >::isInitialized_
protected

Indicates whether the solver is initialized

Referenced by ct::optcon::tpl::NlpSolver< SCALAR >::isInitialized().


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