Site sets are used:
They do not actually store any image value. They only store site information.
Here is a list of all the site set concepts which can be found in core/site_set:
Site set | Description |
p_array | site array. |
p_box | compact domain defined on a regular grid (in 2D, a rectangle). |
p_if | site set verifying a predicate. |
p_queue | site queue. |
p_run | site range. |
p_runs | site range set. |
p_set | mathematical site set. |
p_vaccess | site set ordered by value. |
p_edges | set of graph edges associated to sites. |
p_vertices | set of graph vertices associated to sites. |
All site sets are iterable. More detailed explanations are available in section Iterators .
Return Type | Name | Arguments | Const | Comments |
bool | is_valid | - | X | Returns true if it has been initialized. The default constructor does not initialize it. |
bool | has | const P& p | X |
Return Type | Name | Arguments | Const | Comments |
size_t | nsites | - | - | Return the number of sites. |
const Box& | bbox | - | X | Bounding box. Available only on grid site sets. |
The previous methods are available depending on the site set. A box
will have the bbox() method since it can be retrived in constant time: a box
is it’s own bounding box.
box2d b(2,3); // The bbox can be retrived in constant time. std::cout << b.bbox() << std::endl; // nsites can be retrieved in constant time. std::cout << "nsites = " << b.nsites() << std::endl;
[(0,0)..(1,2)] nsites = 6
A p_array does not have the bbox method since its sites do not have to be adjacent. Maintaining such information, in order to keep getting the bbox in constant time, would be time and memory consuming. Instead of providing a method directly in p_array, an algorithm is available if this information is needed. p_array and box both have a nsites method since the internal structure allows a constant time retrieval.
p_array<point2d> arr; arr.insert(point2d(1,0)); arr.insert(point2d(1,1)); // The bbox is computed thanks to bbox() algorithm. box2d box = geom::bbox(arr); std::cout << box << std::endl; // p_array provides nsites(), // it can be retrieved in constant time. std::cout << "nsites = " << arr.nsites() << std::endl;
[(1,0)..(1,1)] nsites = 2