Anaphe Home Page Reference Documentation

Main Page     Namespaces     Classes     Source Code    

Profile_Bin Class Reference

#include <Profile_Bin.h>

Inheritance diagram for Profile_Bin:

I_Bin List of all members.

Detailed Description

}
Assume data points have `w as their weight and `k as their character value.
Assume:
        . l = SUM[ w ]
        . h = SUM[ w*k ]
        . e = SUM[ w*k*k ]
        . s = sqrt(fabs( e/l - (h/l)^2 )), the spread

The value of this bin then is:
        . h/l
The error of the bin can be computed in 2 different ways.
By default (when `i=0) the return error is:
        . 0             if l==0 (l=SUM[ weight ])
        . sqrt(h/(l*l)) if s==0
        . s/sqrt(l)     otherwise
Otherwise (when `i!=0) the return error is:
        . 0             if l==0
        . sqrt(h/l)     if s==0
        . s             otherwise

The gravity center of this bin is its middle.

Definition at line 37 of file Profile_Bin.h.

Public Types

typedef Profile_Bin Like_Current
typedef I_Bin Like_Parent

Public Methods

 H_IID_IMPLEMENT (Profile_Bin)
 Very simple RTTI feature.

 Profile_Bin ()
 Constructor.

 ~Profile_Bin ()
 Destructor.

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

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

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

void set_value (double other, Index i=0)
 Set value identified by i to other.

void set_error (double, Index=0)
 Error cannot be set: it is computed out of L, H, E.

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, T_Value a_character)
 Put data point with weight a_weight and character value a_character.

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 sum_w_
T_Value sum_wk_
T_Value sum_wkk_
Size count_


Member Typedef Documentation

typedef Profile_Bin Profile_Bin::Like_Current
 

Reimplemented from I_Bin.

Definition at line 42 of file Profile_Bin.h.

typedef I_Bin Profile_Bin::Like_Parent
 

Definition at line 43 of file Profile_Bin.h.


Constructor & Destructor Documentation

Profile_Bin::Profile_Bin   [inline]
 

Definition at line 46 of file Profile_Bin.h.

References count_, sum_w_, sum_wk_, and sum_wkk_.

Profile_Bin::~Profile_Bin   [inline]
 

Definition at line 48 of file Profile_Bin.h.


Member Function Documentation

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

Implements I_Bin.

Definition at line 252 of file Profile_Bin.h.

References sum_wk_, and T_Value.

void Profile_Bin::add const Like_Parent   other [inline]
 

Definition at line 152 of file Profile_Bin.h.

References I_Bin::count(), count_, H_IID_IS_EQUAL, HTL_ERR, sum_w_, sum_wk_, sum_wkk_, T_Value, and I_Bin::value().

void Profile_Bin::binomial_div const Like_Parent   other [inline]
 

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

Definition at line 224 of file Profile_Bin.h.

References HTL_ERR, sum_w_, sum_wk_, sum_wkk_, T_Value, and I_Bin::value().

Size Profile_Bin::count   const [inline, virtual]
 

Implements I_Bin.

Definition at line 91 of file Profile_Bin.h.

References count_, and Size.

Referenced by operator==().

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

Implements I_Bin.

Definition at line 258 of file Profile_Bin.h.

References HTL_ERR, sum_wk_, and T_Value.

void Profile_Bin::div const Like_Parent   other [inline]
 

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

Definition at line 201 of file Profile_Bin.h.

References I_Bin::count(), count_, HTL_ERR, sum_w_, sum_wk_, sum_wkk_, T_Value, and I_Bin::value().

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

If index==0 the RMS is returned, if index==1, the Spread is returned.

Implements I_Bin.

Definition at line 68 of file Profile_Bin.h.

References HTL_ERR, Index, sum_w_, sum_wkk_, and value().

Profile_Bin::H_IID_IMPLEMENT Profile_Bin   
 

void Profile_Bin::make const Like_Parent   other [inline]
 

Definition at line 143 of file Profile_Bin.h.

References I_Bin::count(), count_, sum_w_, sum_wk_, sum_wkk_, and I_Bin::value().

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

Implements I_Bin.

Definition at line 256 of file Profile_Bin.h.

References sum_wk_, and T_Value.

void Profile_Bin::mul const Like_Parent   other [inline]
 

Definition at line 188 of file Profile_Bin.h.

References I_Bin::count(), count_, sum_w_, sum_wk_, sum_wkk_, T_Value, and I_Bin::value().

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

Definition at line 132 of file Profile_Bin.h.

References count(), sum_w_, sum_wk_, sum_wkk_, and value().

void Profile_Bin::put T_Value    a_weight,
T_Value    a_character
[inline]
 

Definition at line 123 of file Profile_Bin.h.

References count_, sum_w_, sum_wk_, sum_wkk_, and T_Value.

Referenced by P_ProfileHisto2DVar::fill(), P_ProfileHisto2D::fill(), P_ProfileHisto1DVar::fill(), and P_ProfileHisto1D::fill().

void Profile_Bin::reset   [inline, virtual]
 

Implements I_Bin.

Definition at line 118 of file Profile_Bin.h.

References count_, sum_w_, sum_wk_, sum_wkk_, and T_Value.

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

Implements I_Bin.

Definition at line 115 of file Profile_Bin.h.

References count_, and Size.

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

The previous values are set with the set_value(..) method.

Implements I_Bin.

Definition at line 110 of file Profile_Bin.h.

References HTL_ERR, and Index.

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

    i=1: set l
    i=2: set h
    i=3: set e
    else: nothing is done.
    

Implements I_Bin.

Definition at line 101 of file Profile_Bin.h.

References Index, sum_w_, sum_wk_, and sum_wkk_.

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

Implements I_Bin.

Definition at line 254 of file Profile_Bin.h.

References sum_wk_, and T_Value.

void Profile_Bin::sub const Like_Parent   other [inline]
 

Definition at line 174 of file Profile_Bin.h.

References I_Bin::count(), count_, H_IID_IS_EQUAL, HTL_ERR, sum_w_, sum_wk_, sum_wkk_, T_Value, and I_Bin::value().

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

    i=1: l
    i=2: h
    i=3: e
    i=0 or other: h/l
    

Implements I_Bin.

Definition at line 57 of file Profile_Bin.h.

References Index, sum_w_, sum_wk_, and sum_wkk_.

Referenced by error(), and operator==().


Member Data Documentation

Size Profile_Bin::count_ [private]
 

Definition at line 272 of file Profile_Bin.h.

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

T_Value Profile_Bin::sum_w_ [private]
 

Definition at line 269 of file Profile_Bin.h.

Referenced by add(), binomial_div(), div(), error(), make(), mul(), operator==(), Profile_Bin(), put(), reset(), set_value(), sub(), and value().

T_Value Profile_Bin::sum_wk_ [private]
 

Definition at line 270 of file Profile_Bin.h.

Referenced by add(), binomial_div(), div(), make(), mul(), operator==(), Profile_Bin(), put(), reset(), set_value(), sub(), and value().

T_Value Profile_Bin::sum_wkk_ [private]
 

Definition at line 271 of file Profile_Bin.h.

Referenced by add(), binomial_div(), div(), error(), make(), mul(), operator==(), Profile_Bin(), put(), reset(), set_value(), sub(), and value().


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

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