Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Euclid::Histogram::Binning::EdgeVector< VarType > Class Template Reference

#include <EdgeVector.h>

Inheritance diagram for Euclid::Histogram::Binning::EdgeVector< VarType >:
Inheritance graph
[legend]
Collaboration diagram for Euclid::Histogram::Binning::EdgeVector< VarType >:
Collaboration graph
[legend]

Public Member Functions

virtual ~EdgeVector ()=default
 
 EdgeVector (EdgeVector &&)=default
 
template<typename... Args>
 EdgeVector (Args &&... args)
 
 EdgeVector (const EdgeVector &)=default
 
ssize_t getBinIndex (VarType value) const final
 
std::pair< VarType, VarType > getBinEdges (size_t i) const final
 
VarType getEdge (size_t i) const final
 
- Public Member Functions inherited from Euclid::Histogram::BinStrategy< VarType >
 BinStrategy ()
 
virtual ~BinStrategy ()=default
 
size_t getBinCount () const
 
virtual std::vector< VarType > getEdges () const
 
virtual VarType getBin (size_t i) const
 

Private Attributes

std::vector< VarType > m_edges
 

Additional Inherited Members

- Protected Attributes inherited from Euclid::Histogram::BinStrategy< VarType >
size_t m_nbins
 

Detailed Description

template<typename VarType>
class Euclid::Histogram::Binning::EdgeVector< VarType >

Bin strategy based on a fixed set of edges given by the user. The number of bins is equal to the number of edges minus one. Each interval is open to the right, except the last one, which is closed. So,

\[ \mathit{bin}_i = [\mathit{edge}_{i}, \mathit{edge}_{i+i}) \\ ... \\ \mathit{bin}_n= [\mathit{edge}_{n}, \mathit{edge}_{n+i}] \]

Definition at line 47 of file EdgeVector.h.

Constructor & Destructor Documentation

◆ ~EdgeVector()

template<typename VarType >
virtual Euclid::Histogram::Binning::EdgeVector< VarType >::~EdgeVector ( )
virtualdefault

◆ EdgeVector() [1/3]

template<typename VarType >
Euclid::Histogram::Binning::EdgeVector< VarType >::EdgeVector ( EdgeVector< VarType > &&  )
default

◆ EdgeVector() [2/3]

template<typename VarType >
template<typename... Args>
Euclid::Histogram::Binning::EdgeVector< VarType >::EdgeVector ( Args &&...  args)
inlineexplicit

◆ EdgeVector() [3/3]

template<typename VarType >
Euclid::Histogram::Binning::EdgeVector< VarType >::EdgeVector ( const EdgeVector< VarType > &  )
default

Member Function Documentation

◆ getBinEdges()

template<typename VarType >
std::pair< VarType, VarType > Euclid::Histogram::Binning::EdgeVector< VarType >::getBinEdges ( size_t  i) const
inlinefinalvirtual

Get the two edges corresponding to the bin i

Parameters
iThe bin index
Returns
The two bin edges

Reimplemented from Euclid::Histogram::BinStrategy< VarType >.

Definition at line 69 of file EdgeVector.h.

References Euclid::Histogram::Binning::EdgeVector< VarType >::m_edges, and std::make_pair().

Here is the call graph for this function:

◆ getBinIndex()

template<typename VarType >
ssize_t Euclid::Histogram::Binning::EdgeVector< VarType >::getBinIndex ( VarType  value) const
inlinefinalvirtual

Get the bin index corresponding to the given value

Parameters
valueThe value to map to a bin
Returns
The bin index. If value is outside of the bounds, a negative number or a value bigger or equal to m_nbins can be used to mark the fact

Implements Euclid::Histogram::BinStrategy< VarType >.

Definition at line 60 of file EdgeVector.h.

References std::vector< T >::back(), std::vector< T >::begin(), std::vector< T >::end(), std::find_if(), std::vector< T >::front(), and Euclid::Histogram::Binning::EdgeVector< VarType >::m_edges.

Here is the call graph for this function:

◆ getEdge()

template<typename VarType >
VarType Euclid::Histogram::Binning::EdgeVector< VarType >::getEdge ( size_t  e) const
inlinefinalvirtual

Get the edge value e. Note that there are always one more edge than bins: i.e. the bin 0 has the edges (0, 1), the bin 1 the edges (1, 2), etc...

Implements Euclid::Histogram::BinStrategy< VarType >.

Definition at line 73 of file EdgeVector.h.

References Euclid::Histogram::Binning::EdgeVector< VarType >::m_edges.

Member Data Documentation

◆ m_edges

template<typename VarType >
std::vector<VarType> Euclid::Histogram::Binning::EdgeVector< VarType >::m_edges
private

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