28#include "pod_vector.h"
66 const double* _masses,
90 inline const double* get_lProbs()
const {
return atom_lProbs; }
168 inline void ensureModeConf() {
if (
mode_conf ==
nullptr) setupMode(); }
180 std::priority_queue<ProbAndConfPtr, pod_vector<ProbAndConfPtr> > pq;
187 const double min_lprob;
188 size_t current_bucket;
189 size_t initialized_until;
192 bool add_next_conf();
194 size_t bucket_no(
double lprob) {
return static_cast<size_t>( (
mode_lprob - lprob) * 100.0 ); }
220 while(current_count <= idx)
238 virtual ~MarginalTrek();
256 unsigned int no_confs;
288 inline bool inRange(
unsigned int idx)
const {
return idx < no_confs; }
295 inline const double&
get_lProb(
int idx)
const {
return lProbs[idx]; }
302 inline const double&
get_prob(
int idx)
const {
return probs[idx]; }
309 inline const double&
get_mass(
int idx)
const {
return masses[idx]; }
329 inline const Conf&
get_conf(
int idx)
const {
return confs[idx]; }
353 double current_threshold;
363 double* guarded_lProbs;
381 bool extend(
double new_threshold,
bool do_sort =
true);
384 inline double get_lProb(
int idx)
const {
return guarded_lProbs[idx]; }
387 inline double get_prob(
int idx)
const {
return probs[idx]; }
390 inline double get_mass(
int idx)
const {
return masses[idx]; }
396 inline const Conf&
get_conf(
int idx)
const {
return configurations[idx]; }
399 inline unsigned int get_no_confs()
const {
return configurations.size(); }
double get_mass(int idx) const
get the mass of the idx-th subisotopologue, see details in PrecalculatedMarginal::get_mass.
double get_prob(int idx) const
get the probability of the idx-th subisotopologue, see details in PrecalculatedMarginal::get_eProb.
bool extend(double new_threshold, bool do_sort=true)
Extend the set of computed subisotopologues to those above the new threshold.
unsigned int get_no_confs() const
Get the number of precomputed subisotopologues, see details in PrecalculatedMarginal::get_no_confs.
double get_max_mass() const
Get the maximal mass in current layer.
double get_min_mass() const
Get the minimal mass in current layer.
const double * get_lProbs_ptr() const
get the pointer to lProbs array. Accessing index -1 is legal and returns a guardian of -inf....
double getModeLProb() const
Get the log-probability of the mode subisotopologue.
double get_lProb(int idx) const
get the log-probability of the idx-th subisotopologue, see details in PrecalculatedMarginal::get_lPro...
const Conf & get_conf(int idx) const
get the counts of isotopes that define the subisotopologue, see details in PrecalculatedMarginal::get...
The marginal distribution class (a subisotopologue).
int get_isotopeNo() const
Get the number of isotopes of the investigated element.
Conf computeModeConf() const
The the probability of the mode subisotopologue.
double getSmallestLProb() const
The the log-probability of the lightest subisotopologue.
const unsigned int atomCnt
double fastGetModeLProb()
Get the log-probability of the mode subisotopologue. Results undefined if ensureModeConf() wasn't cal...
double getModeLProb()
Get the log-probability of the mode subisotopologue.
double getModeMass()
The the mass of the mode subisotopologue.
double getLightestConfMass() const
Get the mass of the lightest subisotopologue.
const unsigned int isotopeNo
const double *const atom_masses
double variance() const
Calculate the variance of the theoretical distribution describing the subisotopologue.
ISOSPEC_FORCE_INLINE double unnormalized_logProb(Conf conf) const
Calculate the log-probability of a given subisotopologue.
const double loggamma_nominator
double getHeaviestConfMass() const
Get the mass of the heaviest subisotopologue.
double getAtomAverageMass() const
The average mass of a single atom.
double getMonoisotopicConfMass() const
Get the mass of the monoisotopic subisotopologue.
double getTheoreticalAverageMass() const
The theoretical average mass of the molecule.
virtual ~Marginal()
Destructor.
double getLogSizeEstimate(double logEllipsoidRadius) const
Return estimated logarithm of size of the marginal at a given ellipsoid radius.
const double *const atom_lProbs
The marginal distribution class (a subisotopologue).
double getModeLProb() const
Get the log-probability of the mode subisotopologue.
bool probeConfigurationIdx(int idx)
Check if the table of computed subisotopologues does not have to be extended.
Precalculated Marginal class.
unsigned int get_no_confs() const
Get the number of precomputed subisotopologues.
const double * get_lProbs_ptr() const
Get the table of the log-probabilities of subisotopologues.
const double * get_masses_ptr() const
Get the table of the masses of subisotopologues.
const double & get_prob(int idx) const
Get the probability of the idx-th subisotopologue.
virtual ~PrecalculatedMarginal()
Destructor.
const double & get_lProb(int idx) const
Get the log-probability of the idx-th subisotopologue.
bool inRange(unsigned int idx) const
Is there a subisotopologue with a given number?
const Conf & get_conf(int idx) const
Get the counts of isotopes that define the subisotopologue.
const double & get_mass(int idx) const
Get the mass of the idx-th subisotopologue.
double getModeLProb() const
Get the log-probability of the mode subisotopologue.