Mathematical set of sites (based on util::set). More...
#include <p_set.hh>
Public Types | |
typedef p_indexed_bkd_piter < self_ > | bkd_piter |
Backward Site_Iterator associated type. | |
typedef Site_Set< void > | category |
typedef P | element |
Element associated type. | |
typedef p_set< P > | exact_t |
typedef p_indexed_fwd_piter < self_ > | fwd_piter |
Forward Site_Iterator associated type. | |
typedef P | i_element |
Insertion element associated type. | |
typedef fwd_piter | piter |
Site_Iterator associated type. | |
typedef p_indexed_psite< self_ > | psite |
Psite associated type. | |
typedef P | r_element |
Removal element associated type. | |
typedef subject< P >::ret | site |
Site associated type. | |
Public Member Functions | |
void | clear () |
Clear this set. | |
bool | has (const psite &p) const |
Test if psite p belongs to this point set. | |
bool | has (const util::index &i) const |
Test if index i belongs to this point set. | |
bool | has (const P &p) const |
Test if p belongs to this point set. | |
void | insert (const P &p) |
Insert a site p . | |
bool | is_empty () const |
Test if the site set is empty. | |
bool | is_valid () const |
Test this set validity so returns always true. | |
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 & | operator[] (unsigned i) const |
Return the i-th site. | |
p_set () | |
Constructor. | |
void | remove (const P &p) |
Remove a site p . | |
const std::vector< P > & | std_vector () const |
Return the corresponding std::vector of sites. | |
const util::set< P > & | util_set () const |
Return the corresponding util::set of sites. | |
Protected Attributes | |
util::set< P > | s_ |
Private Types | |
typedef p_set< P > | self_ |
Mathematical set of sites (based on util::set).
This is a mathematical set of sites (not a multi-set).
The parameter P
shall be a site or pseudo-site type.
typedef p_indexed_bkd_piter<self_> mln::p_set< P >::bkd_piter |
Backward Site_Iterator associated type.
typedef Site_Set<void> mln::Site_Set< p_set< P > >::category [inherited] |
Reimplemented from mln::Object< p_set< P > >.
typedef P mln::p_set< P >::element |
Element associated type.
typedef p_set< P > mln::Object< p_set< P > >::exact_t [inherited] |
typedef p_indexed_fwd_piter<self_> mln::p_set< P >::fwd_piter |
Forward Site_Iterator associated type.
typedef P mln::p_set< P >::i_element |
Insertion element associated type.
typedef fwd_piter mln::p_set< P >::piter |
Site_Iterator associated type.
typedef p_indexed_psite<self_> mln::p_set< P >::psite |
Psite associated type.
typedef P mln::p_set< P >::r_element |
Removal element associated type.
typedef p_set<P> mln::p_set< P >::self_ [private] |
typedef subject<P>::ret mln::internal::site_set_base_< P, p_set< P > >::site [inherited] |
Site associated type.
mln::p_set< P >::p_set | ( | ) | [inline] |
Constructor.
void mln::p_set< P >::clear | ( | ) | [inline] |
Clear this set.
References mln::util::set< T >::clear(), and mln::p_set< P >::s_.
bool mln::p_set< P >::has | ( | const psite & | p | ) | const [inline] |
Test if psite p
belongs to this point set.
References mln::p_indexed_psite< S >::index(), mln::p_indexed_psite< S >::target_(), and mln::internal::pseudo_site_base_< P, E >::to_site().
bool mln::p_set< P >::has | ( | const P & | p | ) | const [inline] |
Test if p
belongs to this point set.
References mln::util::set< T >::has(), and mln::p_set< P >::s_.
bool mln::p_set< P >::has | ( | const util::index & | i | ) | const [inline] |
Test if index i
belongs to this point set.
References mln::p_set< P >::nsites().
void mln::p_set< P >::insert | ( | const P & | p | ) | [inline] |
Insert a site p
.
References mln::util::set< T >::insert(), and mln::p_set< P >::s_.
Referenced by mln::convert::to_p_set().
bool mln::internal::site_set_base_< P, p_set< P > >::is_empty | ( | ) | const [inherited] |
Test if the site set is empty.
This final method dispatches to is_empty_ whose default implementation relies on the 'nsites' method.
bool mln::p_set< P >::is_valid | ( | ) | const [inline] |
Test this set validity so returns always true.
std::size_t mln::p_set< P >::memory_size | ( | ) | const [inline] |
Return the size of this site set in memory.
References mln::util::set< T >::memory_size(), and mln::p_set< P >::s_.
unsigned mln::p_set< P >::nsites | ( | ) | const [inline] |
Give the number of sites.
References mln::util::set< T >::nelements(), and mln::p_set< P >::s_.
Referenced by mln::p_key< K, P >::change_key(), mln::p_set< P >::has(), mln::p_set< P >::operator[](), mln::p_key< K, P >::remove_key(), and mln::p_key< K, P >::run_().
const P & mln::p_set< P >::operator[] | ( | unsigned | i | ) | const [inline] |
Return the i-th
site.
References mln::p_set< P >::nsites(), and mln::p_set< P >::s_.
void mln::p_set< P >::remove | ( | const P & | p | ) | [inline] |
Remove a site p
.
References mln::util::set< T >::remove(), and mln::p_set< P >::s_.
const std::vector< P > & mln::p_set< P >::std_vector | ( | ) | const [inline] |
Return the corresponding std::vector of sites.
References mln::p_set< P >::s_, and mln::util::set< T >::std_vector().
const util::set< P > & mln::p_set< P >::util_set | ( | ) | const [inline] |
Return the corresponding util::set of sites.
References mln::p_set< P >::s_.
util::set<P> mln::p_set< P >::s_ [protected] |