22 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR =
double>
26 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
31 typedef Eigen::Matrix<SCALAR, Eigen::Dynamic, 1>
VectorXs;
46 lb_.setConstant(
SCALAR(0.0));
47 ub_.setConstant(
SCALAR(0.0));
56 VectorXs
eval()
override {
return w_->getOptimizedState(0) - x_0_; }
61 size_t indexNumber = 0;
69 std::shared_ptr<OptVectorDms<STATE_DIM, CONTROL_DIM, SCALAR>> w_;
void genSparsityPattern(Eigen::VectorXi &iRow_vec, Eigen::VectorXi &jCol_vec) override
Returns the sparsity structure of the constraint jacobian.
Definition: InitStateConstraint.h:59
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DmsDimensions< STATE_DIM, CONTROL_DIM, SCALAR > DIMENSIONS
Definition: InitStateConstraint.h:27
InitStateConstraint()=default
Default constructor.
tpl::DiscreteConstraintBase< SCALAR > BASE
Definition: InitStateConstraint.h:29
Implements an abstract base class from which all the discrete custom NLP constraints should derive...
Definition: DiscreteConstraintBase.h:21
This class is a wrapper around the NLP Optvector. It wraps the Vectors from the NLP solvers into stat...
Definition: OptVectorDms.h:37
size_t getNumNonZerosJacobian() override
Returns the number of non zero elements of the jacobian.
Definition: InitStateConstraint.h:58
CppAD::AD< CppAD::cg::CG< double > > SCALAR
Defines basic types used in the DMS algorithm.
Definition: DmsDimensions.h:18
DIMENSIONS::state_vector_t state_vector_t
Definition: InitStateConstraint.h:30
VectorXs eval() override
Evaluates the constraint violation.
Definition: InitStateConstraint.h:56
VectorXs evalSparseJacobian() override
Returns the non zero elements of the eval method with respect to the optimization variables...
Definition: InitStateConstraint.h:57
The implementation of the DMS initial state constraint.
Definition: InitStateConstraint.h:23
InitStateConstraint(const state_vector_t &x0, std::shared_ptr< OptVectorDms< STATE_DIM, CONTROL_DIM, SCALAR >> w)
Custom constructor.
Definition: InitStateConstraint.h:43
size_t getConstraintSize() override
Returns size of the constraint vector.
Definition: InitStateConstraint.h:67
StateVector< state_dim > x0
Definition: ConstrainedNLOCTest.cpp:14
VectorXs getLowerBound() override
Returns the lower bound of the constraint.
Definition: InitStateConstraint.h:65
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 ja...
Definition: DiscreteConstraintBase.h:172
void updateConstraint(const state_vector_t &x0)
Updates the constraint.
Definition: InitStateConstraint.h:55
VectorXs getUpperBound() override
Returns the upper bound of the constraint.
Definition: InitStateConstraint.h:66
Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > VectorXs
Definition: InitStateConstraint.h:31