27 bp::class_<FunctionSliceXpr, bp::bases<Base>>(
29 "Represents a slice of an expression according to either a single index "
30 "or an array of indices.",
31 bp::init<xyz::polymorphic<Base>, std::vector<int>
const &>(
32 bp::args(
"self",
"func",
"indices")))
34 .def(bp::init<xyz::polymorphic<Base>,
const int>(
35 "Constructor from a single index.", bp::args(
"self",
"func",
"idx")))
36 .def_readonly(
"func", &FunctionSliceXpr::func,
"Underlying function.")
37 .def_readonly(
"indices", &FunctionSliceXpr::indices,
38 "Indices of the slice.");
76 bp::class_<FunctionSliceData, bp::bases<StageFunctionData>,
77 boost::noncopyable>(
"FunctionSliceData", bp::no_init)
78 .def_readonly(
"sub_data", &FunctionSliceData::sub_data,
79 "Underlying function's data.");
84 using LinearUnaryFunctionComposition =
87 bp::class_<LinearFunctionComposition, bp::bases<StageFunction>>(
88 "LinearFunctionComposition",
89 "Function composition :math:`r(x) = Af(x, u, y) + b`.", bp::no_init)
93 bp::class_<LinearUnaryFunctionComposition, bp::bases<UnaryFunction>>(
94 "LinearUnaryFunctionComposition",
95 "Function composition for unary functions: :math:`r(x) = Af(x) + b`.",
StageFunctionTpl< Scalar > StageFunction
UnaryFunctionTpl< Scalar > UnaryFunction
StageFunctionDataTpl< Scalar > StageFunctionData
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.