Alexandria
2.18
Please provide a description of the project.
|
#include <Histogram.h>
Classes | |
struct | ComputationImpl |
struct | ComputationInterface |
struct | ConstantWeight |
Public Member Functions | |
template<typename IterType , typename BinType , typename = typename std::enable_if<std::is_move_constructible<BinType>::value>::type> | |
Histogram (IterType begin, IterType end, BinType &&bin_type) | |
template<typename IterType , typename WeightIterType , typename BinType , typename = typename std::enable_if<std::is_move_constructible<BinType>::value>::type> | |
Histogram (IterType begin, IterType end, WeightIterType wbegin, WeightIterType wend, BinType &&bin_type) | |
Histogram (const Histogram &other) | |
Histogram (Histogram &&)=default | |
Histogram & | operator= (const Histogram &)=default |
Histogram & | operator= (Histogram &&)=default |
size_t | size () const |
std::vector< WeightType > | getCounts () const |
std::vector< VarType > | getEdges () const |
std::vector< VarType > | getBins () const |
std::pair< VarType, VarType > | getBinEdges (size_t i) const |
void | clip (VarType min, VarType max) |
std::tuple< VarType, VarType, VarType > | getStats () const |
Private Attributes | |
std::unique_ptr < ComputationInterface > | m_binning_concept |
VarType | The type of the continuous variable. Must be an arithmetic type (either integral or floating point) |
WeightType | The type used for the counts, which is the same as the one accepted for the weights. |
Definition at line 137 of file Histogram.h.
|
inline |
Constructor
IterType | Iterator type for both the edges and the values of the variable |
BinType | A concrete movable implementation of BinStrategy |
begin | Beginning of the data |
end | End of the data |
bin_type | An instance of BinType. It will be taken ownership of by the Histogram |
Definition at line 157 of file Histogram.h.
References Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept, and std::move().
|
inline |
Constructor
IterType | Iterator type for both the edges and the values of the variable |
WeightIterType | Iterator type for the weights |
BinType | A concrete movable implementation of BinStrategy |
begin | Beginning of the data |
end | End of the data |
wbegin | Beginning of the weights |
wend | End of the weights |
bin_type | An instance of BinType. It will be taken ownership of by the Histogram |
Definition at line 186 of file Histogram.h.
References Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept, and std::move().
|
inline |
Copy constructor
Definition at line 196 of file Histogram.h.
References Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept.
|
default |
Move constructor
|
inline |
Clip the histogram to the given range
min | Minimum value to keep |
max | Maximum value to keep |
Definition at line 270 of file Histogram.h.
References Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept.
|
inline |
i | Bin index |
Definition at line 259 of file Histogram.h.
References Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept.
|
inline |
Definition at line 246 of file Histogram.h.
References std::generate(), and Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept.
|
inline |
Definition at line 227 of file Histogram.h.
References Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept.
|
inline |
Definition at line 238 of file Histogram.h.
References Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept.
|
inline |
Compute the mean, the median and the standard deviation of the histogram
\[ \mu = \frac{\sum_{i=0}^{n} \mathit{bin}_i * \mathit{count}_i}{\sum_{i=0}^{n}count_i} \]
\[ \sigma = \sqrt{\frac{\sum_{i=0}^n \mathit{count}_i \times (\mathit{center}_i - \mu)^2}{\sum_{i=0}^n \mathit{count}_i}} \]
To find the median, a second pass is done over the bins, computing the cumulative distribution until the bin where it is greater or equal to 0.5. The median is then interpolated between the lower and higher edges.
Definition at line 289 of file Histogram.h.
References Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept.
|
default |
Assignment operator
|
default |
Move assignment operator
|
inline |
Definition at line 219 of file Histogram.h.
References Euclid::Histogram::Histogram< VarType, WeightType >::m_binning_concept.
|
private |
Definition at line 381 of file Histogram.h.
Referenced by Euclid::Histogram::Histogram< VarType, WeightType >::clip(), Euclid::Histogram::Histogram< VarType, WeightType >::getBinEdges(), Euclid::Histogram::Histogram< VarType, WeightType >::getBins(), Euclid::Histogram::Histogram< VarType, WeightType >::getCounts(), Euclid::Histogram::Histogram< VarType, WeightType >::getEdges(), Euclid::Histogram::Histogram< VarType, WeightType >::getStats(), Euclid::Histogram::Histogram< VarType, WeightType >::Histogram(), and Euclid::Histogram::Histogram< VarType, WeightType >::size().