codac

Multidimensional paving as representation of a set. More...
#include <codac_Paving.h>
Public Member Functions  
Basics  
Paving (const IntervalVector &box, SetValue value=SetValue::UNKNOWN)  
Creates a paving. More...  
~Paving ()  
Paving destructor.  
Binary tree structure  
Paving *  get_first_subpaving () 
Points to the first subpaving of the binary tree implementing this paving set. More...  
const Paving *  get_first_subpaving () const 
Points to the first subpaving of the binary tree implementing this paving set. More...  
Paving *  get_second_subpaving () 
Points to the second subpaving of the binary tree implementing this paving set. More...  
const Paving *  get_second_subpaving () const 
Points to the second subpaving of the binary tree implementing this paving set. More...  
Paving *  get_root () 
Returns a pointer to the root of the paving structure. More...  
const Paving *  get_root () const 
Returns a pointer to the root of the paving structure. More...  
Paving *  get_first_leaf (SetValue val, bool without_flag=false) 
Points to the first leaf of the specified value. More...  
const Paving *  get_first_leaf (SetValue val, bool without_flag=false) const 
Points to the first leaf of the paving structure. More...  
void  bisect (float ratio=0.49) 
Bisects this paving into two subpavings with some ratio bisection. More...  
bool  is_leaf () const 
Returns true if this paving is made of two subpavings. More...  
Flags  
bool  flag () const 
Tests whether this paving has been flagged or not. More...  
void  set_flag () const 
Flags this paving and all its children.  
void  reset_flags () const 
Removes the flags of this Paving and all its children.  
Extract methods  
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. More...  
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. More...  
void  get_neighbours (std::vector< const Paving *> &v_neighbours, SetValue val=SetValue::INSetValue::OUTSetValue::UNKNOWN, bool without_flag=false) const 
Returns the neighbors (adjacent items) of this Paving, having some value. More...  
std::vector< ConnectedSubset >  get_connected_subsets (bool sort_by_size=false) const 
Returns the set of connected subsets of this paving. More...  
Public Member Functions inherited from codac::Set  
Set (const IntervalVector &box, SetValue value=SetValue::UNKNOWN)  
Creates a set. More...  
~Set ()  
Set destructor.  
SetValue  value () const 
Returns the value of this set. More...  
int  size () const 
Returns the dimension of the paving. More...  
const IntervalVector &  box () const 
Returns the ndimensional box representing this set. More...  
void  set_value (SetValue value) 
Sets the integer value for this set. More...  
Protected Attributes  
bool  m_flag 
optional flag, can be used by search algorithms  
Paving *  m_root = nullptr 
pointer to the root  
Paving *  m_second_subpaving = nullptr 
tree structure  
Protected Attributes inherited from codac::Set  
SetValue  m_value 
integer value of this set  
IntervalVector  m_box 
box representing this set  
Multidimensional paving as representation of a set.
The paving is made of a set of multidimensional boxes. The implementation of this paving is made as a binary tree.
codac::Paving::Paving  (  const IntervalVector &  box, 
SetValue  value = SetValue::UNKNOWN 

) 
Creates a paving.
box  ndimensional box defining the paving 
value  integer of the set, SetValue::UNKNOWN by default 
Paving* codac::Paving::get_first_subpaving  (  ) 
Points to the first subpaving of the binary tree implementing this paving set.
const Paving* codac::Paving::get_first_subpaving  (  )  const 
Points to the first subpaving of the binary tree implementing this paving set.
Paving* codac::Paving::get_second_subpaving  (  ) 
Points to the second subpaving of the binary tree implementing this paving set.
const Paving* codac::Paving::get_second_subpaving  (  )  const 
Points to the second subpaving of the binary tree implementing this paving set.
Paving* codac::Paving::get_root  (  ) 
Returns a pointer to the root of the paving structure.
const Paving* codac::Paving::get_root  (  )  const 
Returns a pointer to the root of the paving structure.
Points to the first leaf of the specified value.
val  the value of the leaf we are looking for 
without_flag  optional research mode: select the first leaf among nonflagged items only 
Points to the first leaf of the paving structure.
val  the value of the leaf we are looking for 
without_flag  optional research mode: select the first leaf among nonflagged items only 
void codac::Paving::bisect  (  float  ratio = 0.49  ) 
Bisects this paving into two subpavings with some ratio bisection.
Will create two nodes in the binary tree implementing this set.
ratio  the bisection ratio (default value: 0.49) 
bool codac::Paving::is_leaf  (  )  const 
Returns true if this paving is made of two subpavings.
true
if this is a leaf, false
otherwise bool codac::Paving::flag  (  )  const 
Tests whether this paving has been flagged or not.
true
if flagged void codac::Paving::get_boxes  (  std::list< IntervalVector > &  l_subpavings, 
SetValue  val,  
SetValue  neg_val = SetValue::DEFAULT 

)  const 
Returns a set of boxes leaves of some value.
l_subpavings  the set of returned objects 
val  the value of the leaves (boxes of the paving) we are looking for 
neg_val  the value for which we reject the leaves, optional argument used for faster execution along the tree 
void codac::Paving::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.
val  the value of the leaves we are looking for 
box_to_intersect  the box the returned leaves will intersect 
v_subpavings  the set of returned objects 
no_degenerated_intersection  if true , then the objects for which the intersection amounts to a point will not be returned 
void codac::Paving::get_neighbours  (  std::vector< const Paving *> &  v_neighbours, 
SetValue  val = SetValue::INSetValue::OUTSetValue::UNKNOWN , 

bool  without_flag = false 

)  const 
Returns the neighbors (adjacent items) of this Paving, having some value.
v_neighbours  the set of leaves to be returned 
val  optional value of the leaves we are looking for, 1 for no restriction 
without_flag  optional research mode: select the leaves among nonflagged items only 
std::vector<ConnectedSubset> codac::Paving::get_connected_subsets  (  bool  sort_by_size = false  )  const 
Returns the set of connected subsets of this paving.
A connected subset is a topological space that cannot be represented as the union of two or more disjoint nonempty open subsets.
sort_by_size  (optional) if true then the subsets will be sort by the number of boxes they are made of 