codac 1.5.6
Loading...
Searching...
No Matches
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"
19
20namespace 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
50
51 Paving& operator=(const Paving& p);
52
56
63
70
77
84
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
Multi-dimensional paving as representation of a set.
Definition codac_Paving.h:30
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.
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_root()
Returns a pointer to the root of the paving structure.
void bisect(float ratio=0.49)
Bisects this paving into two subpavings with some ratio bisection.
Paving(const IntervalVector &box, SetValue value=SetValue::UNKNOWN)
Creates a paving.
const Paving * get_first_subpaving() const
Points to the first subpaving of the binary tree implementing this paving set.
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.
Paving * get_second_subpaving()
Points to the second subpaving of the binary tree implementing this paving set.
Paving * get_first_leaf(SetValue val, bool without_flag=false)
Points to the first leaf of the specified value.
bool is_leaf() const
Returns true if this paving is made of two subpavings.
Paving * m_second_subpaving
tree structure
Definition codac_Paving.h:220
const Paving * get_first_leaf(SetValue val, bool without_flag=false) const
Points to the first leaf of the paving structure.
const Paving * get_second_subpaving() const
Points to the second subpaving of the binary tree implementing this paving set.
Paving * m_root
pointer to the root
Definition codac_Paving.h:219
~Paving()
Paving destructor.
Paving * get_first_subpaving()
Points to the first subpaving of the binary tree implementing this paving set.
void reset_flags() const
Removes the flags of this Paving and all its children.
void reset_paving(SetValue value=SetValue::UNKNOWN)
Same as building a new Paving object.
bool m_flag
optional flag, can be used by search algorithms
Definition codac_Paving.h:218
bool flag() const
Tests whether this paving has been flagged or not.
const Paving * get_root() const
Returns a pointer to the root of the paving structure.
void set_flag() const
Flags this paving and all its children.
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.
Multi-dimensional interval-based representation of a set.
Definition codac_Set.h:67
SetValue value() const
Returns the value of this set.
const IntervalVector & box() const
Returns the n-dimensional box representing this set.
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition codac_capd_helpers.h:9
SetValue
Defines a set of feasible values of a set.
Definition codac_Set.h:27
@ DEFAULT
does not have a meaning, only used for default values of arguments
@ UNKNOWN
unable to conclude
@ IN
inside the solution set
@ OUT
outside the solution set