---
name: "IsoSpec_PrecalculatedMarginal"
section: "3"
platform: "linux"
package: "libisospec++-dev"
version: "2.2.1-4.1+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/IsoSpec_PrecalculatedMarginal"
---

# IsoSpec\_PrecalculatedMarginal(3)

Precalculated Marginal class.

## NAME

IsoSpec::PrecalculatedMarginal - Precalculated **Marginal** class.

## SYNOPSIS

`#include <marginalTrek++.h>`

Inherits **IsoSpec::Marginal**.

### Public Member Functions

**PrecalculatedMarginal** (**Marginal** &&m, double lCutOff, bool sort=true, int tabSize=1000, int hashSize=1000)\
 The move constructor (disowns the **Marginal**).  **PrecalculatedMarginal** (const **PrecalculatedMarginal** &other)=delete\
 **PrecalculatedMarginal** & **operator=** (const **PrecalculatedMarginal** &other)=delete\
 virtual **~PrecalculatedMarginal** ()\
 Destructor.  bool **inRange** (unsigned int idx) const\
 Is there a subisotopologue with a given number?  const double & **get\_lProb** (int idx) const\
 Get the log-probability of the idx-th subisotopologue.  const double & **get\_prob** (int idx) const\
 Get the probability of the idx-th subisotopologue.  const double & **get\_mass** (int idx) const\
 Get the mass of the idx-th subisotopologue.  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 Conf & **get\_conf** (int idx) const\
 Get the counts of isotopes that define the subisotopologue.  unsigned int **get\_no\_confs** () const\
 Get the number of precomputed subisotopologues.  double **getModeLProb** () const\
 Get the log-probability of the mode subisotopologue.

Public Member Functions inherited from **IsoSpec::Marginal** **Marginal** (const double \*\_masses, const double \*\_probs, int \_isotopeNo, int \_atomCnt)\
 Class constructor.  **Marginal** & **operator=** (const **Marginal** &other)=delete\
 **Marginal** (const **Marginal** &other)\
 Copy constructor.  **Marginal** (**Marginal** &&other)\
 Move constructor.  virtual **~Marginal** ()\
 Destructor.  int **get\_isotopeNo** () const\
 Get the number of isotopes of the investigated element.  const double \* **get\_lProbs** () const\
 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 subisotopologue.  double **getModeMass** ()\
 The the mass of the mode subisotopologue.  double **getModeLProb** ()\
 Get the log-probability of the mode subisotopologue.  double **fastGetModeLProb** ()\
 Get the log-probability of the mode subisotopologue. Results undefined if ensureModeConf() wasn't called before.  Conf **computeModeConf** () const\
 The the probability of the mode subisotopologue.  double **getSmallestLProb** () const\
 The the log-probability of the lightest subisotopologue.  double **getAtomAverageMass** () const\
 The average mass of a single atom.  double **getTheoreticalAverageMass** () const\
 The theoretical average mass of the molecule.  double **variance** () const\
 Calculate the variance of the theoretical distribution describing the subisotopologue.  double **getLogSizeEstimate** (double logEllipsoidRadius) const\
 Return estimated logarithm of size of the marginal at a given ellipsoid radius.  void **ensureModeConf** ()\

### Protected Attributes

**pod\_vector**\< Conf \> **configurations**\
 Conf \* **confs**\
 unsigned int **no\_confs**\
 double \* **masses**\
 **pod\_vector**\< double \> **lProbs**\
 double \* **probs**\
 **Allocator**\< int \> **allocator**\

Protected Attributes inherited from **IsoSpec::Marginal** const unsigned int **isotopeNo**\
 const unsigned int **atomCnt**\
 const double \*const **atom\_lProbs**\
 const double \*const **atom\_masses**\
 const double **loggamma\_nominator**\
 Conf **mode\_conf**\
 double **mode\_lprob**\

### Additional Inherited Members

Protected Member Functions inherited from **IsoSpec::Marginal** ISOSPEC\_FORCE\_INLINE double **unnormalized\_logProb** (Conf conf) const\
 Calculate the log-probability of a given subisotopologue.  ISOSPEC\_FORCE\_INLINE double **logProb** (Conf conf) const\

## Detailed Description

Precalculated **Marginal** class.

This class serves to calculate a set of isotopologues that is defined by the minimal probability threshold.

This works faster than if you did not know the threshold. If you have no idea about the threshold, you would need to call us, to change encode the layered version of the marginal.

Definition at line **251** of file **marginalTrek++.h**.

## Constructor & Destructor Documentation

### IsoSpec::PrecalculatedMarginal::PrecalculatedMarginal (Marginal && m, double lCutOff, bool sort = `true`, int tabSize = `1000`, int hashSize = `1000`)

The move constructor (disowns the **Marginal**). This constructor memoizes all subisotopologues with log-probability above the provided threshold lCutOff

**Parameters**

**Marginal An instance of the Marginal class this class is about to disown.** \
 *lCutOff* **The lower limit on the log-probability of the precomputed subisotopologues.** \
 *sort* **Should the subisotopologues be stored with descending probability ?**

**Returns**

**An instance of the PrecalculatedMarginal class.**

**Definition at line 443 of file marginalTrek++.cpp.**

### IsoSpec::PrecalculatedMarginal::~PrecalculatedMarginal ()` [virtual]`

**Destructor.**

**Definition at line 542 of file marginalTrek++.cpp.**

## Member Function Documentation

### const Conf & IsoSpec::PrecalculatedMarginal::get\_conf (int idx) const` [inline]`

**Get the counts of isotopes that define the subisotopologue.**

**Parameters**

*idx* **The number of the considered subisotopologue.**

**Returns**

**The counts of isotopes that define the subisotopologue.**

**Definition at line 329 of file marginalTrek++.h.**

### const double & IsoSpec::PrecalculatedMarginal::get\_lProb (int idx) const` [inline]`

**Get the log-probability of the idx-th subisotopologue.**

**Parameters**

*idx* **The number of the considered subisotopologue.**

**Returns**

**The log-probability of the idx-th subisotopologue.**

**Definition at line 295 of file marginalTrek++.h.**

### const double \* IsoSpec::PrecalculatedMarginal::get\_lProbs\_ptr () const` [inline]`

**Get the table of the log-probabilities of subisotopologues.**

**Returns**

**Pointer to the first element in the table storing log-probabilities of subisotopologues.**

**Definition at line 315 of file marginalTrek++.h.**

### const double & IsoSpec::PrecalculatedMarginal::get\_mass (int idx) const` [inline]`

**Get the mass of the idx-th subisotopologue.**

**Parameters**

*idx* **The number of the considered subisotopologue.**

**Returns**

**The mass of the idx-th subisotopologue.**

**Definition at line 309 of file marginalTrek++.h.**

### const double \* IsoSpec::PrecalculatedMarginal::get\_masses\_ptr () const` [inline]`

**Get the table of the masses of subisotopologues.**

**Returns**

**Pointer to the first element in the table storing masses of subisotopologues.**

**Definition at line 321 of file marginalTrek++.h.**

### unsigned int IsoSpec::PrecalculatedMarginal::get\_no\_confs () const` [inline]`

**Get the number of precomputed subisotopologues.**

**Returns**

**The number of precomputed subisotopologues.**

**Definition at line 335 of file marginalTrek++.h.**

### const double & IsoSpec::PrecalculatedMarginal::get\_prob (int idx) const` [inline]`

**Get the probability of the idx-th subisotopologue.**

**Parameters**

*idx* **The number of the considered subisotopologue.**

**Returns**

**The probability of the idx-th subisotopologue.**

**Definition at line 302 of file marginalTrek++.h.**

### double IsoSpec::PrecalculatedMarginal::getModeLProb () const` [inline]`

**Get the log-probability of the mode subisotopologue.**

**Returns**

**The log-probability of a/the most probable subisotopologue.**

**Definition at line 341 of file marginalTrek++.h.**

### bool IsoSpec::PrecalculatedMarginal::inRange (unsigned int idx) const` [inline]`

**Is there a subisotopologue with a given number?**

**Returns**

**Returns true if idx does not exceed the number of pre-computed configurations.**

**Definition at line 288 of file marginalTrek++.h.**

## Member Data Documentation

### Allocator\<int\> IsoSpec::PrecalculatedMarginal::allocator` [protected]`

**Definition at line 260 of file marginalTrek++.h.**

### pod\_vector\<Conf\> IsoSpec::PrecalculatedMarginal::configurations` [protected]`

**Definition at line 254 of file marginalTrek++.h.**

### Conf\* IsoSpec::PrecalculatedMarginal::confs` [protected]`

**Definition at line 255 of file marginalTrek++.h.**

### pod\_vector\<double\> IsoSpec::PrecalculatedMarginal::lProbs` [protected]`

**Definition at line 258 of file marginalTrek++.h.**

### double\* IsoSpec::PrecalculatedMarginal::masses` [protected]`

**Definition at line 257 of file marginalTrek++.h.**

### unsigned int IsoSpec::PrecalculatedMarginal::no\_confs` [protected]`

**Definition at line 256 of file marginalTrek++.h.**

### double\* IsoSpec::PrecalculatedMarginal::probs` [protected]`

**Definition at line 259 of file marginalTrek++.h.**

## Author

**Generated automatically by Doxygen for IsoSpec from the source code.**
