#include <p_priority.hh>
Inherits mln::internal::site_set_base_< Q::site, mln::p_priority< P, Q > >.
Public Types | |
typedef p_double_piter< self_, mln_fwd_eiter(util::set< P > ), typename Q::bkd_piter > | bkd_piter |
Backward Site_Iterator associated type. | |
typedef Q::element | element |
Element associated type. | |
typedef p_double_piter< self_, mln_bkd_eiter(util::set< P > ), typename Q::fwd_piter > | fwd_piter |
Forward Site_Iterator associated type. | |
typedef std::pair< P, element > | i_element |
Insertion element associated type. | |
typedef fwd_piter | piter |
Site_Iterator associated type. | |
typedef p_double_psite< self_, Q > | psite |
Psite associated type. | |
Public Member Functions | |
void | clear () |
Clear the queue. | |
bool | exists_priority (const P &priority) const |
Test if the priority exists. | |
const Q::element & | front () const |
Give an element with highest priority. | |
bool | has (const psite &) const |
Test is the psite p belongs to this site set. | |
const P | highest_priority () const |
Give the highest priority. | |
void | insert (const p_priority< P, Q > &other) |
Insert elements from another priority queue. | |
void | insert (const i_element &p_e) |
Insert a pair p_e (priority p, element e). | |
bool | is_valid () const |
Test this set validity so returns always true. | |
const P | lowest_priority () const |
Give the lowest priority. | |
std::size_t | memory_size () const |
Return the size of this site set in memory. | |
unsigned | nsites () const |
Give the number of sites. | |
const Q & | operator() (const P &priority) const |
Give the queue with the priority priority . | |
p_priority () | |
Constructor. | |
void | pop () |
Pop (remove) from the queue an element with highest priority. | |
Q::element | pop_front () |
Return an element with highest priority and remove it from the set. | |
const util::set< P > & | priorities () const |
Give the set of priorities. | |
void | push (const P &priority, const element &e) |
Push in the queue with priority the element e . | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Sl, typename Sr> | |
p_set< typename Sl::site > | diff (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs) |
Set theoretic difference of lhs and rhs . | |
template<typename Sl, typename Sr> | |
p_set< typename Sl::site > | inter (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs) |
Intersection between a couple of point sets. | |
template<typename Sl, typename Sr> | |
bool | operator< (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs) |
Strict inclusion test between site sets lhs and rhs . | |
template<typename S> | |
std::ostream & | operator<< (std::ostream &ostr, const Site_Set< S > &set) |
Print a site set set into the output stream ostr . | |
template<typename Sl, typename Sr> | |
bool | operator<= (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs) |
Inclusion test between site sets lhs and rhs . | |
template<typename Sl, typename Sr> | |
bool | operator== (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs) |
Equality test between site sets lhs and rhs . | |
template<typename Sl, typename Sr> | |
p_set< typename Sl::site > | sym_diff (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs) |
Set theoretic symmetrical difference of lhs and rhs . | |
template<typename Sl, typename Sr> | |
p_set< typename Sl::site > | uni (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs) |
Union of a couple of point sets. | |
template<typename S> | |
p_set< typename S::site > | unique (const Site_Set< S > &s) |
Give the unique set of s . |
The parameter P
is the type of the priorities (for instance unsigned).
The parameter Q
is a type of queue (for instance p_queue<point2d>).
Definition at line 76 of file p_priority.hh.
typedef p_double_piter< self_, mln_fwd_eiter(util::set<P>), typename Q ::bkd_piter > mln::p_priority< P, Q >::bkd_piter |
typedef Q ::element mln::p_priority< P, Q >::element |
typedef p_double_piter< self_, mln_bkd_eiter(util::set<P>), typename Q ::fwd_piter > mln::p_priority< P, Q >::fwd_piter |
typedef std::pair<P, element> mln::p_priority< P, Q >::i_element |
typedef fwd_piter mln::p_priority< P, Q >::piter |
typedef p_double_psite<self_, Q> mln::p_priority< P, Q >::psite |
mln::p_priority< P, Q >::p_priority | ( | ) | [inline] |
void mln::p_priority< P, Q >::clear | ( | ) | [inline] |
bool mln::p_priority< P, Q >::exists_priority | ( | const P & | priority | ) | const [inline] |
Test if the priority
exists.
Definition at line 366 of file p_priority.hh.
Referenced by mln::p_priority< P, Q >::operator()().
const Q::element & mln::p_priority< P, Q >::front | ( | ) | const [inline] |
Give an element with highest priority.
If several elements have this priority, the least recently inserted is chosen.
Definition at line 294 of file p_priority.hh.
References mln::p_priority< P, Q >::highest_priority().
Referenced by mln::morpho::meyer_wst(), mln::p_priority< P, Q >::pop_front(), and mln::morpho::watershed::topological().
bool mln::p_priority< P, Q >::has | ( | const psite & | ) | const [inline] |
const P mln::p_priority< P, Q >::highest_priority | ( | ) | const [inline] |
Give the highest priority.
Definition at line 375 of file p_priority.hh.
Referenced by mln::p_priority< P, Q >::front(), and mln::p_priority< P, Q >::pop().
void mln::p_priority< P, Q >::insert | ( | const p_priority< P, Q > & | other | ) | [inline] |
void mln::p_priority< P, Q >::insert | ( | const i_element & | p_e | ) | [inline] |
Insert a pair p_e
(priority p, element e).
Definition at line 251 of file p_priority.hh.
References mln::p_priority< P, Q >::push().
bool mln::p_priority< P, Q >::is_valid | ( | ) | const [inline] |
const P mln::p_priority< P, Q >::lowest_priority | ( | ) | const [inline] |
std::size_t mln::p_priority< P, Q >::memory_size | ( | ) | const [inline] |
unsigned mln::p_priority< P, Q >::nsites | ( | ) | const [inline] |
Give the number of sites.
Definition at line 230 of file p_priority.hh.
Referenced by mln::p_priority< P, Q >::operator()().
const Q & mln::p_priority< P, Q >::operator() | ( | const P & | priority | ) | const [inline] |
Give the queue with the priority priority
.
This method always works: if the priority is not in this set, an empty queue is returned.
Definition at line 341 of file p_priority.hh.
References mln::p_priority< P, Q >::exists_priority(), and mln::p_priority< P, Q >::nsites().
void mln::p_priority< P, Q >::pop | ( | ) | [inline] |
Pop (remove) from the queue an element with highest priority.
If several elements have this priority, the least recently inserted is chosen.
Definition at line 277 of file p_priority.hh.
References mln::p_priority< P, Q >::highest_priority().
Referenced by mln::morpho::meyer_wst(), mln::p_priority< P, Q >::pop_front(), and mln::morpho::watershed::topological().
Q::element mln::p_priority< P, Q >::pop_front | ( | ) | [inline] |
Return an element with highest priority and remove it from the set.
If several elements have this priority, the least recently inserted is chosen.
Definition at line 304 of file p_priority.hh.
References mln::p_priority< P, Q >::front(), and mln::p_priority< P, Q >::pop().
Referenced by mln::geom::impl::seeds2tiling_roundness().
const util::set< P > & mln::p_priority< P, Q >::priorities | ( | ) | const [inline] |
void mln::p_priority< P, Q >::push | ( | const P & | priority, | |
const element & | e | |||
) | [inline] |
Push in the queue with priority
the element e
.
Definition at line 239 of file p_priority.hh.
Referenced by mln::p_priority< P, Q >::insert(), mln::morpho::meyer_wst(), mln::geom::impl::seeds2tiling_roundness(), and mln::morpho::watershed::topological().
bool operator< | ( | const Site_Set< Sl > & | lhs, | |
const Site_Set< Sr > & | rhs | |||
) | [related, inherited] |
std::ostream & operator<< | ( | std::ostream & | ostr, | |
const Site_Set< S > & | set | |||
) | [related, inherited] |
bool operator<= | ( | const Site_Set< Sl > & | lhs, | |
const Site_Set< Sr > & | rhs | |||
) | [related, inherited] |
bool operator== | ( | const Site_Set< Sl > & | lhs, | |
const Site_Set< Sr > & | rhs | |||
) | [related, inherited] |