codac 1.5.6
Loading...
Searching...
No Matches
codac_QInterProjF.h
1//============================================================================
2// I B E X
3// File : Q-intersection contracto
4// Author : Clément Carbonnel, Benoit Desrochers
5// Copyright : Ecole des Mines de Nantes (France)
6// License : See the LICENSE file
7// Created : Apr 30, 2012
8// Last Update : Apr 30, 2012
9//============================================================================
10
11#ifndef __IBEX_CTC_Q_INTER_2_H__
12#define __IBEX_CTC_Q_INTER_2_H__
13
14#include "ibex_Ctc.h"
15#include "ibex_Sep.h"
16#include "ibex_Array.h"
17#include "ibex_IntervalMatrix.h"
18
19using ibex::IntervalVector;
20using ibex::IntervalMatrix;
21using ibex::Array;
22using ibex::Ctc;
23using ibex::Sep;
24using ibex::Interval;
25
26
27
28namespace codac {
29
30
31IntervalVector qinter_projf(const Array<IntervalVector>& _boxes, int q);
32
38class CtcQInterProjF : public Ctc {
39public:
47 CtcQInterProjF(const Array<Ctc>& list, int q);
48
54 virtual void contract(IntervalVector& box);
55
59 Array<Ctc> list;
60
65 int q;
66
67protected:
72 IntervalMatrix boxes;
73};
74
75
76class SepQInterProjF : public Sep {
77public:
85 SepQInterProjF(const Array<Sep>& list, int q = 0);
86
87
94 virtual void separate(IntervalVector& xin, IntervalVector& xout);
95
96
102 void set_q(int q);
103
108 int get_q();
109
110protected:
111
115 Array<Sep> list;
116
120 IntervalMatrix boxes_in;
124 IntervalMatrix boxes_out;
125
130 int q;
131
132};
133
134/* ============================================================================
135 inline implementation
136 ============================================================================*/
137
138inline CtcQInterProjF::CtcQInterProjF(const Array<Ctc>& list, int q) :
139 Ctc(list), list(list), q(q), boxes(list.size(), nb_var) { }
140
141inline SepQInterProjF::SepQInterProjF(const Array<Sep>& list, int q) :
142 Sep(list[0].nb_var),
143 list(list),
144 boxes_in(list.size(), list[0].nb_var),
145 boxes_out(list.size(), list[0].nb_var)
146 { this->set_q(q); }
147
148
149inline void SepQInterProjF::set_q(int q){
150 assert (q >= 0 || q < list.size());
151 this->q = q;
152}
153
154inline int SepQInterProjF::get_q(){ return q; }
155
156
157
158} // end namespace pyibex
159#endif // __IBEX_CTC_Q_INTER_2_H__
Q-intersection contractor.
Definition codac_QInterProjF.h:38
IntervalMatrix boxes
store boxes for each contraction
Definition codac_QInterProjF.h:72
Array< Ctc > list
Definition codac_QInterProjF.h:59
int q
The number of contractors we have to intersect the result.
Definition codac_QInterProjF.h:65
CtcQInterProjF(const Array< Ctc > &list, int q)
q-intersection on a list of contractors.
Definition codac_QInterProjF.h:138
virtual void contract(IntervalVector &box)
Contract the box.
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition codac_capd_helpers.h:9