tk::TriPDF class

Joint trivariate 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 trivariate PDF.

Public static variables

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

Constructors, destructors, conversion operators

TriPDF() explicit
Empty constructor for Charm++.
TriPDF(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 TriPDF& 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>
Return minimum and maximum bin ids of sample space in all three dimensions.

Pack/Unpack: Serialize BiPDF object for Charm++

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

Typedef documentation

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

Joint trivariate PDF.

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

Function documentation

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

Parameters
bs in Sample space bin size in all three directions

Constructor: Initialize joint trivariate PDF container

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

Returns Number of samples collected

Accessor to number of samples

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

Parameters
sample in Sample to add

Add sample to trivariate PDF

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

Parameters
in PDF whose samples to add

Add multiple samples from a PDF

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

Returns Constant reference to underlying map

Constant accessor to underlying PDF map

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

Returns Constant reference to sample space bin sizes

Constant accessor to bin sizes

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

Return minimum and maximum bin ids of sample space in all three dimensions.

Returns {xmin,xmax,ymin,ymax,zmin,zmax} Minima and maxima of bin the ids

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

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

Pack/Unpack serialize member function

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

Pack/Unpack serialize operator|.

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