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...));
48 void contract_impl(X_& x)
const
50 for(
const auto& ci : _ctcs)
58 void contract(X&... x)
const
65 requires std::is_base_of_v<CtcBase<X...>,C>
66 CtcInter<X...>& operator&=(
const C& c)
68 assert_release(c.size() == this->size());
69 _ctcs.push_object_back(c);
73 CtcInter<X...>& operator&=(
const std::shared_ptr<CtcBase<X...>>& c)
75 assert_release(c->size() == this->size());
82 Collection<CtcBase<X...>> _ctcs;
86 class CtcInter<> :
public CtcInter<IntervalVector>
89 template<
typename Tuple>
92 template<
typename... T>
93 struct CtcInterType<std::tuple<T...>> {
94 using Ctc = CtcInter<T...>;
97 template<
typename C1,
typename C2>
98 typename CtcInterType<typename C1::ContractedTypes>::Ctc operator&(
const C1& c1,
const C2& c2)
103 template<
typename C2>
104 requires std::is_base_of_v<CtcBase<IntervalVector>,C2>
105 inline CtcInter<IntervalVector> operator&(
const IntervalVector& c1,
const C2& c2)
107 assert_release(c1.size() == c2.size());
108 return CtcInter<IntervalVector>(CtcWrapper(c1),c2);
111 template<
typename C1>
112 requires std::is_base_of_v<CtcBase<IntervalVector>,C1>
113 inline CtcInter<IntervalVector> operator&(
const C1& c1,
const IntervalVector& c2)
115 assert_release(c1.size() == c2.size());
116 return CtcInter<IntervalVector>(c1,CtcWrapper(c2));