xerus
a general purpose tensor library
xerus::misc::LogHistogram Class Reference

A logarithmic histogram, i.e. the size of all buckets is given by a constant factor [x - x*base) More...

#include <histogram.h>

Collaboration diagram for xerus::misc::LogHistogram:

Public Member Functions

 LogHistogram (const double _base)
 
void add (double _value, size_t _count=1)
 
void dump_to_file (const std::string &_fileName) const
 
LogHistogramoperator+= (const LogHistogram &_other)
 

Static Public Member Functions

static LogHistogram read_from_file (const std::string &_fileName)
 

Public Attributes

double base
 
std::map< int, size_t > buckets
 
size_t totalCount
 

Detailed Description

A logarithmic histogram, i.e. the size of all buckets is given by a constant factor [x - x*base)

Definition at line 37 of file histogram.h.

Constructor & Destructor Documentation

◆ LogHistogram()

xerus::misc::LogHistogram::LogHistogram ( const double  _base)
explicit

Definition at line 31 of file histogram.cpp.

Member Function Documentation

◆ add()

void xerus::misc::LogHistogram::add ( double  _value,
size_t  _count = 1 
)

Definition at line 42 of file histogram.cpp.

◆ dump_to_file()

void xerus::misc::LogHistogram::dump_to_file ( const std::string &  _fileName) const

Definition at line 80 of file histogram.cpp.

◆ operator+=()

LogHistogram & xerus::misc::LogHistogram::operator+= ( const LogHistogram _other)

Definition at line 33 of file histogram.cpp.

◆ read_from_file()

LogHistogram xerus::misc::LogHistogram::read_from_file ( const std::string &  _fileName)
static

Definition at line 49 of file histogram.cpp.

Member Data Documentation

◆ base

double xerus::misc::LogHistogram::base

Definition at line 39 of file histogram.h.

◆ buckets

std::map<int, size_t> xerus::misc::LogHistogram::buckets

Definition at line 40 of file histogram.h.

◆ totalCount

size_t xerus::misc::LogHistogram::totalCount

Definition at line 41 of file histogram.h.


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