- 3.0.2 optimal control module.
ExampleConstraintsContainer< SCALAR > Class Template Referencefinal

This class acts as a container for multiple constraints. In this example we capture all the constraints in one constraint clas. More...

Inheritance diagram for ExampleConstraintsContainer< SCALAR >:
ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR > ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR >

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW ExampleConstraintsContainer (std::shared_ptr< tpl::OptVector< SCALAR >> optVector)
 
 ~ExampleConstraintsContainer () override=default
 
void prepareEvaluation () override
 Gets called before the constraint evaluation. This method should contain all the calculations needed to evaluate the constraints. More...
 
void prepareJacobianEvaluation () override
 Gets called before the constraint jacobian evaluation. This method should contain all the calculations needed to evaluate the constraint jacobian. More...
 
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ExampleConstraintsContainer (std::shared_ptr< tpl::OptVector< SCALAR >> optVector)
 
 ~ExampleConstraintsContainer () override=default
 
void prepareEvaluation () override
 Gets called before the constraint evaluation. This method should contain all the calculations needed to evaluate the constraints. More...
 
void prepareJacobianEvaluation () override
 Gets called before the constraint jacobian evaluation. This method should contain all the calculations needed to evaluate the constraint jacobian. More...
 
- Public Member Functions inherited from ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR >
 DiscreteConstraintContainerBase ()=default
 Default constructor. More...
 
virtual ~DiscreteConstraintContainerBase ()=default
 Destructor. More...
 
void evalConstraints (MapVecXs &c_nlp)
 Writes the constraint evaluations into the large constraint optimization vector. More...
 
void evalConstraints (VectorXs &c_nlp)
 
void evalSparseJacobian (MapVecXs &jac_nlp, const int nzz_jac_g)
 Evaluates the jacobian of the constraints and writes them into the nlp vector. More...
 
void getSparsityPattern (Eigen::Map< Eigen::VectorXi > &iRow_nlp, Eigen::Map< Eigen::VectorXi > &jCol_nlp, const int nnz_jac_g)
 Retrieves the sparsity pattern of the constraint Jacobian and writes them into the nlp vectors. More...
 
size_t getConstraintsCount () const
 Returns the number of constraints in the NLP. More...
 
size_t getNonZerosJacobianCount () const
 Returns the number of non zeros in the constraint jacobian. More...
 
void getSparsityPatternHessian (Eigen::VectorXi &iRow, Eigen::VectorXi &jCol, size_t numOptVar)
 creates the combined hessian sparsity pattern from a number of constraint terms More...
 
Eigen::VectorXd sparseHessianValues (const Eigen::VectorXd &optVec, const Eigen::VectorXd &lambda)
 Evaluates the constraint Hessian. More...
 
void getBounds (MapVecXs &lowerBound, MapVecXs &upperBound)
 Retrieves the constraint bounds and writes them into the vectors used in the NLP. More...
 

Additional Inherited Members

- Public Types inherited from ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR >
using VectorXs = Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 >
 
using VectorXi = Eigen::Matrix< int, Eigen::Dynamic, 1 >
 
using MapVecXs = Eigen::Map< VectorXs >
 
using MapVecXi = Eigen::Map< VectorXi >
 
- Protected Attributes inherited from ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR >
std::vector< std::shared_ptr< DiscreteConstraintBase< SCALAR > > > constraints_
 Container which holds all the constraints of the NLP. More...
 
std::vector< int > iRowHessianStdVec_
 
std::vector< int > jColHessianStdVec_
 

Detailed Description

template<typename SCALAR>
class ExampleConstraintsContainer< SCALAR >

This class acts as a container for multiple constraints. In this example we capture all the constraints in one constraint clas.

Template Parameters
SCALARScalar type

Constructor & Destructor Documentation

◆ ExampleConstraintsContainer() [1/2]

template<typename SCALAR >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ExampleConstraintsContainer< SCALAR >::ExampleConstraintsContainer ( std::shared_ptr< tpl::OptVector< SCALAR >>  optVector)
inline

◆ ~ExampleConstraintsContainer() [1/2]

template<typename SCALAR >
ExampleConstraintsContainer< SCALAR >::~ExampleConstraintsContainer ( )
overridedefault

◆ ExampleConstraintsContainer() [2/2]

template<typename SCALAR >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ExampleConstraintsContainer< SCALAR >::ExampleConstraintsContainer ( std::shared_ptr< tpl::OptVector< SCALAR >>  optVector)
inline

◆ ~ExampleConstraintsContainer() [2/2]

template<typename SCALAR >
ExampleConstraintsContainer< SCALAR >::~ExampleConstraintsContainer ( )
overridedefault

Member Function Documentation

◆ prepareEvaluation() [1/2]

template<typename SCALAR >
void ExampleConstraintsContainer< SCALAR >::prepareEvaluation ( )
inlineoverridevirtual

Gets called before the constraint evaluation. This method should contain all the calculations needed to evaluate the constraints.

Implements ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR >.

◆ prepareJacobianEvaluation() [1/2]

template<typename SCALAR >
void ExampleConstraintsContainer< SCALAR >::prepareJacobianEvaluation ( )
inlineoverridevirtual

Gets called before the constraint jacobian evaluation. This method should contain all the calculations needed to evaluate the constraint jacobian.

Implements ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR >.

◆ prepareEvaluation() [2/2]

template<typename SCALAR >
void ExampleConstraintsContainer< SCALAR >::prepareEvaluation ( )
inlineoverridevirtual

Gets called before the constraint evaluation. This method should contain all the calculations needed to evaluate the constraints.

Implements ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR >.

◆ prepareJacobianEvaluation() [2/2]

template<typename SCALAR >
void ExampleConstraintsContainer< SCALAR >::prepareJacobianEvaluation ( )
inlineoverridevirtual

Gets called before the constraint jacobian evaluation. This method should contain all the calculations needed to evaluate the constraint jacobian.

Implements ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR >.


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