11 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
18 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
21 const Eigen::VectorXi& state_sparsity)
22 :
Base(lb, ub, state_sparsity)
26 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
31 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
36 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
42 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
52 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
56 ct::core::ADCGScalar
t)
58 return this->
sparsity_J_.template cast<ct::core::ADCGScalar>() * x;
62 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
71 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
82 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
88 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
94 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
101 jac.setConstant(1.0);
105 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
111 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
120 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
virtual MatrixXs jacobianState(const state_vector_t &x, const control_vector_t &u, const SCALAR t) override
Returns the constraint jacobian wrt state.
Definition: StateConstraint-impl.h:64
virtual VectorXs jacobianInputSparse(const state_vector_t &x, const control_vector_t &u, const SCALAR t) override
Returns the constraint jacobian wrt control input in sparse structure. The default implementation map...
Definition: StateConstraint-impl.h:113
virtual StateConstraint< STATE_DIM, CONTROL_DIM, SCALAR > * clone() const override
Creates a new instance of the object with same properties than original.
Definition: StateConstraint-impl.h:37
ct::core::ControlVector< control_dim > u
Definition: LoadFromFileTest.cpp:21
virtual size_t getNumNonZerosJacobianState() const override
Returns the number of nonzeros in the jacobian wrt state. The default implementation assumes a dense ...
Definition: StateConstraint-impl.h:83
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > MatrixXs
Definition: ConstraintBase.h:32
Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > VectorXs
Definition: ConstraintBase.h:31
clear all close all load ct GNMSLog0 mat reformat t
Definition: gnmsPlot.m:6
size_t constrSize_
size of the constraint
Definition: BoxConstraintBase.h:113
sparsity_matrix_t sparsity_J_
sparsity matrix
Definition: BoxConstraintBase.h:110
CppAD::AD< CppAD::cg::CG< double > > SCALAR
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > MatrixXs
Definition: StateConstraint.h:35
static void sparsityPatternSparseJacobian(const VectorXi &sparsity_vec, const size_t &constrSize, VectorXi &rows, VectorXi &cols)
generate sparsity pattern for sparse box constraint
Definition: BoxConstraintBase-impl.h:121
virtual MatrixXs jacobianInput(const state_vector_t &x, const control_vector_t &u, const SCALAR t) override
Returns the constraint jacobian wrt input.
Definition: StateConstraint-impl.h:73
virtual ~StateConstraint()
Definition: StateConstraint-impl.h:32
virtual VectorXs evaluate(const state_vector_t &x, const control_vector_t &u, const SCALAR t) override
The evaluation of the constraint violation. Note this method is SCALAR typed.
Definition: StateConstraint-impl.h:44
Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > VectorXs
Definition: StateConstraint.h:34
ct::core::StateVector< state_dim > x
Definition: LoadFromFileTest.cpp:20
virtual size_t getNumNonZerosJacobianInput() const override
Returns the number of nonzeros in the jacobian wrt control input. The default implementation assumes ...
Definition: StateConstraint-impl.h:89
Eigen::Matrix< int, Eigen::Dynamic, 1 > VectorXi
Definition: StateConstraint.h:33
Class for state box constraint.
Definition: StateConstraint.h:22
StateConstraint(const state_vector_t &xLow, const state_vector_t &xHigh)
Constructor taking lower and upper state bounds directly. Assumes state box constraint is dense...
Definition: StateConstraint-impl.h:12
virtual void sparsityPatternInput(VectorXi &rows, VectorXi &cols) override
Definition: StateConstraint-impl.h:121
virtual void sparsityPatternState(VectorXi &rows, VectorXi &cols) override
Definition: StateConstraint-impl.h:106
VectorXi sparsity_
sparsity in vector form
Definition: BoxConstraintBase.h:107
virtual VectorXs jacobianStateSparse(const state_vector_t &x, const control_vector_t &u, const SCALAR t) override
Returns the constraint jacobian wrt state in sparse structure. The default implementation maps the Ja...
Definition: StateConstraint-impl.h:96