Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::coalescence::occupancy_spectrum::memoize Namespace Reference

Utils for memoization of OccupancySpectrumDistribution objects (optimization) More...

Classes

struct  hash_parameters
 To store pairs of distribution parameters \(k\) and \(N\) in a hashmap. More...
 

Functions

template<class FilterPolicy = filter_policy::return_always_true, class EditorPolicy = editor_policy::identity>
const ProbabilityDistribution< FilterPolicy, EditorPolicy > & memoize (int k, int N)
 Store on RAM the entire distributions of occupancy spectrums for every pair \(k\) and \(N\).
 

Detailed Description

Utils for memoization of OccupancySpectrumDistribution objects (optimization)

Function Documentation

◆ memoize()

template<class FilterPolicy = filter_policy::return_always_true, class EditorPolicy = editor_policy::identity>
const ProbabilityDistribution< FilterPolicy, EditorPolicy > & quetzal::coalescence::occupancy_spectrum::memoize::memoize ( int  k,
int  N 
)

Store on RAM the entire distributions of occupancy spectrums for every pair \(k\) and \(N\).

Parameters
kthe number of balls (lineages) to throw (coalesce)
Nthe nummber of urns (parents)
Returns
A reference on a pre-computed OccupancySpectrumDistribution
Remarks
Builds the distribution the first time that the pair \(\{k,N\}\) is called. Next time the pair is encountered, it returns a reference to the already-computed result.