KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
kjb::Histogram_2d Class Reference

#include <prob_histogram.h>

Public Member Functions

template<class InputIterator >
 Histogram_2d (InputIterator first, InputIterator last, size_t num_bins_1, size_t num_bins_2, const std::pair< double, double > &range_1, const std::pair< double, double > &range_2)
 Create a 2D histogram from bivirate data given the number of bins of each dimension. More...
 
size_t num_bins_1 () const
 Return the number of bins of this histogram. More...
 
size_t num_bins_2 () const
 
double bin_size_1 () const
 Return the bin size of this histogram. More...
 
double bin_size_2 () const
 
const std::pair< double, double > & range_1 () const
 Return the ranges histogram. More...
 
const std::pair< double, double > & range_2 () const
 
const std::map< double,
std::map< double, int > > & 
as_map () const
 Return a map of the histogram. More...
 
size_t & num_bins_1 ()
 Return the non-const veresion. More...
 
size_t & num_bins_2 ()
 
double & bin_size_1 ()
 
double & bin_size_2 ()
 
std::pair< double, double > & range_1 ()
 
std::pair< double, double > & range_2 ()
 
const Matrixas_matrix () const
 Return the 2D histogram as a kjb::Matrix Note: the 2D histogrma is not normalized. More...
 
Matrix normalized () const
 Return the normalized 2D histogram of which the sum of all the elements 1.0. More...
 
Matrix densities () const
 Return the densities of the 2D histogram for each cell p, density(p) = counts(p) * area(p)/total_couns. More...
 

Constructor & Destructor Documentation

template<class InputIterator >
kjb::Histogram_2d::Histogram_2d ( InputIterator  first,
InputIterator  last,
size_t  num_bins_1,
size_t  num_bins_2,
const std::pair< double, double > &  range_1,
const std::pair< double, double > &  range_2 
)
inline

Create a 2D histogram from bivirate data given the number of bins of each dimension.

Member Function Documentation

const std::map<double, std::map<double, int> >& kjb::Histogram_2d::as_map ( ) const

Return a map of the histogram.

const Matrix & kjb::Histogram_2d::as_matrix ( ) const
inline

Return the 2D histogram as a kjb::Matrix Note: the 2D histogrma is not normalized.

double kjb::Histogram_2d::bin_size_1 ( ) const
inline

Return the bin size of this histogram.

double & kjb::Histogram_2d::bin_size_1 ( )
inline
double kjb::Histogram_2d::bin_size_2 ( ) const
inline
double & kjb::Histogram_2d::bin_size_2 ( )
inline
Matrix kjb::Histogram_2d::densities ( ) const
inline

Return the densities of the 2D histogram for each cell p, density(p) = counts(p) * area(p)/total_couns.

Matrix kjb::Histogram_2d::normalized ( ) const
inline

Return the normalized 2D histogram of which the sum of all the elements 1.0.

size_t kjb::Histogram_2d::num_bins_1 ( ) const
inline

Return the number of bins of this histogram.

size_t & kjb::Histogram_2d::num_bins_1 ( )
inline

Return the non-const veresion.

size_t kjb::Histogram_2d::num_bins_2 ( ) const
inline
size_t & kjb::Histogram_2d::num_bins_2 ( )
inline
const std::pair< double, double > & kjb::Histogram_2d::range_1 ( ) const
inline

Return the ranges histogram.

std::pair< double, double > & kjb::Histogram_2d::range_1 ( )
inline
const std::pair< double, double > & kjb::Histogram_2d::range_2 ( ) const
inline
std::pair< double, double > & kjb::Histogram_2d::range_2 ( )
inline

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