20template <
typename _Scalar>
33 using Cost = CostAbstractTpl<Scalar>;
35 using Data = StageDataTpl<Scalar>;
95 virtual void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
96 const ConstVectorRef &y,
Data &data)
const;
100 const ConstVectorRef &u,
101 const ConstVectorRef &y,
106 const ConstVectorRef &u,
114 oss <<
"StageModel { ";
115 if (stage.ndx1() == stage.ndx2()) {
116 oss <<
"ndx: " << stage.ndx1() <<
", "
117 <<
"nu: " << stage.nu();
119 oss <<
"ndx1:" << stage.ndx1() <<
", "
120 <<
"nu: " << stage.nu() <<
", "
121 <<
"ndx2:" << stage.ndx2();
124 if (stage.numConstraints() > 0) {
126 oss <<
"nc: " << stage.numConstraints();
142template <
typename Scalar>
143struct fmt::formatter<
aligator::StageModelTpl<Scalar>>
144 : fmt::ostream_formatter {};
146#include "aligator/core/stage-model.hxx"
148#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
149#include "aligator/core/stage-model.txx"
Defines the constraint object and constraint stack manager for this library.
Base definitions for ternary functions.
Mixin which makes a class/class hierarchy cloneable.
A stage in the control problem.
shared_ptr< Cost > CostPtr
virtual ~StageModelTpl()=default
friend std::ostream & operator<<(std::ostream &oss, const StageModelTpl &stage)
virtual void computeFirstOrderDerivatives(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, Data &data) const
Compute the first-order derivatives of the StageModelTpl.
virtual void computeSecondOrderDerivatives(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const
Compute the second-order derivatives of the StageModelTpl.
const Manifold & xspace_next() const
StageModelTpl(CostPtr cost, DynamicsPtr dynamics)
shared_ptr< ConstraintSetBase< Scalar > > ConstraintSetPtr
CostPtr cost_
Stage cost function.
ManifoldAbstractTpl< Scalar > Manifold
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
ManifoldPtr xspace_
State space for the current state .
shared_ptr< Dynamics > DynamicsPtr
ManifoldPtr xspace_next_
State space for the next state .
ConstraintStackTpl< Scalar > constraints_
Constraint manager.
virtual StageModelTpl * clone_impl() const override
virtual bool has_dyn_model() const
DynamicsPtr dynamics_
Dynamics model.
StageModelTpl(ManifoldPtr space, const int nu)
const Cost & cost() const
DynamicsModelTpl< Scalar > Dynamics
void addConstraint(T &&cstr)
Add a constraint to the stage.
virtual shared_ptr< Data > createData() const
Create a StageData object.
virtual ALIGATOR_DEPRECATED const Dynamics & dyn_model() const
const Manifold & uspace() const
shared_ptr< Manifold > ManifoldPtr
int numDual() const
Number of dual variables, i.e. Lagrange multipliers.
shared_ptr< StageFunctionTpl< Scalar > > FunctionPtr
void addConstraint(FunctionPtr func, ConstraintSetPtr cstr_set)
Add a constraint to the stage.
StageConstraintTpl< Scalar > Constraint
std::size_t numConstraints() const
Number of constraint objects.
int numPrimal() const
Number of primal optimization variables.
const Manifold & xspace() const
ManifoldPtr uspace_
Control vector space – by default, a simple Euclidean space.
virtual void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, Data &data) const
Evaluate all the functions (cost, dynamics, constraints) at this node.
int nc() const
Total number of constraints.