libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
tcspc::linear_bin_mapper< DataTypes > Class Template Reference

Description

template<typename DataTypes = default_data_types>
class tcspc::linear_bin_mapper< DataTypes >

Bin mapper for linear histograms of arbitrary size.

Template Parameters
DataTypesdata type set specifying datapoint_type and bin_index_type

Public Member Functions

 linear_bin_mapper (arg::offset< typename DataTypes::datapoint_type > offset, arg::bin_width< typename DataTypes::datapoint_type > bin_width, arg::max_bin_index< typename DataTypes::bin_index_type > max_bin_index, arg::clamp< bool > clamp=arg::clamp{false})
 Construct with parameters.
auto n_bins () const -> std::size_t
 Implements bin mapper requirement.
auto operator() (typename DataTypes::datapoint_type datapoint) const -> std::optional< typename DataTypes::bin_index_type >
 Implements bin mapper requirement.

Constructor & Destructor Documentation

◆ linear_bin_mapper()

template<typename DataTypes = default_data_types>
tcspc::linear_bin_mapper< DataTypes >::linear_bin_mapper ( arg::offset< typename DataTypes::datapoint_type > offset,
arg::bin_width< typename DataTypes::datapoint_type > bin_width,
arg::max_bin_index< typename DataTypes::bin_index_type > max_bin_index,
arg::clamp< bool > clamp = arg::clamp{false} )
inlineexplicit

Construct with parameters.

max_bin_index must be in the range of bin_index_type.

A negative bin_width value (together with a positive offset value) can be used to flip the histogram, provided that datapoint_type is a signed type with sufficient range.

Parameters
offsetminimum value mapped to the first bin
bin_widthwidth of each bin (in datapoint units); must not be 0
max_bin_indexnumber of bins minus one (must not be negative)
clampif true, include datapoints outside of the mapped range in the first and last bins

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