Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.5new_solver
   Version 1.0.5dev
      Class Index
      File List
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads

Histogram1D Class Reference

Class for 1D histogram type representation of data. More...

#include <histogram.hpp>

Inheritance diagram for Histogram1D:
Histogram

List of all members.

Public Member Functions

 Histogram1D (uint32_t n, const double range[2])
 Constructor for n bin histogram with ranges.
 Histogram1D (uint32_t n, const std::vector< double > &xdata, histogram_accumulation_e type=HISTOGRAM_ACCUMULATION_CLOSEST)
 Constructor for n bin histogram from scatter data with even weights.
 Histogram1D (uint32_t n, const std::vector< double > &xdata, const std::vector< double > &wdata, histogram_accumulation_e type=HISTOGRAM_ACCUMULATION_CLOSEST)
 Constructor for n bin histogram from scatter data with weights wrom wdata.
virtual ~Histogram1D ()
 Destructor.
uint32_t n (void) const
 Return the number of bins.
double step (void) const
 Return the step size.
double coord (uint32_t i) const
 Return the coordinate on bin i.
void accumulate (uint32_t i, double weight)
 Accumulate weight on bin i.
void accumulate_closest (double x, double weight)
 Accumulate weight to closest bin to x.
void accumulate_linear (double x, double weight)
 Accumulate weight on bins around x linearly.
void convert_to_density (void)
 Convert histogram to density.
void get_range (double range[2]) const
 Return data range.
void get_bin_range (double &min, double &max) const
 Return bin range.
std::vector< double > & get_data (void)
 Return a reference to the histogram data.
const std::vector< double > & get_data (void) const
 Return a reference to the histogram data.
const double & operator() (uint32_t i) const
 Return a const reference to the weight on bin i.
double & operator() (uint32_t i)
 Return a reference to the weight on bin i.
const Histogram1Doperator*= (double x)
 Scale histogram.

Detailed Description

Class for 1D histogram type representation of data.


Constructor & Destructor Documentation

Histogram1D::Histogram1D ( uint32_t  n,
const double  range[2] 
)

Constructor for n bin histogram with ranges.

Histogram1D::Histogram1D ( uint32_t  n,
const std::vector< double > &  xdata,
histogram_accumulation_e  type = HISTOGRAM_ACCUMULATION_CLOSEST 
)

Constructor for n bin histogram from scatter data with even weights.

Selected accumulation operator type is used. Defaults to closest bin accumulation.

Histogram1D::Histogram1D ( uint32_t  n,
const std::vector< double > &  xdata,
const std::vector< double > &  wdata,
histogram_accumulation_e  type = HISTOGRAM_ACCUMULATION_CLOSEST 
)

Constructor for n bin histogram from scatter data with weights wrom wdata.

Selected accumulation operator type is used. Defaults to closest bin accumulation.

virtual Histogram1D::~Histogram1D (  )  [virtual]

Destructor.


Member Function Documentation

void Histogram1D::accumulate ( uint32_t  i,
double  weight 
) [inline]

Accumulate weight on bin i.

Not a safe function. Input not checked.

void Histogram1D::accumulate_closest ( double  x,
double  weight 
)

Accumulate weight to closest bin to x.

void Histogram1D::accumulate_linear ( double  x,
double  weight 
)

Accumulate weight on bins around x linearly.

Accumulation is done on two neighbouring bins around point x. The distribution of weight is done using inverse linear interpolation.

This is a safe function. Accumulation outside histogram range is discarded.

void Histogram1D::convert_to_density ( void   ) 

Convert histogram to density.

Assuming the histogram has been filled with "counts", this function scales the counts to count density.

double Histogram1D::coord ( uint32_t  i  )  const

Return the coordinate on bin i.

void Histogram1D::get_bin_range ( double &  min,
double &  max 
) const

Return bin range.

Returns minimum and maximum values on any bin in histogram.

const std::vector<double>& Histogram1D::get_data ( void   )  const [inline]

Return a reference to the histogram data.

std::vector<double>& Histogram1D::get_data ( void   )  [inline]

Return a reference to the histogram data.

void Histogram1D::get_range ( double  range[2]  )  const

Return data range.

uint32_t Histogram1D::n ( void   )  const [inline]

Return the number of bins.

double& Histogram1D::operator() ( uint32_t  i  )  [inline]

Return a reference to the weight on bin i.

const double& Histogram1D::operator() ( uint32_t  i  )  const [inline]

Return a const reference to the weight on bin i.

const Histogram1D& Histogram1D::operator*= ( double  x  ) 

Scale histogram.

double Histogram1D::step ( void   )  const [inline]

Return the step size.


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


Reference manual for Ion Beam Simulator 1.0.5dev
Generated by Doxygen 1.7.1 on Mon Feb 6 2012 15:07:16.