- 3.0.2 optimal control module.
ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR > Class Template Reference

Container class for the constraints used in DMS. More...

#include <ConstraintsContainerDms.h>

Inheritance diagram for ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >:
ct::optcon::tpl::DiscreteConstraintContainerBase< SCALAR >

Public Types

typedef DIMENSIONS::state_vector_t state_vector_t
 
typedef DIMENSIONS::control_vector_t control_vector_t
 
typedef DIMENSIONS::state_matrix_t state_matrix_t
 
typedef DIMENSIONS::control_matrix_t control_matrix_t
 
typedef DIMENSIONS::state_control_matrix_t state_control_matrix_t
 
typedef DIMENSIONS::state_matrix_array_t state_matrix_array_t
 
typedef DIMENSIONS::state_control_matrix_array_t state_control_matrix_array_t
 
- 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 >
 

Public Member Functions

 ConstraintsContainerDms (std::shared_ptr< OptVectorDms< STATE_DIM, CONTROL_DIM, SCALAR >> w, std::shared_ptr< tpl::TimeGrid< SCALAR >> timeGrid, std::vector< std::shared_ptr< ShotContainer< STATE_DIM, CONTROL_DIM, SCALAR >>> shotContainers, std::shared_ptr< ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >> discretizedConstraints, const state_vector_t &x0, const DmsSettings settings)
 Custom constructor. More...
 
 ~ConstraintsContainerDms () override=default
 Destructor. More...
 
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...
 
void changeInitialConstraint (const state_vector_t &x0)
 Updates the initial constraint. 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...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DmsDimensions< STATE_DIM, CONTROL_DIM, SCALARDIMENSIONS
 

Additional Inherited Members

- 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<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
class ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >

Container class for the constraints used in DMS.

Template Parameters
STATE_DIMThe state dimension
CONTROL_DIMThe control dimension

Member Typedef Documentation

◆ state_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DIMENSIONS::state_vector_t ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector_t

◆ control_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DIMENSIONS::control_vector_t ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector_t

◆ state_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DIMENSIONS::state_matrix_t ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >::state_matrix_t

◆ control_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DIMENSIONS::control_matrix_t ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >::control_matrix_t

◆ state_control_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DIMENSIONS::state_control_matrix_t ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >::state_control_matrix_t

◆ state_matrix_array_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DIMENSIONS::state_matrix_array_t ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >::state_matrix_array_t

◆ state_control_matrix_array_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DIMENSIONS::state_control_matrix_array_t ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >::state_control_matrix_array_t

Constructor & Destructor Documentation

◆ ConstraintsContainerDms()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
ConstraintsContainerDms::ConstraintsContainerDms ( std::shared_ptr< OptVectorDms< STATE_DIM, CONTROL_DIM, SCALAR >>  w,
std::shared_ptr< tpl::TimeGrid< SCALAR >>  timeGrid,
std::vector< std::shared_ptr< ShotContainer< STATE_DIM, CONTROL_DIM, SCALAR >>>  shotContainers,
std::shared_ptr< ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >>  discretizedConstraints,
const state_vector_t x0,
const DmsSettings  settings 
)

Custom constructor.

Parameters
[in]wThe optimization variables
[in]timeGridThe time grid
[in]shotContainersThe shot containers
[in]constraintsIntermediateThe intermediate constraints
[in]constraintsFinalThe final constraints
[in]x0The initial state
[in]settingsThe dms settings

◆ ~ConstraintsContainerDms()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >::~ConstraintsContainerDms ( )
overridedefault

Destructor.

Member Function Documentation

◆ prepareEvaluation()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
void ConstraintsContainerDms::prepareEvaluation ( )
overridevirtual

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()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
void ConstraintsContainerDms::prepareJacobianEvaluation ( )
overridevirtual

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 >.

◆ changeInitialConstraint()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
void ConstraintsContainerDms::changeInitialConstraint ( const state_vector_t x0)

Updates the initial constraint.

Parameters
[in]x0The new initial state

Member Data Documentation

◆ DIMENSIONS

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DmsDimensions<STATE_DIM, CONTROL_DIM, SCALAR> ct::optcon::ConstraintsContainerDms< STATE_DIM, CONTROL_DIM, SCALAR >::DIMENSIONS

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