10 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
12 using Base = StageFunctionTpl<Scalar>;
13 using Data = StageFunctionDataTpl<Scalar>;
21 :
Base(ndx,
nu,
ndx2,
nr),
A_(
nr, ndx),
B_(
nr,
nu),
C_(
nr,
ndx2),
d_(
nr) {
29 const ConstMatrixRef C,
const ConstVectorRef d)
30 :
Base((int)A.cols(), (int)B.cols(), (int)C.cols(), (int)d.rows()),
A_(A),
32 assert((
A_.rows() ==
d_.rows()) && (
B_.rows() ==
d_.rows()) &&
33 (
C_.rows() ==
d_.rows()) &&
"Number of rows not consistent.");
38 const ConstVectorRef d)
41 void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
42 const ConstVectorRef &y,
Data &data)
const {
43 data.value_ =
A_ * x +
B_ * u +
C_ * y +
d_;
52 const ConstVectorRef &,
Data &data)
const {
62 std::make_shared<Data>(this->
ndx1, this->
nu, this->
ndx2, this->
nr);
Base definitions for ternary functions.
void computeJacobians(const ConstVectorRef &, const ConstVectorRef &, const ConstVectorRef &, Data &data) const
Compute Jacobians of this function.
LinearFunctionTpl(const int ndx, const int nu, const int ndx2, const int nr)
LinearFunctionTpl(const ConstMatrixRef A, const ConstMatrixRef B, const ConstVectorRef d)
Constructor where is assumed.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, Data &data) const
Evaluate the function.
LinearFunctionTpl(const ConstMatrixRef A, const ConstMatrixRef B, const ConstMatrixRef C, const ConstVectorRef d)
virtual shared_ptr< Data > createData() const
Instantiate a Data object.
Class representing ternary functions .
const int ndx2
Next state dimension.
const int nu
Control dimension.
const int ndx1
Current state dimension.
const int nr
Function codimension.