Anaphe Home Page Reference Documentation

Main Page     Namespaces     Classes     Source Code    

Gravity_Bin_1D Class Reference

#include <Gravity_Bin_1D.h>

Inheritance diagram for Gravity_Bin_1D:

I_Bin List of all members.

Detailed Description

This kind of bins is the same as Weighted_Bin except that there is an extra information about the gravity center of data points that are in this bin:

center = (old center * old value + value * point)/(old value + value)

The value of this bin is:

value = SUM[ weight ]

The error of this bin is:

error = sqrt( SUM[ weight*weight ] )

Definition at line 29 of file Gravity_Bin_1D.h.

Public Types

typedef Gravity_Bin_1D Like_Current
typedef I_Bin Like_Parent

Public Methods

 H_IID_IMPLEMENT (Gravity_Bin_1D)
 Very simple RTTI feature.

 Gravity_Bin_1D ()
 Constructor.

 ~Gravity_Bin_1D ()
 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.

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.

double center (Index=0) const
 Gravity center on axis i associated with this bin.

void set_center (double other)
 Change/set the center of the bin to other.

int offset (Index=0) const
 Relative or absolute position for the center.

void reset ()
 Reset bin contents and center to 0.

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

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

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

void combine_centers (const Like_Parent &other)
 Combine centers of current bin with another Gravity Bin.

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.


Protected Methods

void put (T_Value a_weight)


Member Typedef Documentation

typedef Gravity_Bin_1D Gravity_Bin_1D::Like_Current
 

Reimplemented from I_Bin.

Definition at line 34 of file Gravity_Bin_1D.h.

typedef I_Bin Gravity_Bin_1D::Like_Parent
 

Definition at line 35 of file Gravity_Bin_1D.h.


Constructor & Destructor Documentation

Gravity_Bin_1D::Gravity_Bin_1D   [inline]
 

Definition at line 38 of file Gravity_Bin_1D.h.

Gravity_Bin_1D::~Gravity_Bin_1D   [inline]
 

Definition at line 40 of file Gravity_Bin_1D.h.


Member Function Documentation

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

Implements I_Bin.

Definition at line 217 of file Gravity_Bin_1D.h.

References T_Value.

void Gravity_Bin_1D::add const Like_Parent   other [inline]
 

Definition at line 137 of file Gravity_Bin_1D.h.

References combine_centers(), I_Bin::count(), I_Bin::error(), T_Value, and I_Bin::value().

void Gravity_Bin_1D::binomial_div const Like_Parent   other [inline]
 

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

Definition at line 193 of file Gravity_Bin_1D.h.

References combine_centers(), I_Bin::count(), I_Bin::error(), HTL_ERR, T_Value, and I_Bin::value().

double Gravity_Bin_1D::center Index    = 0 const [inline, virtual]
 

Reimplemented from I_Bin.

Definition at line 61 of file Gravity_Bin_1D.h.

References Index.

Referenced by operator==().

void Gravity_Bin_1D::combine_centers const Like_Parent   other [inline]
 

Definition at line 126 of file Gravity_Bin_1D.h.

References I_Bin::center(), T_Value, and I_Bin::value().

Referenced by add(), binomial_div(), div(), mul(), and sub().

Size Gravity_Bin_1D::count   const [inline, virtual]
 

Implements I_Bin.

Definition at line 49 of file Gravity_Bin_1D.h.

References Size.

Referenced by operator==().

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

Implements I_Bin.

Definition at line 223 of file Gravity_Bin_1D.h.

References HTL_ERR, and T_Value.

void Gravity_Bin_1D::div const Like_Parent   other [inline]
 

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

Definition at line 167 of file Gravity_Bin_1D.h.

References combine_centers(), I_Bin::count(), I_Bin::error(), HTL_ERR, T_Value, and I_Bin::value().

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

Implements I_Bin.

Definition at line 46 of file Gravity_Bin_1D.h.

References Index.

Referenced by operator==().

Gravity_Bin_1D::H_IID_IMPLEMENT Gravity_Bin_1D   
 

void Gravity_Bin_1D::make const Like_Parent   other [inline]
 

Definition at line 117 of file Gravity_Bin_1D.h.

References I_Bin::center(), I_Bin::count(), I_Bin::error(), T_Value, and I_Bin::value().

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

Implements I_Bin.

Definition at line 221 of file Gravity_Bin_1D.h.

References T_Value.

void Gravity_Bin_1D::mul const Like_Parent   other [inline]
 

Definition at line 154 of file Gravity_Bin_1D.h.

References combine_centers(), I_Bin::count(), I_Bin::error(), T_Value, and I_Bin::value().

int Gravity_Bin_1D::offset Index    = 0 const [inline, virtual]
 

\item Index = 1 means relative. \item Index = 0 means absolute.

Reimplemented from I_Bin.

Definition at line 72 of file Gravity_Bin_1D.h.

References Index.

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

Definition at line 106 of file Gravity_Bin_1D.h.

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

void Gravity_Bin_1D::put T_Value    a_weight,
T_Value    a_point
[inline]
 

Definition at line 88 of file Gravity_Bin_1D.h.

References put(), and T_Value.

void Gravity_Bin_1D::put T_Value    a_weight [inline, protected]
 

Definition at line 79 of file Gravity_Bin_1D.h.

References T_Value.

Referenced by T_Histo1DVar::fill(), T_Histo1D::fill(), and put().

void Gravity_Bin_1D::reset   [inline, virtual]
 

Implements I_Bin.

Definition at line 75 of file Gravity_Bin_1D.h.

References T_Value.

void Gravity_Bin_1D::set_center double    other [inline, virtual]
 

Reimplemented from I_Bin.

Definition at line 64 of file Gravity_Bin_1D.h.

References T_Value.

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

Implements I_Bin.

Definition at line 58 of file Gravity_Bin_1D.h.

References Size.

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

Implements I_Bin.

Definition at line 55 of file Gravity_Bin_1D.h.

References Index, and T_Value.

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

Implements I_Bin.

Definition at line 52 of file Gravity_Bin_1D.h.

References Index, and T_Value.

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

Implements I_Bin.

Definition at line 219 of file Gravity_Bin_1D.h.

References T_Value.

void Gravity_Bin_1D::sub const Like_Parent   other [inline]
 

Definition at line 145 of file Gravity_Bin_1D.h.

References combine_centers(), I_Bin::count(), I_Bin::error(), T_Value, and I_Bin::value().

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

Implements I_Bin.

Definition at line 43 of file Gravity_Bin_1D.h.

Referenced by operator==().


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

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