#include <w_windownd.hh>
Inheritance diagram for oln::abstract::w_windownd< Exact >:
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 | |
static 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. | |
exact_type & | add_ (const dpoint_type &dp, const weight_type &w) |
Add a point (with weight) to the window. | |
const weight_type & | set_ (const dpoint_type &dp, const weight_type &w) |
Set the weight of a point if it exists. Otherwise create a new entry. | |
w_windownd () | |
Construct a w_window. | |
w_windownd (unsigned size) | |
Construct a w_window of 'size' elements. | |
Protected Attributes | |
std::vector< weight_type > | w_ |
List of point's weight. | |
Friends | |
class | w_window< exact_type > |
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.
typedef struct_elt_traits<Exact>::dpoint_type oln::abstract::w_windownd< Exact >::dpoint_type |
The associate image's type of dpoint (move point).
Reimplemented from oln::abstract::window_base< Sup, 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.
oln::abstract::w_windownd< Exact >::w_windownd | ( | unsigned | size | ) | [inline, protected] |
Construct a w_window of 'size' elements.
Definition at line 154 of file w_windownd.hh.
00154 : super_type(size) 00155 { 00156 w_.reserve(size); 00157 }
weight_type oln::abstract::w_windownd< Exact >::get_weight | ( | unsigned | i | ) | const [inline, protected] |
Get the weight of the nth point of the window.
Definition at line 93 of file w_windownd.hh.
00094 { 00095 precondition(i < this->card()); 00096 return w_[i]; 00097 }
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.
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 }
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.
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 }