19 template<
typename... X>
20 class CtcInter :
public Ctc<CtcInter<X...>,X...>
24 explicit CtcInter(Index n)
25 : Ctc<CtcInter<X...>,X...>(n)
27 if constexpr(std::is_same_v<X...,Interval>)
34 requires (IsCtcBaseOrPtr<C,X...> && !std::is_same_v<CtcInter<X...>,C>)
36 : Ctc<CtcInter<X...>,X...>(size_of(c)), _ctcs(c)
39 template<
typename... C>
40 requires (IsCtcBaseOrPtr<C,X...> && ...)
41 CtcInter(
const C&... c)
42 : Ctc<CtcInter<X...>,X...>(size_first_item(c...)), _ctcs(c...)
44 assert_release(all_same_size(c...));
53 void contract_impl(X_& x)
const
55 for(
const auto& ci : _ctcs)
63 void contract(X&... x)
const
70 requires IsCtcBaseOrPtr<C,X...>
71 CtcInter<X...>& operator&=(
const C& c)
73 assert_release(size_of(c) == this->size());
80 Collection<CtcBase<X...>> _ctcs;
84 class CtcInter<> :
public CtcInter<IntervalVector>
87 template<
typename Tuple>
90 template<
typename... T>
91 struct CtcInterType<std::tuple<T...>> {
92 using Ctc = CtcInter<T...>;
95 template<
typename C1,
typename C2>
96 typename CtcInterType<typename C1::ContractedTypes>::Ctc operator&(
const C1& c1,
const C2& c2)
101 template<
typename C1,
typename C2>
102 typename CtcInterType<typename C1::ContractedTypes>::Ctc operator&(
const std::shared_ptr<C1>& c1,
const std::shared_ptr<C2>& c2)
107 template<
typename C1,
typename C2>
108 typename CtcInterType<typename C1::ContractedTypes>::Ctc operator&(
const std::shared_ptr<C1>& c1,
const C2& c2)
113 template<
typename C1,
typename C2>
114 typename CtcInterType<typename C1::ContractedTypes>::Ctc operator&(
const C1& c1,
const std::shared_ptr<C2>& c2)
119 template<
typename C2>
120 requires std::is_base_of_v<CtcBase<IntervalVector>,C2>
121 inline CtcInter<IntervalVector> operator&(
const IntervalVector& c1,
const C2& c2)
123 assert_release(c1.size() == c2.size());
124 return CtcInter<IntervalVector>(CtcWrapper(c1),c2);
127 template<
typename C1>
128 requires std::is_base_of_v<CtcBase<IntervalVector>,C1>
129 inline CtcInter<IntervalVector> operator&(
const C1& c1,
const IntervalVector& c2)
131 assert_release(c1.size() == c2.size());
132 return CtcInter<IntervalVector>(c1,CtcWrapper(c2));
136 CtcInter(Index) -> CtcInter<IntervalVector>;
Definition codac2_OctaSym.h:21
Eigen::Matrix< Interval,-1, 1 > IntervalVector
Alias for a dynamic-size column vector of intervals.
Definition codac2_IntervalVector.h:25