Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends

alize::Histo Class Reference

#include <Histo.h>

Inheritance diagram for alize::Histo:
Inheritance graph
[legend]
Collaboration diagram for alize::Histo:
Collaboration graph
[legend]

List of all members.

Public Types

typedef double TData

Public Member Functions

 Histo (unsigned long nbBin=10)
 Histo (const Histo &h)
const Histooperator= (const Histo &h)
virtual ~Histo ()
TData count (unsigned long indBound) const
TData lowerBound (unsigned long indBound) const
TData higherBound (unsigned long indBound) const
TData operator() (TData score, int type=0) const
void accumulateValue (TData value)
void computeHisto (int opt=0)
void div (const real_t factor)
unsigned long size () const
void load (const FileName &f)
void save (const FileName &f) const
void saveGnuplot (const FileName &f) const
virtual String getClassName () const
virtual String toString () const

Static Public Attributes

static const TData EPS = 0.0000000000000000001

Private Member Functions

bool operator== (const Histo &)
bool operator!= (const Histo &)

Private Attributes

unsigned long _nbBin
DoubleVector _bound
DoubleVector _count
DoubleVector _data

Friends

class TestHisto

Detailed Description

Toolkit for histogram computation
Class Histo is the central class for score distributions

Author:
JFB, Frederic Wils
Version:
1.0
Date:
12/9/2003

Definition at line 84 of file Histo.h.


Member Typedef Documentation

typedef double alize::Histo::TData

Definition at line 90 of file Histo.h.


Constructor & Destructor Documentation

Histo::Histo ( unsigned long  nbBin = 10 ) [explicit]

Constructor Initializes an Histo object with nbBin bins

Definition at line 76 of file Histo.cpp.

Histo::Histo ( const Histo h )

Copy constructor

Parameters:
hthe Histo object to copy

Definition at line 79 of file Histo.cpp.

Histo::~Histo (  ) [virtual]

Definition at line 378 of file Histo.cpp.


Member Function Documentation

void Histo::accumulateValue ( TData  value )

Adds a value in the temporary workspace

Parameters:
value

Definition at line 149 of file Histo.cpp.

References _data, and alize::RealVector< T >::addValue().

void Histo::computeHisto ( int  opt = 0 )

Computes the histogram Free the temporary workspace if opt == 0 (default)

Parameters:
optthe option to use
Exceptions:
Exceptionif less than 2 data stored

Definition at line 151 of file Histo.cpp.

References _bound, _count, _data, _nbBin, alize::RealVector< T >::ascendingSort(), alize::RealVector< T >::clear(), EPS, and alize::RealVector< T >::size().

Histo::TData Histo::count ( unsigned long  indBound ) const

Gives the number of elements in the bin

Parameters:
indboundgives the bin number
Returns:
the value

Definition at line 116 of file Histo.cpp.

References _count, and _nbBin.

void Histo::div ( const real_t  factor )

Divides an Histo by a factor

Parameters:
factor

Definition at line 350 of file Histo.cpp.

References _count, and _nbBin.

String Histo::getClassName (  ) const [virtual]

Returns the name of the class

Returns:
the name of the class of the object as a String

Implements alize::Object.

Definition at line 360 of file Histo.cpp.

Histo::TData Histo::higherBound ( unsigned long  indBound ) const

Gives the higher bound of a given bin

Parameters:
indboundgives the bin number
Returns:
the value

Definition at line 109 of file Histo.cpp.

References _bound, and _nbBin.

void Histo::load ( const FileName f )

Loads an Histogramme from a file

Parameters:
ffile name

Definition at line 285 of file Histo.cpp.

References _bound, _count, and alize::String::c_str().

Histo::TData Histo::lowerBound ( unsigned long  indBound ) const

Gives the lower bound of a given bin

Parameters:
indboundgives the bin number
Returns:
the value

Definition at line 102 of file Histo.cpp.

References _bound, and _nbBin.

bool alize::Histo::operator!= ( const Histo  ) [private]

Not implemented

Histo::TData Histo::operator() ( TData  score,
int  type = 0 
) const

Gives the count of the histo for a given score

Parameters:
scorethe score to find
typedetermines the return value. 0 (default) returns directly the count 1 returns the bin
Returns:
the value

Definition at line 123 of file Histo.cpp.

References _bound, _count, and _nbBin.

const Histo & Histo::operator= ( const Histo h )

Assignment operator

Parameters:
hthe Histo object to copy

Definition at line 83 of file Histo.cpp.

References _bound, _count, _data, and _nbBin.

bool alize::Histo::operator== ( const Histo  ) [private]
void Histo::save ( const FileName f ) const

Outputs an histo in a text file

Parameters:
ffile name

Definition at line 322 of file Histo.cpp.

References _bound, _count, _nbBin, and alize::String::c_str().

void Histo::saveGnuplot ( const FileName f ) const

Outputs an histo in a text file (GnuPlot format)

Parameters:
ffile name

Definition at line 333 of file Histo.cpp.

References _bound, _count, _nbBin, and alize::String::c_str().

unsigned long Histo::size (  ) const

Returns the number of bins

Definition at line 358 of file Histo.cpp.

References _nbBin.

String Histo::toString (  ) const [virtual]

This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object

Returns:
a description of the object

Reimplemented from alize::Object.

Definition at line 362 of file Histo.cpp.

References _bound, _count, _nbBin, and alize::String::valueOf().


Friends And Related Function Documentation

friend class TestHisto [friend]

Definition at line 86 of file Histo.h.


Member Data Documentation

Definition at line 182 of file Histo.h.

Referenced by computeHisto(), count(), div(), load(), operator()(), operator=(), save(), saveGnuplot(), and toString().

Definition at line 183 of file Histo.h.

Referenced by accumulateValue(), computeHisto(), and operator=().

unsigned long alize::Histo::_nbBin [private]
const Histo::TData Histo::EPS = 0.0000000000000000001 [static]

Definition at line 176 of file Histo.h.

Referenced by computeHisto().


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