tk::BiPDF class

Joint bivariate PDF estimator.

Public types

using key_type = std::array<long, dim>
Key type.
using pair_type = std::pair<const key_type, tk::real>
Pair type.
using map_type = std::unordered_map<key_type, tk::real, key_hash>
Joint bivariate PDF.

Public static variables

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

Constructors, destructors, conversion operators

BiPDF() explicit
Empty constructor for Charm++.
BiPDF(const std::vector<tk::real>& bs) explicit

Public functions

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

Pack/Unpack: Serialize BiPDF object for Charm++

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

Typedef documentation

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

Joint bivariate PDF.

The underlying container type is an unordered_map where the key is two bin ids corresponding to the two sample space dimensions, and the mapped value is the sample counter. The hasher functor, defined by key_hash provides an XORed hash of the two bin ids.

Function documentation

tk::BiPDF::BiPDF(const std::vector<tk::real>& bs) explicit

Parameters
bs in Sample space bin size in both directions

Constructor: Initialize joint bivariate PDF container

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

Returns Number of samples collected

Accessor to number of samples

void tk::BiPDF::add(std::array<tk::real, dim> sample)

Parameters
sample in Sample to add

Add sample to bivariate PDF

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

Parameters
in PDF whose samples to add

Add multiple samples from a PDF

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

Returns Constant reference to underlying map

Constant accessor to underlying PDF map

const std::array<tk::real, dim>& tk::BiPDF::binsize() const noexcept

Returns Constant reference to sample space bin sizes

Constant accessor to bin sizes

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

Returns {xmin,xmax,ymin,ymax} Minima and maxima of the bin ids in a std::array

Return minimum and maximum bin ids of sample space in both dimensions

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

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

Pack/Unpack serialize member function

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

Pack/Unpack serialize operator|.

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