38 class OctaSym :
public std::vector<int>,
public Action
86 template<
typename Derived>
87 requires (Derived::ColsAtCompileTime == 1)
88 Mat<typename Derived::Scalar,-1,1>
operator()(
const Eigen::MatrixBase<Derived>& x)
const
90 assert_release(x.size() == (Index)size());
91 Mat<
typename Derived::Scalar,-1,1> x_(x);
92 for(
size_t i = 0 ; i < size() ; i++)
93 x_[i] =
sign((*
this)[i])*x[std::abs((*
this)[i])-1];
104 requires IsCtcBaseOrPtr<C,IntervalVector>
125 std::shared_ptr<SetExpr>
operator()(
const std::shared_ptr<SetExpr>& x1)
const;
129 SampledTraj<T>
operator()(
const SampledTraj<T>& x)
const
132 for(
auto& [ti,yi] : y)
145 requires (std::is_same_v<V,VectorExpr> || std::is_same_v<V,VectorVar>)
146 inline VectorExpr
operator()(
const V& x1)
const
148 if constexpr(std::is_same_v<V,VectorExpr>)
149 assert_release((Index)this->size() == x1->output_shape().first);
151 assert_release((Index)this->size() == x1.output_shape().first);
152 return { std::make_shared<AnalyticOperationExpr<OctaSymOp,VectorType,VectorType>>(*
this, x1) };
165 for(
size_t i = 0 ; i < s.size() ; i++)
166 str << (i != 0 ?
" " :
"") << s[i];
167 str <<
")" << std::flush;
OctaSym operator*(const OctaSym &s) const
Composes the hyperoctahedral symmetry with another one.
OctaSym(const std::vector< int > &s)
Constructs an hyperoctahedral symmetry from a vector of integers. The vector represents the second li...
Matrix permutation_matrix() const
Computes the permutation matrix associated to the hyperoctahedral symmetry.
OctaSym invert() const
Inverts of the hyperoctahedral symmetry.
OctaSym(std::initializer_list< int > s)
Constructs an hyperoctahedral symmetry from a list of integers. The list represents the second line i...
Mat< typename Derived::Scalar,-1, 1 > operator()(const Eigen::MatrixBase< Derived > &x) const
Applies the hyperoctahedral symmetry to a vector.
Definition codac2_OctaSym.h:88
friend std::ostream & operator<<(std::ostream &str, const OctaSym &s)
Overloads the stream insertion operator to print the hyperoctahedral symmetry in a human-readable for...
Definition codac2_OctaSym.h:162
Definition codac2_OctaSym.h:21
Eigen::Matrix< double,-1,-1 > Matrix
Alias for a dynamic-size matrix of doubles.
Definition codac2_Matrix.h:26
Interval sign(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:279