Public Types | Public Member Functions | Private Attributes

mln::p_image< I > Class Template Reference
[Sparse types]

Site set based on an image of Booleans. More...

#include <p_image.hh>

Inheritance diagram for mln::p_image< I >:
Inheritance graph

List of all members.

Public Types

typedef S::bkd_piter bkd_piter
 Backward Site_Iterator associated type.
typedef Site_Set< void > category
typedef I::psite element
 Element associated type.
typedef p_image< I > exact_t
typedef S::fwd_piter fwd_piter
 Forward Site_Iterator associated type.
typedef psite i_element
 Insertion element associated type.
typedef S::piter piter
 Site_Iterator associated type.
typedef I::psite psite
 Psite associated type.
typedef psite r_element
 Removal element associated type.
typedef
internal::p_image_site_set< I >
::ret 
S
 Equivalent site_set type.
typedef subject< I::psite >::ret site
 Site associated type.

Public Member Functions

void clear ()
 Clear this set.
bool has (const psite &) const
 Test is the psite p belongs to this site set.
const I & image_hook_ () const
 Hook to the image.
void insert (const psite &p)
 Insert a site p.
bool is_empty () const
 Test if the site set is empty.
bool is_valid () const
 Test if this site set is valid, i.e., initialized.
std::size_t memory_size () const
 Return the size of this site set in memory.
unsigned nsites () const
 Give the number of sites.
 operator typename internal::p_image_site_set< I >::ret () const
 Conversion towards the equivalent site set.
 p_image ()
 Constructor without argument.
 p_image (const I &ima)
 Constructor.
void remove (const psite &p)
 Remove a site p.
void toggle (const psite &p)
 Change the status in/out of a site p.

Private Attributes

ima_
unsigned nsites_

Detailed Description

template<typename I>
class mln::p_image< I >

Site set based on an image of Booleans.

Definition at line 88 of file p_image.hh.


Member Typedef Documentation

template<typename I >
typedef S ::bkd_piter mln::p_image< I >::bkd_piter

Backward Site_Iterator associated type.

Definition at line 110 of file p_image.hh.

typedef Site_Set<void> mln::Site_Set< p_image< I > >::category [inherited]

Reimplemented from mln::Object< p_image< I > >.

Definition at line 67 of file mln/core/concept/site_set.hh.

template<typename I >
typedef I ::psite mln::p_image< I >::element

Element associated type.

Definition at line 100 of file p_image.hh.

typedef p_image< I > mln::Object< p_image< I > >::exact_t [inherited]

Definition at line 173 of file object.hh.

template<typename I >
typedef S ::fwd_piter mln::p_image< I >::fwd_piter

Forward Site_Iterator associated type.

Definition at line 107 of file p_image.hh.

template<typename I >
typedef psite mln::p_image< I >::i_element

Insertion element associated type.

Definition at line 136 of file p_image.hh.

template<typename I >
typedef S ::piter mln::p_image< I >::piter

Site_Iterator associated type.

Definition at line 113 of file p_image.hh.

template<typename I >
typedef I ::psite mln::p_image< I >::psite

Psite associated type.

Definition at line 104 of file p_image.hh.

template<typename I >
typedef psite mln::p_image< I >::r_element

Removal element associated type.

Definition at line 142 of file p_image.hh.

template<typename I >
typedef internal::p_image_site_set<I>::ret mln::p_image< I >::S

Equivalent site_set type.

Definition at line 93 of file p_image.hh.

typedef subject<I::psite >::ret mln::internal::site_set_base_< I::psite , p_image< I > >::site [inherited]

Site associated type.

Definition at line 55 of file site_set_base.hh.


Constructor & Destructor Documentation

template<typename I >
mln::p_image< I >::p_image (  )  [inline]

Constructor without argument.

Definition at line 182 of file p_image.hh.

template<typename I >
mln::p_image< I >::p_image ( const I &  ima  )  [inline]

Constructor.

Definition at line 189 of file p_image.hh.

References mln::p_image< I >::clear().


Member Function Documentation

template<typename I >
void mln::p_image< I >::clear (  )  [inline]

Clear this set.

Definition at line 283 of file p_image.hh.

References mln::data::fill_with_value(), and mln::p_image< I >::is_valid().

Referenced by mln::p_image< I >::p_image().

template<typename I >
bool mln::p_image< I >::has ( const psite p  )  const [inline]

Test is the psite p belongs to this site set.

Definition at line 199 of file p_image.hh.

References mln::p_image< I >::ima_, and mln::p_image< I >::is_valid().

template<typename I >
const I & mln::p_image< I >::image_hook_ (  )  const [inline]

Hook to the image.

Definition at line 294 of file p_image.hh.

References mln::p_image< I >::is_valid().

template<typename I >
void mln::p_image< I >::insert ( const psite p  )  [inline]

Insert a site p.

Definition at line 224 of file p_image.hh.

References mln::p_image< I >::ima_, and mln::p_image< I >::is_valid().

bool mln::internal::site_set_base_< I::psite , p_image< I > >::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.

template<typename I >
bool mln::p_image< I >::is_valid (  )  const [inline]
template<typename I >
std::size_t mln::p_image< I >::memory_size (  )  const [inline]

Return the size of this site set in memory.

Definition at line 273 of file p_image.hh.

References mln::p_image< I >::is_valid().

template<typename I >
unsigned mln::p_image< I >::nsites (  )  const [inline]

Give the number of sites.

Definition at line 216 of file p_image.hh.

template<typename I >
mln::p_image< I >::operator typename internal::p_image_site_set< I >::ret (  )  const [inline]

Conversion towards the equivalent site set.

Definition at line 174 of file p_image.hh.

References mln::pw::cst(), and mln::pw::value().

template<typename I >
void mln::p_image< I >::remove ( const psite p  )  [inline]

Remove a site p.

Definition at line 237 of file p_image.hh.

References mln::p_image< I >::ima_, and mln::p_image< I >::is_valid().

template<typename I >
void mln::p_image< I >::toggle ( const psite p  )  [inline]

Change the status in/out of a site p.

Definition at line 251 of file p_image.hh.

References mln::p_image< I >::ima_, and mln::p_image< I >::is_valid().


Member Data Documentation

template<typename I >
I mln::p_image< I >::ima_ [private]
template<typename I >
unsigned mln::p_image< I >::nsites_ [private]

Definition at line 166 of file p_image.hh.