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

Implementation of the DMS continuity constraints. More...

#include <ContinuityConstraint.h>

Inheritance diagram for ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >:
ct::optcon::tpl::DiscreteConstraintBase< SCALAR >

Public Types

typedef DmsDimensions< STATE_DIM, CONTROL_DIM, SCALARDIMENSIONS
 
typedef DIMENSIONS::state_vector_t state_vector_t
 
typedef DIMENSIONS::control_vector_t control_vector_t
 
typedef DIMENSIONS::control_vector_array_t control_vector_array_t
 
typedef DIMENSIONS::time_array_t time_array_t
 
typedef DIMENSIONS::state_matrix_t state_matrix_t
 
typedef DIMENSIONS::state_matrix_array_t state_matrix_array_t
 
typedef DIMENSIONS::state_control_matrix_array_t state_control_matrix_array_t
 
typedef Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > VectorXs
 
typedef Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > MatrixXs
 
- Public Types inherited from ct::optcon::tpl::DiscreteConstraintBase< SCALAR >
using VectorXs = Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 >
 

Public Member Functions

 ContinuityConstraint ()=default
 Default constructor. More...
 
 ContinuityConstraint (std::shared_ptr< ShotContainer< STATE_DIM, CONTROL_DIM, SCALAR >> shotContainer, std::shared_ptr< OptVectorDms< STATE_DIM, CONTROL_DIM, SCALAR >> w, size_t shotIndex, const DmsSettings settings)
 Custom constructor. More...
 
VectorXs eval () override
 Evaluates the constraint violation. More...
 
VectorXs evalSparseJacobian () override
 Returns the non zero elements of the eval method with respect to the optimization variables. More...
 
size_t getNumNonZerosJacobian () override
 Returns the number of non zero elements of the jacobian. More...
 
void genSparsityPattern (Eigen::VectorXi &iRow_vec, Eigen::VectorXi &jCol_vec) override
 Returns the sparsity structure of the constraint jacobian. More...
 
VectorXs getLowerBound () override
 Returns the lower bound of the constraint. More...
 
VectorXs getUpperBound () override
 Returns the upper bound of the constraint. More...
 
size_t getConstraintSize () override
 Returns size of the constraint vector. More...
 
- Public Member Functions inherited from ct::optcon::tpl::DiscreteConstraintBase< SCALAR >
 DiscreteConstraintBase ()=default
 Default constructor. More...
 
virtual ~DiscreteConstraintBase ()=default
 Destructor. More...
 
virtual void genSparsityPatternHessian (Eigen::VectorXi &iRow_vec, Eigen::VectorXi &jCol_vec)
 Returns the sparsity structure of the constraint hessian. More...
 
virtual void sparseHessianValues (const Eigen::VectorXd &optVec, const Eigen::VectorXd &lambda, Eigen::VectorXd &sparseHes)
 Returns the non zero elements (values) of the Hessian matrix of this constraint. More...
 
Eigen::VectorXi & iRowHessian ()
 
Eigen::VectorXi & jColHessian ()
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef tpl::DiscreteConstraintBase< SCALARBASE
 

Additional Inherited Members

- Protected Member Functions inherited from ct::optcon::tpl::DiscreteConstraintBase< SCALAR >
size_t genDiagonalIndices (const size_t col_start, const size_t num_elements, Eigen::VectorXi &iRow_vec, Eigen::VectorXi &jCol_vec, const size_t indexNumber)
 This method generates Row and Column vectors which indicate the sparsity pattern of the constraint jacobian for a quadratic matrix block containing diagonal entries only. More...
 
size_t genBlockIndices (const size_t col_start, const size_t num_rows, const size_t num_cols, Eigen::VectorXi &iRow_vec, Eigen::VectorXi &jCol_vec, const size_t indexNumber)
 This method generates Row and Column vectors which indicate the sparsity pattern of the constraint jacobian for an arbitrary dense matrix block. More...
 
- Protected Attributes inherited from ct::optcon::tpl::DiscreteConstraintBase< SCALAR >
Eigen::VectorXi iRowHessian_
 
Eigen::VectorXi jColHessian_
 

Detailed Description

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
class ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >

Implementation of the DMS continuity constraints.

Template Parameters
STATE_DIMThe state dimension
CONTROL_DIMThe input dimension

Member Typedef Documentation

◆ DIMENSIONS

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

◆ state_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DIMENSIONS::state_vector_t ct::optcon::ContinuityConstraint< 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::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector_t

◆ control_vector_array_t

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

◆ time_array_t

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

◆ state_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DIMENSIONS::state_matrix_t ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::state_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::ContinuityConstraint< 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::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::state_control_matrix_array_t

◆ VectorXs

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Eigen::Matrix<SCALAR, Eigen::Dynamic, 1> ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs

◆ MatrixXs

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Eigen::Matrix<SCALAR, Eigen::Dynamic, Eigen::Dynamic> ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::MatrixXs

Constructor & Destructor Documentation

◆ ContinuityConstraint() [1/2]

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::ContinuityConstraint ( )
default

Default constructor.

◆ ContinuityConstraint() [2/2]

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::ContinuityConstraint ( std::shared_ptr< ShotContainer< STATE_DIM, CONTROL_DIM, SCALAR >>  shotContainer,
std::shared_ptr< OptVectorDms< STATE_DIM, CONTROL_DIM, SCALAR >>  w,
size_t  shotIndex,
const DmsSettings  settings 
)
inline

Custom constructor.

Parameters
[in]shotContainerThe shot container
[in]wThe optimization variables
[in]shotIndexThe shot number
[in]settingsThe dms settings

References ct::optcon::DmsSettings::PIECEWISE_LINEAR, ct::optcon::DmsSettings::splineType_, and ct::optcon::DmsSettings::ZERO_ORDER_HOLD.

Member Function Documentation

◆ eval()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
VectorXs ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::eval ( )
inlineoverridevirtual

Evaluates the constraint violation.

Returns
A vector of the evaluated constraint violation

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

◆ evalSparseJacobian()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
VectorXs ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::evalSparseJacobian ( )
inlineoverridevirtual

Returns the non zero elements of the eval method with respect to the optimization variables.

Returns
A vector of the non zero elements of the constraint jacobian

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

References ct::optcon::DmsSettings::PIECEWISE_LINEAR, ct::optcon::DmsSettings::splineType_, and ct::optcon::DmsSettings::ZERO_ORDER_HOLD.

◆ getNumNonZerosJacobian()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
size_t ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::getNumNonZerosJacobian ( )
inlineoverridevirtual

Returns the number of non zero elements of the jacobian.

Returns
The number of non zero elements of the jacobian (which should be equal to the return value of evalSparseJacobian)

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

References ct::optcon::DmsSettings::PIECEWISE_LINEAR, ct::optcon::DmsSettings::splineType_, and ct::optcon::DmsSettings::ZERO_ORDER_HOLD.

◆ genSparsityPattern()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
void ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::genSparsityPattern ( Eigen::VectorXi &  iRow_vec,
Eigen::VectorXi &  jCol_vec 
)
inlineoverridevirtual

Returns the sparsity structure of the constraint jacobian.

Parameters
[out]iRow_vecA vector containing the row indices of the non zero elements of the constraint jacobian
[out]jCol_vecA vector containing the column indices of the non zero elements of the constraint jacobian

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

References ct::optcon::DmsSettings::PIECEWISE_LINEAR, ct::optcon::DmsSettings::splineType_, and ct::optcon::DmsSettings::ZERO_ORDER_HOLD.

◆ getLowerBound()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
VectorXs ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::getLowerBound ( )
inlineoverridevirtual

Returns the lower bound of the constraint.

Returns
The lower constraint bound

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

◆ getUpperBound()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
VectorXs ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::getUpperBound ( )
inlineoverridevirtual

Returns the upper bound of the constraint.

Returns
The upper constraint bound

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

◆ getConstraintSize()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
size_t ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::getConstraintSize ( )
inlineoverridevirtual

Returns size of the constraint vector.

Returns
The size of the constraint vector (should be equal to the size of the return value of the eval method)

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

Member Data Documentation

◆ BASE

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef tpl::DiscreteConstraintBase<SCALAR> ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::BASE

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