12 #ifndef __CODAC_CTCUNION_H__ 13 #define __CODAC_CTCUNION_H__ 21 class MultiCtc :
public Ctc
25 MultiCtc(
int nb_var) : Ctc(nb_var)
29 MultiCtc(
const C1& c1) : Ctc(c1.nb_var)
31 add_shared_ptr(std::make_shared<C1>(c1));
34 template<
typename C1,
typename... C>
35 MultiCtc(
const C1& c1,
const C&... c) : MultiCtc(c1)
37 (add_shared_ptr(std::make_shared<C>(c)), ...);
38 for(
const auto& ci : _v_ctc) { assert(ci->nb_var == nb_var); }
42 void add_shared_ptr(std::shared_ptr<T> shrd_ptr)
44 _v_ctc.push_back(shrd_ptr);
45 _v_ctc_ptrs.push_back(shrd_ptr.get());
48 void add_raw_ptr(Ctc *c)
50 _v_ctc_ptrs.push_back(c);
55 std::vector<std::shared_ptr<Ctc>> _v_ctc;
56 std::vector<Ctc*> _v_ctc_ptrs;
59 class CtcUnion :
public MultiCtc
63 CtcUnion(
int nb_var) : MultiCtc(nb_var)
67 CtcUnion(
const C1& c1) : MultiCtc(c1)
70 template<
typename C1,
typename... C>
71 CtcUnion(
const C1& c1,
const C&... c) : MultiCtc(c1, c...)
74 void contract(IntervalVector& x)
76 IntervalVector result(nb_var, Interval::empty_set());
78 for(
auto& ci : _v_ctc_ptrs)
80 IntervalVector saved_x = x;
81 ci->contract(saved_x);
89 CtcUnion& operator|=(
const C& c)
91 assert(c.nb_var == nb_var);
92 add_shared_ptr(std::make_shared<C>(c));
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9