Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Member Functions | List of all members
ska::cheetah::utils::BinMap< DataType > Class Template Reference

Explicitly map a range on to a set of constant width indexed data bins. More...

#include <cheetah/utils/BinMap.h>

Collaboration diagram for ska::cheetah::utils::BinMap< DataType >:
Collaboration graph

Public Member Functions

 BinMap (unsigned int number_of_bins)
 
 BinMap (unsigned int number_of_bins, DataType start, DataType const &end)
 construct a binning map, More...
 
void reset (unsigned int number_of_bins)
 reset the number of bins
 
void set_lower_bound (DataType)
 set the assignemnt value for the first bin (n.b. not the same as the lower limit of the first bin)
 
void set_bounds (DataType lower, DataType upper)
 set the the lower bound for first bin
 
void set_upper_bound (DataType const &)
 
void set_bin_width (DataType)
 set the width of each bin
 
DataType upper_bound () const
 
DataType lower_bound () const
 
unsigned int bin_index (DataType const &) const
 give the bin Index of the value. n.b no range checks are made so passing endValue() will return an invalid index
 
DataType bin_width () const
 the width of a the bin (all are the same width)
 
unsigned int number_of_bins () const
 the total number of bins
 
DataType bin_start (unsigned int index) const
 
DataType bin_end (unsigned int index) const
 
DataType bin_assignment_number (int index) const
 
unsigned last_bin_index () const
 
DataType last_bin_assignment_value () const
 
DataType first_bin_assignment_value () const
 
bool equal (const BinMap< DataType > &map_1) const
 

Detailed Description

template<typename DataType>
class ska::cheetah::utils::BinMap< DataType >

Explicitly map a range on to a set of constant width indexed data bins.

This class provides only scaling details, and does not actually store any data. The indes should be used to map to a suitable container

index: 0 1 2 ]--------------—]-------------—]-------------—] lower_bound upper_bound+width upper_bound

Definition at line 48 of file BinMap.h.

Constructor & Destructor Documentation

◆ BinMap()

template<typename DataType >
ska::cheetah::utils::BinMap< DataType >::BinMap ( unsigned int  number_of_bins,
DataType  start,
DataType const &  end 
)

construct a binning map,

Parameters
startthe lower_bound
endthe upper_bound

Definition at line 91 of file BinMap.cpp.

92  : _n_bins(number_of_bins)
93  , _lower(std::move(start))
94 {
95  set_upper_bound(end);
96 }
unsigned int number_of_bins() const
the total number of bins
Definition: BinMap.cpp:191

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