oln::abstract::w_windownd< Exact > Struct Template Reference

Weight Window N dimensions. More...

#include <w_windownd.hh>

Inheritance diagram for oln::abstract::w_windownd< Exact >:

Inheritance graph
[legend]
Collaboration diagram for oln::abstract::w_windownd< Exact >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef window_base< abstract::w_window<
Exact >, Exact > 
super_type
 Set the super type.

typedef w_windownd< Exact > self_type
 Set the self type.

typedef Exact exact_type
 Set the exact type.

typedef struct_elt_traits<
Exact >::weight_type 
weight_type
 Set the type of weight.

typedef struct_elt_traits<
Exact >::dpoint_type 
dpoint_type
 The associate image's type of dpoint (move point).


Static Public Member Functions

std::string name ()
 Return the name of the type.


Protected Member Functions

weight_type get_weight (unsigned i) const
 Get the weight of the nth point of the window.
  • i The nth point.


exact_typeadd_ (const dpoint_type &dp, const weight_type &w)
 Add a point (with weight) to the window.
  • dp The new point.
  • w The weight of this new point.


const weight_typeset_ (const dpoint_type &dp, const weight_type &w)
 Set the weight of a point if it exists. Otherwise create a new entry.
  • dp The point.
  • weight The weight of the point.


 w_windownd ()
 Construct a w_window.

 w_windownd (unsigned size)
 Construct a w_window of 'size' elements.
  • size The number of elements to reserve for the window.



Protected Attributes

std::vector< weight_typew_
 List of point's weight.


Friends

class w_window< exact_type >

Detailed Description

template<class Exact>
struct oln::abstract::w_windownd< Exact >

Weight Window N dimensions.

A w_window is a set of points associated with a weight. This class defines how to deal with. These points have N dimensions.

Definition at line 59 of file w_windownd.hh.


Member Typedef Documentation

template<class Exact>
typedef struct_elt_traits<Exact>::dpoint_type oln::abstract::w_windownd< Exact >::dpoint_type
 

The associate image's type of dpoint (move point).

Warning:
Prefer the macros oln_dpoint_type(Pointable) and oln_dpoint_type_(Pointable) (the same without the 'typename' keyword)

Reimplemented from oln::abstract::window_base< w_window< Exact >, Exact >.

Reimplemented in oln::w_window1d< T >, oln::w_window2d< T >, oln::w_window3d< T >, and oln::w_window2d< T2 >.

Definition at line 73 of file w_windownd.hh.


Member Function Documentation

template<class Exact>
exact_type& oln::abstract::w_windownd< Exact >::add_ const dpoint_type dp,
const weight_type w
[inline, protected]
 

Add a point (with weight) to the window.

  • dp The new point.
  • w The weight of this new point.

Precondition:
!has(dp).
Add a new member to the window (ignored if ist weight is 0).

Definition at line 108 of file w_windownd.hh.

00109       {
00110         precondition(! has_(dp));
00111         if (w == 0)             // Don't add 0 weighted entries
00112           return this->exact();
00113         if (dp.is_centered())
00114           this->centered_ = true;
00115         this->dp_.push_back(dp);
00116         delta_update(dp);
00117         w_.push_back(w);
00118         return this->exact();
00119       }

template<class Exact>
weight_type oln::abstract::w_windownd< Exact >::get_weight unsigned  i  )  const [inline, protected]
 

Get the weight of the nth point of the window.

  • i The nth point.

Returns:
The weight of this point.
Precondition:
i < card().

Definition at line 93 of file w_windownd.hh.

00094       {
00095         precondition(i < this->card());
00096         return w_[i];
00097       }

template<class Exact>
const weight_type& oln::abstract::w_windownd< Exact >::set_ const dpoint_type dp,
const weight_type w
[inline, protected]
 

Set the weight of a point if it exists. Otherwise create a new entry.

  • dp The point.
  • weight The weight of the point.

Returns:
The weight of the point.

Definition at line 129 of file w_windownd.hh.

00130       {
00131         // if the dp exists, return a ref to the existing entry
00132         for (unsigned i = 0; i < this->card_(); ++i)
00133           if (this->dp_[i] == dp)
00134           {
00135             w_[i] = w;
00136             return w_[i];
00137           }
00138 
00139         // otherwise, create new entry
00140         add(dp, w);
00141         return w_.back();
00142       }


The documentation for this struct was generated from the following file:
Generated on Thu Apr 15 20:15:15 2004 for Olena by doxygen 1.3.6-20040222