Public Types | Public Member Functions | Protected Attributes | Related Functions

mln::w_window< D, W > Struct Template Reference

Generic w_window class. More...

#include <w_window.hh>

Inheritance diagram for mln::w_window< D, W >:
Inheritance graph

List of all members.

Public Types

typedef with_w_
< dpsites_bkd_piter< w_window
< D, W > >, W > 
bkd_qiter
 Site_Iterator type to browse (backward) the points of a generic w_window.
typedef Weighted_Window< void > category
typedef D dpsite
 Dpsite associated type.
typedef w_window< D, W > exact_t
typedef with_w_
< dpsites_fwd_piter< w_window
< D, W > >, W > 
fwd_qiter
 Site_Iterator type to browse (forward) the points of a generic w_window.
typedef mln::window< D >::psite psite
 Psite associated type.
typedef mln::window< D >::site site
 Site associated type.
typedef W weight
 Weight associated type.
typedef mln::window< D > window
 Window associated type.

Public Member Functions

void clear ()
 Clear this window.
unsigned delta () const
 Give the maximum coordinate gap; final method.
const mln::window< D >::dpsitedp (unsigned i) const
 Give the i-th delta-point; final method.
bool has (const typename mln::window< D >::dpsite &dp) const
 Test if the dp delta-point is in this window; final method.
w_window< D, W > & insert (const W &w, const D &d)
 Insert a couple of weight w and delta-point d.
bool is_centered () const
 Test if the weighted window is centered; final method.
bool is_empty () const
 Test if the weighted window is empty; final method.
bool is_symmetric () const
 Test if the window is symmetric.
bool is_valid () const
 return true by default.
unsigned size () const
 Give the window size; final method.
const std::vector< D > & std_vector () const
 Give access to the vector of delta-points.
void sym ()
 Apply a central symmetry to the window.
w (unsigned i) const
 Give the i-th weight.
 w_window ()
 Constructor without argument.
const std::vector< W > & weights () const
 Give access to the vector of weights.
const mln::window< D > & win () const
 Give the corresponding window.

Protected Attributes

std::vector< W > wei_
mln::window< D > win_

Related Functions

(Note that these are not member functions.)



template<typename D , typename W >
std::ostream & operator<< (std::ostream &ostr, const w_window< D, W > &w_win)
 Print a weighted window w_win into an output stream ostr.
template<typename D , typename Wl , typename Wr >
bool operator== (const w_window< D, Wl > &lhs, const w_window< D, Wr > &rhs)
 Equality test between two weighted windows lhs and rhs.

Detailed Description

template<typename D, typename W>
struct mln::w_window< D, W >

Generic w_window class.

This type of w_window is just like a set of delta-points. The parameter D is the type of delta-points; the parameter W is the type of weights.

Definition at line 100 of file core/w_window.hh.


Member Typedef Documentation

template<typename D, typename W>
typedef with_w_< dpsites_bkd_piter< w_window<D, W> >, W > mln::w_window< D, W >::bkd_qiter

Site_Iterator type to browse (backward) the points of a generic w_window.

Definition at line 114 of file core/w_window.hh.

typedef Weighted_Window<void> mln::Weighted_Window< w_window< D, W > >::category [inherited]

Reimplemented from mln::Object< w_window< D, W > >.

Definition at line 70 of file weighted_window.hh.

template<typename D, typename W>
typedef D mln::w_window< D, W >::dpsite

Dpsite associated type.

Reimplemented from mln::internal::weighted_window_base< mln::window< D >, w_window< D, W > >.

Definition at line 104 of file core/w_window.hh.

typedef w_window< D, W > mln::Object< w_window< D, W > >::exact_t [inherited]

Definition at line 173 of file object.hh.

template<typename D, typename W>
typedef with_w_< dpsites_fwd_piter< w_window<D, W> >, W > mln::w_window< D, W >::fwd_qiter

Site_Iterator type to browse (forward) the points of a generic w_window.

Definition at line 111 of file core/w_window.hh.

typedef mln::window< D > ::psite mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::psite [inherited]

Psite associated type.

Definition at line 57 of file weighted_window_base.hh.

typedef mln::window< D > ::site mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::site [inherited]

Site associated type.

Definition at line 60 of file weighted_window_base.hh.

template<typename D, typename W>
typedef W mln::w_window< D, W >::weight

Weight associated type.

Definition at line 107 of file core/w_window.hh.

typedef mln::window< D > mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::window [inherited]

Window associated type.

Definition at line 51 of file weighted_window_base.hh.


Constructor & Destructor Documentation

template<typename D , typename W >
mln::w_window< D, W >::w_window (  )  [inline]

Constructor without argument.

Definition at line 213 of file core/w_window.hh.


Member Function Documentation

template<typename D , typename W >
void mln::w_window< D, W >::clear (  )  [inline]

Clear this window.

Definition at line 308 of file core/w_window.hh.

References mln::w_window< D, W >::wei_, and mln::w_window< D, W >::win_.

Referenced by mln::convert::over_load::from_to_().

unsigned mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::delta (  )  const [inherited]

Give the maximum coordinate gap; final method.

This method is valid iff the support is regular and the definition is not varying.

const mln::window< D > ::dpsite& mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::dp ( unsigned  i  )  const [inherited]

Give the i-th delta-point; final method.

This method is valid iff the support is regular and the definition is unique.

Referenced by mln::convert::over_load::from_to_(), and mln::w_window< D, W >::sym().

bool mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::has ( const typename mln::window< D > ::dpsite dp  )  const [inherited]

Test if the dp delta-point is in this window; final method.

This method is valid iff the support is regular and the definition is unique.

template<typename D , typename W >
w_window< D, W > & mln::w_window< D, W >::insert ( const W &  w,
const D &  d 
) [inline]
bool mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::is_centered (  )  const [inherited]

Test if the weighted window is centered; final method.

This method is valid iff the support is regular and the definition is not varying.

bool mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::is_empty (  )  const [inherited]

Test if the weighted window is empty; final method.

template<typename D , typename W >
bool mln::w_window< D, W >::is_symmetric (  )  const [inline]

Test if the window is symmetric.

Definition at line 284 of file core/w_window.hh.

References mln::w_window< D, W >::sym(), and mln::w_window< D, W >::win_.

bool mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::is_valid (  )  const [inherited]

return true by default.

Referenced by mln::convert::over_load::from_to_().

unsigned mln::internal::weighted_window_base< mln::window< D > , w_window< D, W > >::size (  )  const [inherited]

Give the window size; final method.

This method is valid iff the underlying window has a fixed size.

Referenced by mln::convert::over_load::from_to_(), mln::operator==(), and mln::w_window< D, W >::sym().

template<typename D , typename W >
const std::vector< D > & mln::w_window< D, W >::std_vector (  )  const [inline]

Give access to the vector of delta-points.

Definition at line 228 of file core/w_window.hh.

References mln::w_window< D, W >::win_.

template<typename D , typename W >
void mln::w_window< D, W >::sym (  )  [inline]
template<typename D , typename W >
W mln::w_window< D, W >::w ( unsigned  i  )  const [inline]

Give the i-th weight.

Definition at line 244 of file core/w_window.hh.

References mln::w_window< D, W >::wei_, and mln::w_window< D, W >::win_.

Referenced by mln::convert::over_load::from_to_().

template<typename D , typename W >
const std::vector< W > & mln::w_window< D, W >::weights (  )  const [inline]

Give access to the vector of weights.

Definition at line 236 of file core/w_window.hh.

References mln::w_window< D, W >::wei_.

Referenced by mln::operator==().

template<typename D , typename W >
const mln::window< D > & mln::w_window< D, W >::win (  )  const [inline]

Give the corresponding window.

Definition at line 220 of file core/w_window.hh.

References mln::w_window< D, W >::win_.

Referenced by mln::operator==().


Friends And Related Function Documentation

template<typename D , typename W >
std::ostream & operator<< ( std::ostream &  ostr,
const w_window< D, W > &  w_win 
) [related]

Print a weighted window w_win into an output stream ostr.

Definition at line 420 of file core/w_window.hh.

template<typename D , typename Wl , typename Wr >
bool operator== ( const w_window< D, Wl > &  lhs,
const w_window< D, Wr > &  rhs 
) [related]

Equality test between two weighted windows lhs and rhs.

Definition at line 430 of file core/w_window.hh.


Member Data Documentation

template<typename D, typename W>
std::vector<W> mln::w_window< D, W >::wei_ [protected]
template<typename D, typename W>
mln::window<D> mln::w_window< D, W >::win_ [protected]