Anaphe Home Page Reference Documentation

Main Page     Namespaces     Classes     Source Code    

Weighted_Bin Class Reference

#include <Weighted_Bin.h>

Inheritance diagram for Weighted_Bin:

I_Bin List of all members.

Detailed Description

The value of this bin is:
        value = SUM[ weight ]
The error of this bin is:
        error = sqrt( SUM[ weight*weight ] )

By default the gravity center of all the data points in this bin
is the middle of the bin.

Definition at line 24 of file Weighted_Bin.h.

Public Types

typedef Weighted_Bin Like_Current
typedef I_Bin Like_Parent

Public Methods

 H_IID_IMPLEMENT (Weighted_Bin)
 Very simple RTTI feature.

 Weighted_Bin ()
 Constructor.

 ~Weighted_Bin ()
 Destructor.

double value (Index=0) const
 Value associated with this bin.

double error (Index=0) const
 Error associated with this bin.

Size count () const
 Count associated with this bin. = Number of entries.

void set_value (double other, Index=0)
 Change/set the value of the bin to other.

void set_error (double other, Index=0)
 Change/set the error of the bin to other.

void set_count (Size other)
 Change/set the count of the bin to other.

void reset ()
 Reset bin contents to 0.

void put (T_Value a_weight)
 Put data point with weight a_weight.

int operator== (const Like_Current &other) const
 Comparison operator.

void make (const Like_Parent &other)
 Override bin content.

void add (const Like_Parent &other)
 Add other bin to current one.

void sub (const Like_Parent &other)
 Subtract other bin from current one.

void mul (const Like_Parent &other)
 Multiply current bin by other one.

void div (const Like_Parent &other)
 Divide current bin by other one If other.value()==0 then new value is 0.

void binomial_div (const Like_Parent &other)
 Divide binomially current bin by other one If other.value()==0 then new value is 0.

void add (double x)
 Add scalar to current bin.

void sub (double x)
 Subtract scalar from current bin.

void mul (double x)
 Multiply current bin by scalar.

void div (double x)
 Divide current bin by scalar.


Private Attributes

T_Value value_
T_Value error_
Size count_


Member Typedef Documentation

typedef Weighted_Bin Weighted_Bin::Like_Current
 

Reimplemented from I_Bin.

Definition at line 29 of file Weighted_Bin.h.

typedef I_Bin Weighted_Bin::Like_Parent
 

Definition at line 30 of file Weighted_Bin.h.


Constructor & Destructor Documentation

Weighted_Bin::Weighted_Bin   [inline]
 

Definition at line 34 of file Weighted_Bin.h.

References count_, error_, and value_.

Weighted_Bin::~Weighted_Bin   [inline]
 

Definition at line 36 of file Weighted_Bin.h.


Member Function Documentation

void Weighted_Bin::add double    x [inline, virtual]
 

Implements I_Bin.

Definition at line 156 of file Weighted_Bin.h.

References T_Value, and value_.

void Weighted_Bin::add const Like_Parent   other [inline]
 

Definition at line 85 of file Weighted_Bin.h.

References I_Bin::count(), count_, I_Bin::error(), error_, T_Value, I_Bin::value(), and value_.

void Weighted_Bin::binomial_div const Like_Parent   other [inline]
 

If other.error()==0 then new error is 0.

Definition at line 134 of file Weighted_Bin.h.

References I_Bin::count(), count_, I_Bin::error(), error_, HTL_ERR, T_Value, I_Bin::value(), and value_.

Size Weighted_Bin::count   const [inline, virtual]
 

Implements I_Bin.

Definition at line 46 of file Weighted_Bin.h.

References count_, and Size.

Referenced by operator==().

void Weighted_Bin::div double    x [inline, virtual]
 

Implements I_Bin.

Definition at line 162 of file Weighted_Bin.h.

References HTL_ERR, T_Value, and value_.

void Weighted_Bin::div const Like_Parent   other [inline]
 

If other.error()==0 then new error is 0.

Definition at line 110 of file Weighted_Bin.h.

References I_Bin::count(), count_, I_Bin::error(), error_, HTL_ERR, T_Value, I_Bin::value(), and value_.

double Weighted_Bin::error Index    = 0 const [inline, virtual]
 

Implements I_Bin.

Definition at line 43 of file Weighted_Bin.h.

References error_, and Index.

Referenced by operator==().

Weighted_Bin::H_IID_IMPLEMENT Weighted_Bin   
 

void Weighted_Bin::make const Like_Parent   other [inline]
 

Definition at line 79 of file Weighted_Bin.h.

References I_Bin::count(), count_, I_Bin::error(), error_, T_Value, I_Bin::value(), and value_.

void Weighted_Bin::mul double    x [inline, virtual]
 

Implements I_Bin.

Definition at line 160 of file Weighted_Bin.h.

References T_Value, and value_.

void Weighted_Bin::mul const Like_Parent   other [inline]
 

Definition at line 99 of file Weighted_Bin.h.

References I_Bin::count(), count_, I_Bin::error(), error_, T_Value, I_Bin::value(), and value_.

int Weighted_Bin::operator== const Like_Current   other const [inline]
 

Definition at line 70 of file Weighted_Bin.h.

References count(), error(), T_Value, and value().

void Weighted_Bin::put T_Value    a_weight [inline]
 

Definition at line 62 of file Weighted_Bin.h.

References count_, error_, T_Value, and value_.

Referenced by P_Histo3DVar::fill(), P_Histo3D::fill(), P_Histo2DVar::fill(), P_Histo2D::fill(), P_Histo1DVar_FTS::fill(), and P_Histo1D_FTS::fill().

void Weighted_Bin::reset   [inline, virtual]
 

Implements I_Bin.

Definition at line 58 of file Weighted_Bin.h.

References count_, error_, T_Value, and value_.

void Weighted_Bin::set_count Size    other [inline, virtual]
 

Implements I_Bin.

Definition at line 55 of file Weighted_Bin.h.

References count_, and Size.

void Weighted_Bin::set_error double    other,
Index    = 0
[inline, virtual]
 

Implements I_Bin.

Definition at line 52 of file Weighted_Bin.h.

References error_, Index, and T_Value.

void Weighted_Bin::set_value double    other,
Index    = 0
[inline, virtual]
 

Implements I_Bin.

Definition at line 49 of file Weighted_Bin.h.

References Index, T_Value, and value_.

void Weighted_Bin::sub double    x [inline, virtual]
 

Implements I_Bin.

Definition at line 158 of file Weighted_Bin.h.

References T_Value, and value_.

void Weighted_Bin::sub const Like_Parent   other [inline]
 

Definition at line 92 of file Weighted_Bin.h.

References I_Bin::count(), count_, I_Bin::error(), error_, T_Value, I_Bin::value(), and value_.

double Weighted_Bin::value Index    = 0 const [inline, virtual]
 

Implements I_Bin.

Definition at line 40 of file Weighted_Bin.h.

Referenced by operator==().


Member Data Documentation

Size Weighted_Bin::count_ [private]
 

Definition at line 174 of file Weighted_Bin.h.

Referenced by add(), binomial_div(), count(), div(), make(), mul(), put(), reset(), set_count(), sub(), and Weighted_Bin().

T_Value Weighted_Bin::error_ [private]
 

Definition at line 173 of file Weighted_Bin.h.

Referenced by add(), binomial_div(), div(), error(), make(), mul(), put(), reset(), set_error(), sub(), and Weighted_Bin().

T_Value Weighted_Bin::value_ [private]
 

Definition at line 172 of file Weighted_Bin.h.

Referenced by add(), binomial_div(), div(), make(), mul(), put(), reset(), set_value(), sub(), and Weighted_Bin().


The documentation for this class was generated from the following file:

Anaphe documentation generated by Doxygen (www.doxygen.org)