codac
codac_Paving.h
Go to the documentation of this file.
1 
12 #ifndef __CODAC_PAVING_H__
13 #define __CODAC_PAVING_H__
14 
15 #include <list>
16 #include <vector>
17 #include "codac_Set.h"
18 #include "codac_ConnectedSubset.h"
19 
20 namespace codac
21 {
29  class Paving : public Set
30  {
31  public:
32 
35 
42  Paving(const IntervalVector& box, SetValue value = SetValue::UNKNOWN);
43 
44  Paving(const Paving& p);
45 
49  ~Paving();
50 
51  Paving& operator=(const Paving& p);
52 
56 
63 
69  const Paving* get_first_subpaving() const;
70 
77 
83  const Paving* get_second_subpaving() const;
84 
90  Paving* get_root();
91 
97  const Paving* get_root() const;
98 
106  Paving* get_first_leaf(SetValue val, bool without_flag = false);
107 
115  const Paving* get_first_leaf(SetValue val, bool without_flag = false) const;
116 
124  void bisect(float ratio = 0.49);
125 
131  bool is_leaf() const;
132 
136 
142  bool flag() const;
143 
147  void set_flag() const;
148 
152  void reset_flags() const;
153 
160 
164 
172  void get_boxes(std::list<IntervalVector>& l_subpavings, SetValue val, SetValue neg_val = SetValue::DEFAULT) const;
173 
184  const IntervalVector& box_to_intersect,
185  std::vector<const Paving*>& v_subpavings,
186  bool no_degenerated_intersection = false) const;
187 
195  void get_neighbours(std::vector<const Paving*>& v_neighbours,
196  SetValue val = SetValue::IN | SetValue::OUT | SetValue::UNKNOWN, // all by default
197  bool without_flag = false) const;
198 
212  std::vector<ConnectedSubset> get_connected_subsets(bool sort_by_size = false, SetValue val = SetValue::UNKNOWN | SetValue::IN) const;
213 
215 
216  public:
217 
218  mutable bool m_flag = false;
219  Paving *m_root = nullptr;
220  Paving *m_first_subpaving = nullptr, *m_second_subpaving = nullptr;
221  };
222 }
223 
224 #endif
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9
void reset_paving(SetValue value=SetValue::UNKNOWN)
Same as building a new Paving object.
SetValue value() const
Returns the value of this set.
bool flag() const
Tests whether this paving has been flagged or not.
Paving * m_root
pointer to the root
Definition: codac_Paving.h:219
bool m_flag
optional flag, can be used by search algorithms
Definition: codac_Paving.h:218
void reset_flags() const
Removes the flags of this Paving and all its children.
void get_pavings_intersecting(SetValue val, const IntervalVector &box_to_intersect, std::vector< const Paving *> &v_subpavings, bool no_degenerated_intersection=false) const
Returns a set of Paving leaves of some value and intersecting a given box.
Paving * get_first_leaf(SetValue val, bool without_flag=false)
Points to the first leaf of the specified value.
unable to conclude
SetValue
Defines a set of feasible values of a set.
Definition: codac_Set.h:26
Paving * get_first_subpaving()
Points to the first subpaving of the binary tree implementing this paving set.
const IntervalVector & box() const
Returns the n-dimensional box representing this set.
Paving(const IntervalVector &box, SetValue value=SetValue::UNKNOWN)
Creates a paving.
Paving * get_second_subpaving()
Points to the second subpaving of the binary tree implementing this paving set.
Multi-dimensional interval-based representation of a set.
Definition: codac_Set.h:66
~Paving()
Paving destructor.
void set_flag() const
Flags this paving and all its children.
std::vector< ConnectedSubset > get_connected_subsets(bool sort_by_size=false, SetValue val=SetValue::UNKNOWN|SetValue::IN) const
Returns the set of connected subsets of this paving.
void get_neighbours(std::vector< const Paving *> &v_neighbours, SetValue val=SetValue::IN|SetValue::OUT|SetValue::UNKNOWN, bool without_flag=false) const
Returns the neighbors (adjacent items) of this Paving, having some value.
Paving * get_root()
Returns a pointer to the root of the paving structure.
Paving * m_second_subpaving
tree structure
Definition: codac_Paving.h:220
inside the solution set
void bisect(float ratio=0.49)
Bisects this paving into two subpavings with some ratio bisection.
outside the solution set
void get_boxes(std::list< IntervalVector > &l_subpavings, SetValue val, SetValue neg_val=SetValue::DEFAULT) const
Returns a set of boxes leaves of some value.
does not have a meaning, only used for default values of arguments
Multi-dimensional paving as representation of a set.
Definition: codac_Paving.h:29
bool is_leaf() const
Returns true if this paving is made of two subpavings.