Go to the previous, next section.
#include <CNCL/Histogram.h>
CN_HISTOGRAM
CNStatistics
None
None
CNHistogram
contains functions to reduce input data to a histogram.
It provides two main output formats:
Either you can create an easy readable array or you can write the results of
the evaluation to a file in a format that can further be processed by
'gnuplot'.
CNHistogram();
CNHistogram(CNParam *);
CNHistogram(char *aName, double l_border, double u_border,
short int num, double normalization = 0.0,
char* aDescription = NIL);
CNHistogram
.
In addition to the member functions required by CNCL, CNHistogram
provides:
void put( double );
double mean() const;
double variance() const;
long trials() const;
double min() const;
double max() const;
boolean end() const;
FALSE
as an histogram evaluation never reaches an
end.
void reset();
Phase status() const;
void set_norm(double);
void print_header (ostream &, char * = "") const;
void print_histo(ostream &) const;
void print_file(char*);
void plot_histo(ostream &, int = 0);
print_header
prefixed with
the string "# " and therefore ignored by gnuplot.
The (optional) second parameter specifies the drawing style: default 0
means that all vertical lines are drawn to the value of the next step
(Step-histogram) a value != 0 means that all vertical lines are drawn
down to the x-axis (Box-histogram). Those output lines, that differ in
both drawing styles are either beginning with `# ' (Step-style) or with
a blank ` '(Box-style). Thus the drawing style can easily be converted
with a text editor by changing those lines appropriately. As only points
are written, the plot command in `gnuplot' has to given with the
specification with lines
.
void plot_file(char*, int);
ostream &operator << (ostream &strm, const CNHistogram &obj);
ostream &operator << (ostream &strm, const CNHistogram *obj);
static CNHistogram * CNHistogram::fill_histo_from_file(char * infile, double lower_bound, double upper_bound, short int number_of_bins, double normalisation, short int use_data_column);
This function is used e.g. by the test program tHistogram
.
Go to the previous, next section.