12template <
typename _Scalar>
26 template <
class Concrete>
inline void addComponent(
const Concrete &c) {
28 std::is_base_of_v<Base, Concrete> ||
29 std::is_same_v<Concrete, xyz::polymorphic<Base>>,
30 "Input type should either be derived from ManifoldAbstractTpl or be "
31 "polymorphic<ManifoldAbstractTpl>.");
39 std::is_base_of_v<Base, Concrete> ||
40 std::is_same_v<Concrete, xyz::polymorphic<Base>>,
41 "Input type should either be derived from ManifoldAbstractTpl or be "
42 "polymorphic<ManifoldAbstractTpl>.");
81 const xyz::polymorphic<Base> &right)
87 template <
class VectorType,
class U = std::remove_const_t<VectorType>>
90 template <
class VectorType,
class U = std::remove_const_t<VectorType>>
93 [[nodiscard]] std::vector<VectorRef>
split(VectorRef x)
const {
97 [[nodiscard]] std::vector<ConstVectorRef>
98 split(
const ConstVectorRef &x)
const {
106 [[nodiscard]] std::vector<ConstVectorRef>
111 [[nodiscard]] VectorXs
merge(
const std::vector<VectorXs> &xs)
const;
113 [[nodiscard]] VectorXs
merge_vector(
const std::vector<VectorXs> &vs)
const;
122 this->
nx_ += c->nx();
123 this->
ndx_ += c->ndx();
127 template <
class Concrete>
static int _get_nx(
const Concrete &c) {
130 template <
class Concrete>
static int _get_ndx(
const Concrete &c) {
133 static int _get_nx(
const xyz::polymorphic<Base> &c) {
return c->nx(); }
134 static int _get_ndx(
const xyz::polymorphic<Base> &c) {
return c->ndx(); }
141 VectorRef out)
const;
144 VectorRef out)
const;
147 MatrixRef Jout,
int arg)
const;
150 const ConstVectorRef &v, MatrixRef Jout,
154 MatrixRef Jout,
int arg)
const;
188#include "aligator/modelling/spaces/cartesian-product.hxx"
xyz::polymorphic< CostStackTpl< T > > operator*(T u, xyz::polymorphic< CostStackTpl< T > > &&c1)
The cartesian product of two or more manifolds.
void addComponent(Concrete &&c)
static int _get_ndx(const xyz::polymorphic< Base > &c)
CartesianProductTpl(const std::vector< xyz::polymorphic< Base > > &components)
CartesianProductTpl(const CartesianProductTpl &)=default
void Jintegrate_impl(const ConstVectorRef &x, const ConstVectorRef &v, MatrixRef Jout, int arg) const
const Base & getComponent(std::size_t i) const
std::vector< U > split_impl(VectorType &x) const
std::vector< VectorRef > split_vector(VectorRef v) const
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
std::size_t numComponents() const
std::vector< VectorRef > split(VectorRef x) const
static int _get_nx(const Concrete &c)
static int _get_ndx(const Concrete &c)
void neutral_impl(VectorRef out) const
void rand_impl(VectorRef out) const
CartesianProductTpl(std::vector< xyz::polymorphic< Base > > &&components)
CartesianProductTpl & operator=(CartesianProductTpl &&)=default
VectorXs merge(const std::vector< VectorXs > &xs) const
bool isNormalized(const ConstVectorRef &x) const
Check if the input vector x is a viable element of the manifold.
static int _get_nx(const xyz::polymorphic< Base > &c)
void difference_impl(const ConstVectorRef &x0, const ConstVectorRef &x1, VectorRef out) const
Implementation of the manifold retraction operation.
VectorXs merge_vector(const std::vector< VectorXs > &vs) const
std::vector< ConstVectorRef > split(const ConstVectorRef &x) const
CartesianProductTpl & operator=(const CartesianProductTpl &)=default
void integrate_impl(const ConstVectorRef &x, const ConstVectorRef &v, VectorRef out) const
Perform the manifold integration operation.
ManifoldAbstractTpl< Scalar > Base
void Jdifference_impl(const ConstVectorRef &x0, const ConstVectorRef &x1, MatrixRef Jout, int arg) const
void JintegrateTransport_impl(const ConstVectorRef &x, const ConstVectorRef &v, MatrixRef Jout, int arg) const
CartesianProductTpl(const xyz::polymorphic< Base > &left, const xyz::polymorphic< Base > &right)
CartesianProductTpl(std::initializer_list< xyz::polymorphic< Base > > components)
void addComponent(const Concrete &c)
std::vector< ConstVectorRef > split_vector(const ConstVectorRef &v) const
void addComponent(const CartesianProductTpl &other)
CartesianProductTpl(CartesianProductTpl &&)=default
std::vector< U > split_vector_impl(VectorType &v) const
std::vector< xyz::polymorphic< Base > > m_components
Base class for manifolds, to use in cost funcs, solvers...
ManifoldAbstractTpl(int nx, int ndx)