codac
codac_SepCtcPairProj.h
1 //============================================================================
2 // I B E X
3 // File : ibex_SepCtcPairProj.h
4 // Author : Benoit Desrochers
5 // Copyright : Benoit Desrochers
6 // License : See the LICENSE file
7 // Created : May 04, 2015
8 //============================================================================
9 
10 #ifndef __IBEX_SEP_CTCPAIR_PROJ_H__
11 #define __IBEX_SEP_CTCPAIR_PROJ_H__
12 
13 
14 
15 #include <ibex_IntervalVector.h>
16 #include <ibex_SepCtcPair.h>
17 #include <ibex_SepFwdBwd.h>
18 #include <ibex_CtcForAll.h>
19 #include <ibex_CtcExist.h>
20 #include <ibex_SepFwdBwd.h>
21 
22 #include <ibex_BitSet.h>
23 
24 using ibex::Ctc;
25 using ibex::Sep;
26 using ibex::IntervalVector;
27 using ibex::CtcExist;
28 using ibex::CtcForAll;
29 using ibex::BitSet;
30 using ibex::SepCtcPair;
31 using ibex::SepFwdBwd;
32 
33 namespace codac {
34 
40 class CtcFromSep : public Ctc {
41 public:
50  CtcFromSep(Sep &sep, bool return_ctc_in) : Ctc(sep.nb_var), sep(sep), return_ctc_in(return_ctc_in) {}
51 
58  void contract(IntervalVector& x){
59  IntervalVector x_in(x), x_out(x);
60  sep.separate(x_in, x_out);
61  x &= ( (return_ctc_in == true) ? x_in : x_out );
62  }
63 
64 private:
69  Sep& sep;
70 
75  bool return_ctc_in;
76 };
77 
78 
87 class SepCtcPairProj : public Sep {
88 
89 public:
99  SepCtcPairProj(Ctc& ctc_in, Ctc& ctc_out, const IntervalVector& y_init, double prec);
100 
110  SepCtcPairProj(SepCtcPair &sep, const IntervalVector& y_init, double prec);
111 
121  SepCtcPairProj(Sep &sep, const IntervalVector& y_init, double prec);
122 
127  ~SepCtcPairProj();
128 
135  void separate(IntervalVector &x_in, IntervalVector &x_out);
136 
137 protected:
139  Ctc& ctc_in;
141  Ctc& ctc_out;
142 
144  CtcExist *ctcExist;
145 
147  CtcForAll *ctcForAll;
148 
150  IntervalVector y_init;
151 
153  BitSet vars;
154 
155 };
156 
157 } // namespace pyibex
158 
159 #endif // __IBEX_SEP_CTCPAIR_PROJ_H__
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9
CtcFromSep(Sep &sep, bool return_ctc_in)
Construct a new Ctc From Sep object wrt to the value of return_ctc_in it use the result from the sepa...
Definition: codac_SepCtcPairProj.h:50
CtcExist * ctcExist
Definition: codac_SepCtcPairProj.h:144
Ctc & ctc_in
Definition: codac_SepCtcPairProj.h:139
Build a contractor with a separator Wrt the.
Definition: codac_SepCtcPairProj.h:40
void contract(IntervalVector &x)
contract method call separate on the input box [x] and return x_in or x_out
Definition: codac_SepCtcPairProj.h:58
IntervalVector y_init
Definition: codac_SepCtcPairProj.h:150
BitSet vars
Definition: codac_SepCtcPairProj.h:153
Ctc & ctc_out
Definition: codac_SepCtcPairProj.h:141
projection of a separator using ibexlib algorithm
Definition: codac_SepCtcPairProj.h:87
CtcForAll * ctcForAll
Definition: codac_SepCtcPairProj.h:147