13 using Scalar =
typename FunType::Scalar;
29 const ConstMatrixRef
A,
const ConstVectorRef
b)
37 if (
A.rows() !=
b.rows()) {
38 ALIGATOR_RUNTIME_ERROR(
"Incompatible dimensions: A.rows() != b.rows()");
40 if (
A.cols() !=
func->nr) {
41 ALIGATOR_RUNTIME_ERROR(
"Incompatible dimensions: A.cols() != func.nr");
46 const ConstMatrixRef
A)
50 return std::make_shared<Data>(*
this);
55template <
typename _Scalar>
62 using Data =
typename Impl::Data;
71 void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
78template <
typename _Scalar>
85 using Data =
typename Impl::Data;
99template <
typename Scalar>
107template <
typename Scalar>
114#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
115extern template struct LinearFunctionCompositionTpl<context::Scalar>;
116extern template struct LinearUnaryFunctionCompositionTpl<context::Scalar>;
Base definitions for ternary functions.
auto linear_compose(xyz::polymorphic< StageFunctionTpl< Scalar > > func, const typename math_types< Scalar >::ConstMatrixRef A, const typename math_types< Scalar >::ConstVectorRef b)
Create a linear composition of the input function func.
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const override
Evaluate the function.
void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const override
Compute Jacobians of this function.
StageFunctionDataTpl< Scalar > BaseData
typename Impl::FunType Base
detail::linear_func_composition_impl< StageFunctionTpl< Scalar > > Impl
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
detail::linear_func_composition_impl< Base > Impl
ALIGATOR_UNARY_FUNCTION_INTERFACE(Scalar)
void evaluate(const ConstVectorRef &x, BaseData &data) const override
void computeJacobians(const ConstVectorRef &x, BaseData &data) const override
StageFunctionDataTpl< Scalar > BaseData
Base struct for function data.
Class representing ternary functions .
Represents unary functions of the form , with no control (or next-state) arguments.
shared_ptr< BaseData > sub_data
Data(const linear_func_composition_impl &model)
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
shared_ptr< BaseData > createData() const
linear_func_composition_impl(xyz::polymorphic< FunType > func, const ConstMatrixRef A)
StageFunctionDataTpl< Scalar > BaseData
xyz::polymorphic< FunType > func
typename FunType::Scalar Scalar
linear_func_composition_impl(xyz::polymorphic< FunType > func, const ConstMatrixRef A, const ConstVectorRef b)
Typedefs for math (Eigen vectors, matrices) depending on scalar type.