eosim::statics::Histogram Class Reference
[Data Collectors]

#include <eosim/statics/histogram.hpp>

Inheritance diagram for eosim::statics::Histogram:

Inheritance graph
[legend]
List of all members.

Detailed Description

Abstract Histogram.

Author:
Sebastián Alaggia
Version:
1.1.0
Date:
2005

This is the parent class of all Histograms. It contains the basics operations of all histograms but you can’t use it directly. Histograms store punctual values, but the pair (x1, y1) is logged and then the pair (x1, y2) is logged the histogram record the pair (x1, y1 + y2).


Public Member Functions

virtual ~Histogram ()
 The destructor of Histogram.
void reset ()
 This operation erases every value registered in the histogram.
void print (unsigned int cantCell)
 This operation prints the histogram in the standard output. cantCell indicates how many bars have you histogram.
void print (unsigned int cantCell, const char *path)
 This operation prints the histogram in path file. cantCell indicates how many bars have you histogram.
void table (unsigned int cantCell)
 This operation prints a table with the values stored in the histogram in the standard output . cantCell indicates how many rows have you table.
void table (unsigned int cantCell, const char *path)
 This operation prints a table with the values stored in the histogram in path file.
bool empty ()
 This operation returns 1 if the histogram is empty.
double getVariance ()
 This operation returns the variance registered in the histogram.
double getMean ()
 This operation returns the mean value registered in the histogram.
std::string getName ()
 This operation returns the histogram’s name.

Protected Member Functions

 Histogram (std::string name)
std::string printH (unsigned int cantCell, bool graphic)
 This is an auxiliary operation used to print histograms.
void log (double x, double y)
 This operations register x and y in the histogram.

Protected Attributes

double count
double total
double sosq
std::map< double, double > cell
std::pair< double, double > min
std::pair< double, double > max
std::string name


Member Function Documentation

string Histogram::printH ( unsigned int  cantCell,
bool  graphic 
) [protected]

This is an auxiliary operation used to print histograms.

Basically the operations Histogram::table and Histogram::print are wrappers for this operation.

Note:
This is an auxiliar operation of Histogram::table and Histogram::print. This an expensive operation, because it has to go through all logged observations.

If cantCell is less or equal than zero, the values stored in the histogram won't be shown.

Bug:
There was a bug when the histogram is printed, more specifically when an auxiliar vector (used to print the histogram) is assigned. This bug is corrected.

Note:
If the histogram is empty no data will be shown.

void Histogram::log ( double  x,
double  y 
) [protected]

This operations register x and y in the histogram.

Note:
The histogram store punctual values, but if an two pairs with the same x-value are logged, the pair stored records the sum of y-values.

double Histogram::getVariance (  ) 

This operation returns the variance registered in the histogram.

Note:
If the histogram is empty, the variance returned is 0.

double Histogram::getMean (  ) 

This operation returns the mean value registered in the histogram.

Note:
If the histogram is empty, the variance returned is 0.


Generated on Tue Oct 14 16:49:03 2008 for EOSimulator by  doxygen 1.5.2