- 3.0.2 optimal control module.
|
Implements an abstract base class from which all the discrete custom NLP constraints should derive. More...
#include <DiscreteConstraintBase.h>
Public Types | |
using | VectorXs = Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > |
Public Member Functions | |
DiscreteConstraintBase ()=default | |
Default constructor. More... | |
virtual | ~DiscreteConstraintBase ()=default |
Destructor. More... | |
virtual VectorXs | eval ()=0 |
Evaluates the constraint violation. More... | |
virtual VectorXs | evalSparseJacobian ()=0 |
Returns the non zero elements of the eval method with respect to the optimization variables. More... | |
virtual size_t | getConstraintSize ()=0 |
Returns size of the constraint vector. More... | |
virtual size_t | getNumNonZerosJacobian ()=0 |
Returns the number of non zero elements of the jacobian. More... | |
virtual void | genSparsityPattern (Eigen::VectorXi &iRow_vec, Eigen::VectorXi &jCol_vec)=0 |
Returns the sparsity structure of the constraint jacobian. 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... | |
virtual VectorXs | getLowerBound ()=0 |
Returns the lower bound of the constraint. More... | |
virtual VectorXs | getUpperBound ()=0 |
Returns the upper bound of the constraint. More... | |
Eigen::VectorXi & | iRowHessian () |
Eigen::VectorXi & | jColHessian () |
Protected Member Functions | |
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 | |
Eigen::VectorXi | iRowHessian_ |
Eigen::VectorXi | jColHessian_ |
Implements an abstract base class from which all the discrete custom NLP constraints should derive.
using ct::optcon::tpl::DiscreteConstraintBase< SCALAR >::VectorXs = Eigen::Matrix<SCALAR, Eigen::Dynamic, 1> |
|
default |
Default constructor.
|
virtualdefault |
Destructor.
|
pure virtual |
Evaluates the constraint violation.
Implemented in ct::optcon::ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::InitStateConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ExampleConstraints< SCALAR >, and ExampleConstraints< SCALAR >.
|
pure virtual |
Returns the non zero elements of the eval method with respect to the optimization variables.
Implemented in ct::optcon::ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ExampleConstraints< SCALAR >, ExampleConstraints< SCALAR >, and ct::optcon::InitStateConstraint< STATE_DIM, CONTROL_DIM, SCALAR >.
|
pure virtual |
Returns size of the constraint vector.
Implemented in ct::optcon::ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ExampleConstraints< SCALAR >, ExampleConstraints< SCALAR >, and ct::optcon::InitStateConstraint< STATE_DIM, CONTROL_DIM, SCALAR >.
|
pure virtual |
Returns the number of non zero elements of the jacobian.
Implemented in ct::optcon::ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ExampleConstraints< SCALAR >, ExampleConstraints< SCALAR >, and ct::optcon::InitStateConstraint< STATE_DIM, CONTROL_DIM, SCALAR >.
|
pure virtual |
Returns the sparsity structure of the constraint jacobian.
[out] | iRow_vec | A vector containing the row indices of the non zero elements of the constraint jacobian |
[out] | jCol_vec | A vector containing the column indices of the non zero elements of the constraint jacobian |
Implemented in ct::optcon::ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ExampleConstraints< SCALAR >, ExampleConstraints< SCALAR >, and ct::optcon::InitStateConstraint< STATE_DIM, CONTROL_DIM, SCALAR >.
|
inlinevirtual |
Returns the sparsity structure of the constraint hessian.
[out] | iRow_vec | A vector containing the row indices of the non zero elements of the constraint hessian |
[out] | jCol_vec | A vector containing the column indices of the non zero elements of the constraint hessian |
Reimplemented in ExampleConstraints< SCALAR >, and ExampleConstraints< SCALAR >.
|
inlinevirtual |
Returns the non zero elements (values) of the Hessian matrix of this constraint.
[in] | optVec | A vector holding the current optimization variable vector |
[in] | lambda | A vector holding the current constraint multipliers (one scalar for each row of constraints) |
[out] | sparseHes | The sparse hessian values |
Reimplemented in ExampleConstraints< SCALAR >, and ExampleConstraints< SCALAR >.
References ct::optcon::tpl::DiscreteConstraintBase< SCALAR >::getLowerBound(), and ct::optcon::tpl::DiscreteConstraintBase< SCALAR >::getUpperBound().
|
pure virtual |
Returns the lower bound of the constraint.
Implemented in ct::optcon::ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::InitStateConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ExampleConstraints< SCALAR >, and ExampleConstraints< SCALAR >.
Referenced by ct::optcon::tpl::DiscreteConstraintBase< SCALAR >::sparseHessianValues().
|
pure virtual |
Returns the upper bound of the constraint.
Implemented in ct::optcon::ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::ContinuityConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ct::optcon::InitStateConstraint< STATE_DIM, CONTROL_DIM, SCALAR >, ExampleConstraints< SCALAR >, and ExampleConstraints< SCALAR >.
Referenced by ct::optcon::tpl::DiscreteConstraintBase< SCALAR >::sparseHessianValues().
|
inline |
|
inline |
|
inlineprotected |
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.
[in] | col_start | The starting column of the jCol vec |
[in] | num_elements | The size of the matrix block |
[out] | iRow_vec | The resulting row vector |
[out] | jCol_vec | The resuling column vector |
[in] | indexNumber | The starting inserting index for iRow and jCol |
References i.
Referenced by ct::optcon::InitStateConstraint< STATE_DIM, CONTROL_DIM, SCALAR >::genSparsityPattern(), and ct::optcon::tpl::DiscreteConstraintBase< SCALAR >::jColHessian().
|
inlineprotected |
This method generates Row and Column vectors which indicate the sparsity pattern of the constraint jacobian for an arbitrary dense matrix block.
[in] | col_start | The starting column of the jCol vec |
[in] | num_rows | The number of rows of the matrix block |
[in] | num_cols | The number of columns of the matrix block |
[out] | iRow_vec | The resulting row vector |
[out] | jCol_vec | The resuling column vector |
[in] | indexNumber | The starting inserting index for iRow and jCol |
Referenced by ct::optcon::tpl::DiscreteConstraintBase< SCALAR >::jColHessian().
|
protected |
|
protected |