typedef mute< parent_type, bool >::ret | level_roots_image_type |
The type of an image of level roots. | |
unsigned | n_level_roots1 () const |
unsigned | n_level_roots2 () const |
level_roots_image_type | level_roots () const |
Compute the image of level roots. | |
typedef mute< parent_type, bool >::ret | level_roots_image_type |
The type of an image of level roots. | |
unsigned | n_level_roots1 () const |
unsigned | n_level_roots2 () const |
level_roots_image_type | level_roots () const |
Compute the image of level roots. | |
typedef mute< parent_type, bool >::ret | level_roots_image_type |
The type of an image of level roots. | |
unsigned | n_level_roots1 () const |
unsigned | n_level_roots2 () const |
level_roots_image_type | level_roots () const |
Compute the image of level roots. | |
Public Member Functions | |
fiorio (const abstract::image< I > &ima) | |
void | go () |
Entry point of the algorithm. | |
fiorio (const abstract::image< I > &ima) | |
void | go () |
Entry point of the algorithm. | |
fiorio (const abstract::image< I > &ima) | |
void | go () |
Entry point of the algorithm. | |
const I & | ima () const |
const parent_type & | parent () const |
const I & | ima () const |
const parent_type & | parent () const |
const I & | ima () const |
const parent_type & | parent () const |
Protected Member Functions | |
void | scan_line () |
void | build_tree_of_line (coord row) |
void | merge_line (coord row) |
void | merge (const point &p, const point &q) |
| |
bool | is_top (const point &p) const |
| |
bool | is_level_root (const point &p) const |
point | find_level_root (const point &p) |
Find the level root of the component that P belongs to. | |
void | scan_line () |
void | build_tree_of_line (coord row) |
void | merge_line (coord row) |
void | insert (const point &p, const point &n) |
Insert p in a tree of which n is a neighbor of p. | |
void | merge (const point &p, const point &q) |
Front-end to merge_. | |
void | merge_ (const point &p, const point &q) |
bool | is_top (const point &p) const |
| |
bool | is_level_root (const point &p) const |
point | find_level_root (const point &p) |
Find the level root of the component that P belongs to. | |
point | find_ancestor (point p, const value &level) |
void | scan_line () |
void | build_tree_of_line (coord row) |
void | insert (const point &p, const point &n) |
Insert p in a tree of which n is a neighbor of p. | |
void | merge (const point &p, const point &q) |
Front-end to merge_. | |
void | merge_ (const point &p, const point &q) |
bool | is_top (const point &p) const |
| |
point | find_top (point p) const |
bool | is_level_root (const point &p) const |
point | find_level_root (const point &p) |
Find the level root of the component that P belongs to. | |
point | find_ancestor (point p, const value &level) |
Protected Attributes | |
I | ima_ |
| |
parent_type | parent_ |
| |
unsigned | n_level_roots_cpt_ |
Definition at line 57 of file fiorio-1.hh.
const I& oln::lrde::ufmt::fiorio< I >::ima | ( | ) | const [inline] |
Images accessors.
Definition at line 86 of file fiorio-1.hh.
References oln::lrde::ufmt::fiorio< I >::ima_.
00087 { 00088 return ima_; 00089 }
unsigned oln::lrde::ufmt::fiorio< I >::n_level_roots1 | ( | ) | const [inline] |
Level roots.
Get the number of level roots (method 1, using a counter updated by the algorithm).
Definition at line 102 of file fiorio-1.hh.
References oln::lrde::ufmt::fiorio< I >::n_level_roots_cpt_.
00103 { 00104 return n_level_roots_cpt_; 00105 }
unsigned oln::lrde::ufmt::fiorio< I >::n_level_roots2 | ( | ) | const [inline] |
Get the number of level roots (method 2, computing from the PARENT image.
Definition at line 109 of file fiorio-1.hh.
References oln::lrde::ufmt::fiorio< I >::is_level_root(), oln::lrde::ufmt::n_level_roots(), and oln::lrde::ufmt::fiorio< I >::parent_.
00110 { 00111 unsigned n_level_roots = 0; 00112 oln_iter_type(parent_type) p(parent_); 00113 for_all (p) 00114 if (is_level_root(p)) 00115 ++n_level_roots; 00116 return n_level_roots; 00117 }
level_roots_image_type oln::lrde::ufmt::fiorio< I >::level_roots | ( | ) | const [inline] |
Compute the image of level roots.
A value of true means that the point is a level root in ima.
Definition at line 125 of file fiorio-1.hh.
References oln::lrde::ufmt::fiorio< I >::ima_, and oln::lrde::ufmt::fiorio< I >::is_level_root().
Referenced by oln::lrde::ufmt::fiorio< I >::level_roots().
00126 { 00127 // Image of level roots. 00128 level_roots_image_type level_roots (ima_.size()); 00129 oln_iter_type(parent_type) p(ima_); 00130 for_all (p) 00131 level_roots[p] = is_level_root(p); 00132 return level_roots; 00133 }
point oln::lrde::ufmt::fiorio< I >::find_level_root | ( | const point & | p | ) | [inline, protected] |
Find the level root of the component that P belongs to.
Based on find_compress.
Definition at line 234 of file fiorio-1.hh.
References oln::lrde::ufmt::fiorio< I >::is_level_root(), oln::lrde::ufmt::fiorio< I >::is_top(), and oln::lrde::ufmt::fiorio< I >::parent_.
Referenced by oln::lrde::ufmt::fiorio< I >::build_tree_of_line(), oln::lrde::ufmt::fiorio< I >::find_ancestor(), oln::lrde::ufmt::fiorio< I >::find_level_root(), oln::lrde::ufmt::fiorio< I >::merge(), and oln::lrde::ufmt::fiorio< I >::merge_().
00235 { 00236 // Path compression. 00237 if (not is_top(p)) 00238 parent_[p] = find_level_root(parent_[p]); 00239 // Is P a level root at the end the routine? 00240 if (is_level_root(p)) 00241 return p; 00242 else 00243 return parent_[p]; 00244 }
const I& oln::lrde::ufmt::fiorio< I >::ima | ( | ) | const [inline] |
Images accessors.
Definition at line 85 of file fiorio-2.hh.
References oln::lrde::ufmt::fiorio< I >::ima_.
00086 { 00087 return ima_; 00088 }
unsigned oln::lrde::ufmt::fiorio< I >::n_level_roots1 | ( | ) | const [inline] |
Level roots.
Get the number of level roots (method 1, using a counter updated by the algorithm).
Definition at line 101 of file fiorio-2.hh.
References oln::lrde::ufmt::fiorio< I >::n_level_roots_cpt_.
00102 { 00103 return n_level_roots_cpt_; 00104 }
unsigned oln::lrde::ufmt::fiorio< I >::n_level_roots2 | ( | ) | const [inline] |
Get the number of level roots (method 2, computing from the PARENT image.
Definition at line 108 of file fiorio-2.hh.
References oln::lrde::ufmt::fiorio< I >::is_level_root(), oln::lrde::ufmt::n_level_roots(), and oln::lrde::ufmt::fiorio< I >::parent_.
00109 { 00110 unsigned n_level_roots = 0; 00111 oln_iter_type(parent_type) p(parent_); 00112 for_all (p) 00113 if (is_level_root(p)) 00114 ++n_level_roots; 00115 return n_level_roots; 00116 }
level_roots_image_type oln::lrde::ufmt::fiorio< I >::level_roots | ( | ) | const [inline] |
Compute the image of level roots.
A value of true means that the point is a level root in ima.
Definition at line 124 of file fiorio-2.hh.
References oln::lrde::ufmt::fiorio< I >::ima_, oln::lrde::ufmt::fiorio< I >::is_level_root(), and oln::lrde::ufmt::fiorio< I >::level_roots().
00125 { 00126 // Image of level roots. 00127 level_roots_image_type level_roots (ima_.size()); 00128 oln_iter_type(parent_type) p(ima_); 00129 for_all (p) 00130 level_roots[p] = is_level_root(p); 00131 return level_roots; 00132 }
void oln::lrde::ufmt::fiorio< I >::merge | ( | const point & | p, | |
const point & | q | |||
) | [inline, protected] |
Front-end to merge_.
Definition at line 199 of file fiorio-2.hh.
References oln::lrde::ufmt::fiorio< I >::ima_, and oln::lrde::ufmt::fiorio< I >::merge_().
00200 { 00201 // The \a merge_ routine assumes that P has a value greater 00202 // or equal to Q; swap them if needed. 00203 if (ima_[p] >= ima_[q]) 00204 merge_(p, q); 00205 else 00206 merge_(q, p); 00207 }
point oln::lrde::ufmt::fiorio< I >::find_level_root | ( | const point & | p | ) | [inline, protected] |
Find the level root of the component that P belongs to.
Definition at line 293 of file fiorio-2.hh.
References oln::lrde::ufmt::fiorio< I >::find_level_root(), oln::lrde::ufmt::fiorio< I >::is_level_root(), and oln::lrde::ufmt::fiorio< I >::parent_.
00294 { 00295 // Is P a level root at the end the routine? 00296 if (is_level_root(p)) 00297 return p; 00298 else 00299 // Path compression. 00300 return parent_[p] = find_level_root(parent_[p]); 00301 }
point oln::lrde::ufmt::fiorio< I >::find_ancestor | ( | point | p, | |
const value & | level | |||
) | [inline, protected] |
Theo calls this method ``anc''.
Definition at line 305 of file fiorio-2.hh.
References oln::lrde::ufmt::fiorio< I >::find_level_root(), oln::lrde::ufmt::fiorio< I >::ima_, oln::lrde::ufmt::fiorio< I >::is_top(), and oln::lrde::ufmt::fiorio< I >::parent_.
Referenced by oln::lrde::ufmt::fiorio< I >::insert(), and oln::lrde::ufmt::fiorio< I >::merge_().
00306 { 00307 while (not is_top(p) and ima_[parent_[p]] >= level) 00308 p = find_level_root(parent_[p]); 00309 return p; 00310 }
const I& oln::lrde::ufmt::fiorio< I >::ima | ( | ) | const [inline] |
Images accessors.
Definition at line 86 of file fiorio-3.hh.
References oln::lrde::ufmt::fiorio< I >::ima_.
00087 { 00088 return ima_; 00089 }
unsigned oln::lrde::ufmt::fiorio< I >::n_level_roots1 | ( | ) | const [inline] |
Level roots.
Get the number of level roots (method 1, using a counter updated by the algorithm).
Definition at line 102 of file fiorio-3.hh.
References oln::lrde::ufmt::fiorio< I >::n_level_roots_cpt_.
00103 { 00104 return n_level_roots_cpt_; 00105 }
unsigned oln::lrde::ufmt::fiorio< I >::n_level_roots2 | ( | ) | const [inline] |
Get the number of level roots (method 2, computing from the PARENT image.
Definition at line 109 of file fiorio-3.hh.
References oln::lrde::ufmt::fiorio< I >::is_level_root(), oln::lrde::ufmt::n_level_roots(), and oln::lrde::ufmt::fiorio< I >::parent_.
00110 { 00111 unsigned n_level_roots = 0; 00112 oln_iter_type(parent_type) p(parent_); 00113 for_all (p) 00114 if (is_level_root(p)) 00115 ++n_level_roots; 00116 return n_level_roots; 00117 }
level_roots_image_type oln::lrde::ufmt::fiorio< I >::level_roots | ( | ) | const [inline] |
Compute the image of level roots.
A value of true means that the point is a level root in ima.
Definition at line 125 of file fiorio-3.hh.
References oln::lrde::ufmt::fiorio< I >::ima_, oln::lrde::ufmt::fiorio< I >::is_level_root(), and oln::lrde::ufmt::fiorio< I >::level_roots().
00126 { 00127 // Image of level roots. 00128 level_roots_image_type level_roots (ima_.size()); 00129 oln_iter_type(parent_type) p(ima_); 00130 for_all (p) 00131 level_roots[p] = is_level_root(p); 00132 return level_roots; 00133 }
void oln::lrde::ufmt::fiorio< I >::merge | ( | const point & | p, | |
const point & | q | |||
) | [inline, protected] |
Front-end to merge_.
Definition at line 183 of file fiorio-3.hh.
References oln::lrde::ufmt::fiorio< I >::ima_, and oln::lrde::ufmt::fiorio< I >::merge_().
00184 { 00185 // The \a merge_ routine assumes that P has a value greater 00186 // or equal to Q; swap them if needed. 00187 if (ima_[p] >= ima_[q]) 00188 merge_(p, q); 00189 else 00190 merge_(q, p); 00191 }
point oln::lrde::ufmt::fiorio< I >::find_level_root | ( | const point & | p | ) | [inline, protected] |
Find the level root of the component that P belongs to.
Definition at line 246 of file fiorio-3.hh.
References oln::lrde::ufmt::fiorio< I >::find_level_root(), oln::lrde::ufmt::fiorio< I >::is_level_root(), and oln::lrde::ufmt::fiorio< I >::parent_.
00247 { 00248 // Is P a level root at the end the routine? 00249 if (is_level_root(p)) 00250 return p; 00251 else 00252 // Path compression. 00253 return parent_[p] = find_level_root(parent_[p]); 00254 }
point oln::lrde::ufmt::fiorio< I >::find_ancestor | ( | point | p, | |
const value & | level | |||
) | [inline, protected] |
Theo calls this method ``anc''.
Definition at line 258 of file fiorio-3.hh.
References oln::lrde::ufmt::fiorio< I >::find_level_root(), oln::lrde::ufmt::fiorio< I >::ima_, oln::lrde::ufmt::fiorio< I >::is_top(), and oln::lrde::ufmt::fiorio< I >::parent_.
00259 { 00260 while (not is_top(p) and ima_[parent_[p]] >= level) 00261 p = find_level_root(parent_[p]); 00262 return p; 00263 }