tk::UniPDF class

Univariate PDF estimator.

Public types

using key_type = long
Key type.
using pair_type = std::pair<const key_type, tk::real>
Pair type.
using map_type = std::unordered_map<key_type, tk::real>
Univariate PDF.

Public static variables

static const std::size_t dim
Number of sample space dimensions.

Constructors, destructors, conversion operators

UniPDF() explicit
Empty constructor for Charm++.
UniPDF(tk::real bs) explicit

Public functions

auto nsample() const -> std::size_t noexcept
void add(tk::real sample)
void addPDF(const UniPDF& p)
void zero() noexcept
Zero bins.
auto map() const -> const map_type& noexcept
auto binsize() const -> tk::real noexcept
auto extents() const -> std::array<long, 2*dim>
auto integral() const -> tk::real

Pack/Unpack: Serialize UniPDF object for Charm++

void pup(PUP::er& p)
void operator|(PUP::er& p, UniPDF& c)
Pack/Unpack serialize operator|.

Typedef documentation

using tk::UniPDF::map_type = std::unordered_map<key_type, tk::real>

Univariate PDF.

The underlying container type is an unordered_map where the key is one bin id corresponding to the single sample space dimension, and the mapped value is the sample counter. The hasher functor used here is the default for the key type provided by the standard library.

Function documentation

tk::UniPDF::UniPDF(tk::real bs) explicit

Parameters
bs in Sample space bin size

Constructor: Initialize univariate PDF container

std::size_t tk::UniPDF::nsample() const noexcept

Returns Number of samples collected

Accessor to number of samples

void tk::UniPDF::add(tk::real sample)

Parameters
sample in Sample to insert

Add sample to univariate PDF

void tk::UniPDF::addPDF(const UniPDF& p)

Parameters
in PDF whose samples to add

Add multiple samples from a PDF

const map_type& tk::UniPDF::map() const noexcept

Returns Constant reference to underlying map

Constant accessor to underlying PDF map

tk::real tk::UniPDF::binsize() const noexcept

Returns Sample space bin size

Constant accessor to bin size

std::array<long, 2*dim> tk::UniPDF::extents() const

Returns {min,max} Minimum and maximum of the bin ids

Return minimum and maximum bin ids of sample space

tk::real tk::UniPDF::integral() const

Returns Integral of the distribution

Compute integral of the distribution across the whole sample space

void tk::UniPDF::pup(PUP::er& p)

Parameters
in/out Charm++'s PUP::er serializer object reference

Pack/Unpack serialize member function

void tk::UniPDF::operator|(PUP::er& p, UniPDF& c)

Pack/Unpack serialize operator|.

Parameters
in/out Charm++'s PUP::er serializer object reference
in/out UniPDF object reference