12 using Scalar =
typename FunType::Scalar;
28 const ConstVectorRef
b)
34 if (
A.rows() !=
b.rows()) {
37 if (
A.cols() !=
func->nr) {
46 return std::make_shared<Data>(*
this);
51template <
typename _Scalar>
67 void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
68 const ConstVectorRef &y,
BaseData &data)
const;
71 const ConstVectorRef &y,
BaseData &data)
const;
74template <
typename _Scalar>
95 data.value_.noalias() +=
A * d.sub_data->value_;
102 data.jac_buffer_.noalias() =
A * d.sub_data->jac_buffer_;
107template <
typename Scalar>
109 const typename math_types<Scalar>::ConstMatrixRef A,
110 const typename math_types<Scalar>::ConstVectorRef b) {
111 return std::make_shared<LinearFunctionCompositionTpl<Scalar>>(func, A, b);
115template <
typename Scalar>
117 const typename math_types<Scalar>::ConstMatrixRef A,
118 const typename math_types<Scalar>::ConstVectorRef b) {
119 return std::make_shared<LinearUnaryFunctionCompositionTpl<Scalar>>(func, A,
125#include "aligator/modelling/linear-function-composition.hxx"
#define ALIGATOR_RUNTIME_ERROR(msg)
Base definitions for ternary functions.
auto linear_compose(shared_ptr< 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.
typename Impl::FunType Base
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, BaseData &data) const
Evaluate the function.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, BaseData &data) const
Compute Jacobians of this function.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
ALIGATOR_UNARY_FUNCTION_INTERFACE(Scalar)
shared_ptr< FunType > func
void evaluate(const ConstVectorRef &x, BaseData &data) const
virtual void evaluate(const ConstVectorRef &x, Data &data) const =0
virtual void computeJacobians(const ConstVectorRef &x, Data &data) const =0
shared_ptr< BaseData > sub_data
Data(const linear_func_composition_impl &ptr)
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
shared_ptr< FunType > func
shared_ptr< BaseData > createData() const
typename FunType::Scalar Scalar
linear_func_composition_impl(shared_ptr< FunType > func, const ConstMatrixRef A, const ConstVectorRef b)
linear_func_composition_impl(shared_ptr< FunType > func, const ConstMatrixRef A)