mln::p_key< K, P > Class Template Reference
[Queue based]

Priority queue class. More...

#include <p_key.hh>

Inherits mln::internal::site_set_base_< P, mln::p_key< K, P > >.

List of all members.

Public Types

typedef p_double_piter< self_,
mln_bkd_eiter(util::set< K >
), typename p_set< P >
::bkd_piter
bkd_piter
 Backward Site_Iterator associated type.
typedef P element
 Element associated type.
typedef p_double_piter< self_,
mln_fwd_eiter(util::set< K >
), typename p_set< P >
::fwd_piter
fwd_piter
 Forward Site_Iterator associated type.
typedef std::pair< K, P > i_element
 Insertion element associated type.
typedef fwd_piter piter
 Site_Iterator associated type.
typedef p_double_psite< self_,
p_set< P > > 
psite
 Psite associated type.
typedef P r_element
 Removal element associated type.

Public Member Functions

void change_key (const K &k, const K &new_k)
 Change the key k into a new value new_k.
template<typename F>
void change_keys (const Function_v2v< F > &f)
 Change the keys by applying the function f.
void clear ()
 Clear this site set.
bool exists_key (const K &key) const
 Test if the priority exists.
bool has (const P &p) const
 Test is the psite p belongs to this site set.
bool has (const psite &) const
 Test is the psite p belongs to this site set.
void insert (const K &k, const P &p)
 Insert a pair (key k, site p).
void insert (const i_element &k_p)
 Insert a pair k_p (key k, site p).
bool is_valid () const
 Test this set validity so returns always true.
const K & key (const P &p) const
 Give the key associated with site p.
const util::set< K > & keys () const
 Give the set of keys.
std::size_t memory_size () const
 Return the size of this site set in memory.
unsigned nsites () const
 Give the number of sites.
const p_set< P > & operator() (const K &key) const
 Give the queue with the priority priority.
 p_key ()
 Constructor.
void remove (const P &p)
 Remove a site p.
void remove_key (const K &k)
 Remove all sites with key k.

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.


Detailed Description

template<typename K, typename P>
class mln::p_key< K, P >

Priority queue class.

Member Typedef Documentation

template<typename K, typename P>
typedef p_double_piter<self_, mln_bkd_eiter(util::set<K>), typename p_set<P>::bkd_piter> mln::p_key< K, P >::bkd_piter

Backward Site_Iterator associated type.

template<typename K, typename P>
typedef P mln::p_key< K, P >::element

Element associated type.

template<typename K, typename P>
typedef p_double_piter<self_, mln_fwd_eiter(util::set<K>), typename p_set<P>::fwd_piter> mln::p_key< K, P >::fwd_piter

Forward Site_Iterator associated type.

template<typename K, typename P>
typedef std::pair<K,P> mln::p_key< K, P >::i_element

Insertion element associated type.

template<typename K, typename P>
typedef fwd_piter mln::p_key< K, P >::piter

Site_Iterator associated type.

template<typename K, typename P>
typedef p_double_psite< self_, p_set<P> > mln::p_key< K, P >::psite

Psite associated type.

template<typename K, typename P>
typedef P mln::p_key< K, P >::r_element

Removal element associated type.


Constructor & Destructor Documentation

template<typename K, typename P>
mln::p_key< K, P >::p_key (  )  [inline]

Constructor.


Member Function Documentation

template<typename K, typename P>
void mln::p_key< K, P >::change_key ( const K &  k,
const K &  new_k 
) [inline]

Change the key k into a new value new_k.

References mln::p_set< P >::nsites().

template<typename K, typename P>
template<typename F>
void mln::p_key< K, P >::change_keys ( const Function_v2v< F > &  f  )  [inline]

Change the keys by applying the function f.

References mln::util::set< T >::insert().

template<typename K, typename P>
void mln::p_key< K, P >::clear (  )  [inline]

Clear this site set.

template<typename K, typename P>
bool mln::p_key< K, P >::exists_key ( const K &  key  )  const [inline]

Test if the priority exists.

Referenced by mln::p_key< K, P >::operator()().

template<typename K, typename P>
bool mln::p_key< K, P >::has ( const P &  p  )  const [inline]

Test is the psite p belongs to this site set.

template<typename K, typename P>
bool mln::p_key< K, P >::has ( const psite  )  const [inline]

Test is the psite p belongs to this site set.

Referenced by mln::p_key< K, P >::insert().

template<typename K, typename P>
void mln::p_key< K, P >::insert ( const K &  k,
const P &  p 
) [inline]

Insert a pair (key k, site p).

References mln::p_key< K, P >::has().

template<typename K, typename P>
void mln::p_key< K, P >::insert ( const i_element k_p  )  [inline]

Insert a pair k_p (key k, site p).

template<typename K, typename P>
bool mln::p_key< K, P >::is_valid (  )  const [inline]

Test this set validity so returns always true.

template<typename K, typename P>
const K & mln::p_key< K, P >::key ( const P &  p  )  const [inline]

Give the key associated with site p.

template<typename K, typename P>
const util::set< K > & mln::p_key< K, P >::keys (  )  const [inline]

Give the set of keys.

template<typename K, typename P>
std::size_t mln::p_key< K, P >::memory_size (  )  const [inline]

Return the size of this site set in memory.

template<typename K, typename P>
unsigned mln::p_key< K, P >::nsites (  )  const [inline]

Give the number of sites.

template<typename K, typename P>
const p_set< P > & mln::p_key< K, P >::operator() ( const K &  key  )  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.

References mln::p_key< K, P >::exists_key().

template<typename K, typename P>
void mln::p_key< K, P >::remove ( const P &  p  )  [inline]

Remove a site p.

template<typename K, typename P>
void mln::p_key< K, P >::remove_key ( const K &  k  )  [inline]

Remove all sites with key k.

References mln::p_set< P >::nsites().


Friends And Related Function Documentation

template<typename Sl, typename Sr>
p_set< typename Sl::site > diff ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

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 
) [related, inherited]

Intersection between a couple of point sets.

template<typename Sl, typename Sr>
bool operator< ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Strict inclusion test between site sets lhs and rhs.

Parameters:
[in] lhs A site set (strictly included?).
[in] rhs Another site set (includer?).

template<typename S>
std::ostream & operator<< ( std::ostream &  ostr,
const Site_Set< S > &  set 
) [related, inherited]

Print a site set set into the output stream ostr.

Parameters:
[in,out] ostr An output stream.
[in] set A site set.
Returns:
The modified output stream ostr.

template<typename Sl, typename Sr>
bool operator<= ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Inclusion test between site sets lhs and rhs.

Parameters:
[in] lhs A site set (included?).
[in] rhs Another site set (includer?).

template<typename Sl, typename Sr>
bool operator== ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Equality test between site sets lhs and rhs.

Parameters:
[in] lhs A site set.
[in] rhs Another site set.

template<typename Sl, typename Sr>
p_set< typename Sl::site > sym_diff ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

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 
) [related, inherited]

Union of a couple of point sets.

template<typename S>
p_set< typename S::site > unique ( const Site_Set< S > &  s  )  [related, inherited]

Give the unique set of s.


Generated on Thu Sep 9 19:30:52 2010 for Milena (Olena) by  doxygen 1.5.6