IsoSpec::Marginal(3)
๐ NAME ๐
IsoSpec::Marginal โ the marginal distribution class (a subisotopologue). ๐ฆ no cap, that's the whole vibe of this page, bestie.
This one lives in the Library Functions Manual, section 3, and it's all about the IsoSpec C++ library. Grab a snack, we're going deep ๐
โจ SYNOPSIS โจ
#include <marginalTrek++.h>
Inherited by IsoSpec::LayeredMarginal, IsoSpec::LoggingMarginal< T >, IsoSpec::MarginalTrek, IsoSpec::PrecalculatedMarginal, and IsoSpec::SingleAtomMarginal< add_guards >.
๐ธ Public Member Functions ๐ธ
Marginal (const double *_masses, const double *_probs, int _isotopeNo, int _atomCnt)โ the class constructor, the origin story, the main character intro ๐ฌMarginal & operator= (const Marginal &other)=deleteโ the copy-assign operator, and nope, it's deleted. Not available. Gone. Periodt.Marginal (const Marginal &other)โ copy constructor ๐ซถMarginal (Marginal &&other)โ move constructor ๐virtual ~Marginal ()โ destructor, the farewell arc ๐ญint get_isotopeNo () constโ get the number of isotopes of the investigated elementconst double * get_lProbs () constโ hands you back the log-probs pointer, no further comment given ๐double getLightestConfMass () constโ get the mass of the lightest subisotopologue ๐ชถdouble getHeaviestConfMass () constโ get the mass of the heaviest subisotopologue ๐๏ธdouble getMonoisotopicConfMass () constโ get the mass of the monoisotopic subisotopologuesize_t getMonoisotopicAtomIndex () constโ get the index of the monoisotopic (most probable) atom ๐double getModeMass ()โ the the mass of the mode subisotopologuedouble getModeLProb ()โ get the log-probability of the mode subisotopologuedouble fastGetModeLProb ()โ get the log-probability of the mode subisotopologue, but โ ๏ธ results are undefined ifensureModeConf()wasn't called beforeConf computeModeConf () constโ the the probability of the mode subisotopologuedouble getSmallestLProb () constโ the the log-probability of the lightest subisotopologuedouble getAtomAverageMass () constโ the average mass of a single atomdouble getTheoreticalAverageMass () constโ the theoretical average mass of the moleculedouble variance () constโ calculate the variance of the theoretical distribution describing the subisotopologuedouble getLogSizeEstimate (double logEllipsoidRadius) constโ return estimated logarithm of size of the marginal at a given ellipsoid radiusvoid ensureModeConf ()โ the setup step your girlfastGetModeLProb()is literally begging you to call first
๐ Protected Member Functions ๐
ISOSPEC_FORCE_INLINE double unnormalized_logProb (Conf conf) constโ calculate the log-probability of a given subisotopologueISOSPEC_FORCE_INLINE double logProb (Conf conf) constโ the inline one, no blurb attached, it's mysterious like that ๐
๐ง Protected Attributes ๐ง
const unsigned int isotopeNoโ how many isotopes the element hasconst unsigned int atomCntโ how many atoms of that element you've gotconst double *const atom_lProbsโ the log-prob tableconst double *const atom_massesโ the mass tableconst double loggamma_nominatorโ the constant one, the multinomial math girlieConf mode_confโ the mode subisotopologue herselfdouble mode_lprobโ her log-probability
๐ฅ Detailed Description ๐ฅ
The marginal distribution class (a subisotopologue). That's the whole name, we love a self-titled icon โจ
So like โ this class mostly provides some basic common API for subclasses, but itself is not abstract. She's concrete. She's real. This class represents the probability distribution generated by one element only โ a subisotopologue. For instance, it might be the distribution of C200, that might be part of, say, C200H402. It corresponds to the multinomial distribution, where each configuration can also be attributed a precise mass. The constructor method perform initial hill-climbing to find the most probable sub-isotopologue (the mode). ๐๏ธ climb that hill, bestie.
Definition at line 43 of file marginalTrek++.h.
๐ ๏ธ Constructor & Destructor Documentation ๐ ๏ธ
IsoSpec::Marginal::Marginal (const double * _masses, const double * _probs, int _isotopeNo, int _atomCnt)
Class constructor. The birth scene ๐ซ
Parameters
_massesโ a table of masses of the stable isotopes of the investigated element, e.g. forC10it is2:C12andC13._probsโ a table of natural frequencies of the stable isotopes of the investigated element, see IUPAC at https://iupac.org/isotopesmatter/_isotopeNoโ number of isotopes of a given element._atomCntโ the number of atoms of the given element, e.g.10forC10.
Returns
An instance of the Marginal class. ๐ซถ
Definition at line 165 of file marginalTrek++.cpp.
IsoSpec::Marginal::Marginal (const Marginal & other)
Copy constructor. Making a twin, a little clone, iconic behaviour ๐
Definition at line 181 of file marginalTrek++.cpp.
IsoSpec::Marginal::Marginal (Marginal && other)
Move constructor. She's moving out, taking the data with her, no forwarding address ๐
Definition at line 203 of file marginalTrek++.cpp.
IsoSpec::Marginal::~Marginal () [virtual]
Destructor. Saying goodbye, wiping the tears ๐ญ
Definition at line 224 of file marginalTrek++.cpp.
๐ Member Function Documentation ๐
Conf IsoSpec::Marginal::computeModeConf () const
The the probability of the mode subisotopologue. (Yes, "the the", that's the original's whole thing, we respect the source ๐)
Returns
The probability of a/the most probable subisotopologue. Computes and returns the mode configuration, a isotopeNo-large array that the caller is responsible for delete[]-ing.
โ ๏ธ Bestie, listen: YOU are the one who has to delete[] that array. It's your responsibility. Do not forget. I'm watching. ๐
Definition at line 235 of file marginalTrek++.cpp.
void IsoSpec::Marginal::ensureModeConf () [inline]
Just the definition, no description, she's lowkey mysterious.
Definition at line 176 of file marginalTrek++.h.
double IsoSpec::Marginal::fastGetModeLProb () [inline]
Get the log-probability of the mode subisotopologue. Results undefined if ensureModeConf() wasn't called before. ๐จ
Definition at line 132 of file marginalTrek++.h.
int IsoSpec::Marginal::get_isotopeNo () const [inline]
Get the number of isotopes of the investigated element.
Returns
The integer number of isotopes of the investigated element. ๐ข
Definition at line 89 of file marginalTrek++.h.
const double * IsoSpec::Marginal::get_lProbs () const [inline]
No description given. It just returns the pointer. Silent, powerful, main character energy โจ
Definition at line 91 of file marginalTrek++.h.
double IsoSpec::Marginal::getAtomAverageMass () const
The average mass of a single atom.
Returns
The average mass of a single atom. (Yes, the returns blurb and the summary are the same sentence. She said what she said. ๐ )
Definition at line 287 of file marginalTrek++.cpp.
double IsoSpec::Marginal::getHeaviestConfMass () const
Get the mass of the heaviest subisotopologue. This is trivially obtained by considering all atomNo atoms to be the heaviest isotope possible.
Returns
The mass of the heaviest subisotopologue. ๐๏ธ
Definition at line 259 of file marginalTrek++.cpp.
double IsoSpec::Marginal::getLightestConfMass () const
Get the mass of the lightest subisotopologue. This is trivially obtained by considering all atomNo atoms to be the lightest isotope possible.
Returns
The mass of the lightiest subisotopologue. (Their typo, not mine, I'm just the messenger ๐ซก)
Definition at line 250 of file marginalTrek++.cpp.
double IsoSpec::Marginal::getLogSizeEstimate (double logEllipsoidRadius) const
Return estimated logarithm of size of the marginal at a given ellipsoid radius.
Definition at line 307 of file marginalTrek++.cpp.
double IsoSpec::Marginal::getModeLProb () [inline]
Get the log-probability of the mode subisotopologue.
Returns
The log-probability of a/the most probable subisotopologue. ๐
Definition at line 129 of file marginalTrek++.h.
double IsoSpec::Marginal::getModeMass () [inline]
The the mass of the mode subisotopologue.
Returns
The mass of one of the most probable subisotopologues. Note: one of โ if there's a tie she's not picking favourites ๐
Definition at line 123 of file marginalTrek++.h.
size_t IsoSpec::Marginal::getMonoisotopicAtomIndex () const
Get the index of the monoisotopic (most probable) atom.
Returns
The index of the most probable isotope of the element. ๐
Definition at line 268 of file marginalTrek++.cpp.
double IsoSpec::Marginal::getMonoisotopicConfMass () const
Get the mass of the monoisotopic subisotopologue. The monoisotopic subisotopologue is defined as the molecule consiting only of the most likely isotope. This is frequently the lightest subisotopologue, making this frequently (but not always) equal to getLightestConfMass().
โ ๏ธ "frequently (but not always)" โ do NOT assume they're the same thing. That's a trap and it's giving chaos ๐ช๏ธ
Definition at line 281 of file marginalTrek++.cpp.
double IsoSpec::Marginal::getSmallestLProb () const [inline]
The the log-probability of the lightest subisotopologue.
Returns
The logarithm of the smallest non-zero probability of a subisotopologue. ๐ฌ
Definition at line 147 of file marginalTrek++.h.
double IsoSpec::Marginal::getTheoreticalAverageMass () const [inline]
The theoretical average mass of the molecule.
Returns
The theoretical average mass of the molecule. ๐งฎ
Definition at line 159 of file marginalTrek++.h.
ISOSPEC_FORCE_INLINE double IsoSpec::Marginal::logProb (Conf conf) const [inline], [protected]
No description. Protected. Off-limits unless you're family ๐ซ
Definition at line 168 of file marginalTrek++.h.
ISOSPEC_FORCE_INLINE double IsoSpec::Marginal::unnormalized_logProb (Conf conf) const [inline], [protected]
Calculate the log-probability of a given subisotopologue.
Parameters
confโ a subisotopologue (a table of integers describing subsequent isotope-counts).
Returns
The log-probability of the input subisotopologue. โจ
Definition at line 167 of file marginalTrek++.h.
double IsoSpec::Marginal::variance () const
Calculate the variance of the theoretical distribution describing the subisotopologue.
Definition at line 295 of file marginalTrek++.cpp.
๐ Member Data Documentation ๐
const double* const IsoSpec::Marginal::atom_lProbs [protected]
Table of log-probabilities of all the isotopeNo isotopes.
Definition at line 50 of file marginalTrek++.h.
const double* const IsoSpec::Marginal::atom_masses [protected]
Table of atomic masses of all the isotopeNo isotopes.
Definition at line 51 of file marginalTrek++.h.
const unsigned int IsoSpec::Marginal::atomCnt [protected]
The number of atoms of the given element.
Definition at line 49 of file marginalTrek++.h.
const unsigned int IsoSpec::Marginal::isotopeNo [protected]
The number of isotopes of the given element.
Definition at line 48 of file marginalTrek++.h.
const double IsoSpec::Marginal::loggamma_nominator [protected]
The constant nominator that appears in the expressions for the multinomial probabilities.
Definition at line 52 of file marginalTrek++.h.
Conf IsoSpec::Marginal::mode_conf [protected]
A subisotopologue with most probability. If not unique, one of the representatives of that class of subisotopologues. ๐
Definition at line 53 of file marginalTrek++.h.
double IsoSpec::Marginal::mode_lprob [protected]
The log-probability of the mode subisotopologue.
Definition at line 54 of file marginalTrek++.h.
๐ฆ Author ๐ฆ
Generated automatically by Doxygen for IsoSpec from the source code. So like, a robot wrote this, not me, I just did the glow-up ๐ โจ
okay that's the whole page bestie, you ate that, go compile something iconic ๐
This was IsoSpec::Marginal(3) out of the IsoSpec source, straight from the Doxygen-generated Library Functions Manual โ no date stamped on this footer, so don't come for me about timestamps, it's giving undated and unbothered ๐ซถ mwah ๐
๐ฆ where this page comes from
- ubuntu resolute: libisospec++-dev 2.3.2-1build1 ยท BSD-2-Clause
- ubuntu stonking: libisospec++-dev 2.3.2-2 ยท BSD-2-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms