---
name: "IsoSpec_LayeredMarginal"
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_LayeredMarginal"
---

# IsoSpec\_LayeredMarginal(3)

LayeredMarginal class.

## NAME

IsoSpec::LayeredMarginal - **LayeredMarginal** class.

## SYNOPSIS

`#include <marginalTrek++.h>`

Inherits **IsoSpec::Marginal**.

### Public Member Functions

**LayeredMarginal** (**Marginal** &&m, int tabSize=1000, int hashSize=1000)\
 Move constructor: specializes the **Marginal** class.  **LayeredMarginal** (const **LayeredMarginal** &other)=delete\
 **LayeredMarginal** & **operator=** (const **LayeredMarginal** &other)=delete\
 bool **extend** (double new\_threshold, bool do\_sort=true)\
 Extend the set of computed subisotopologues to those above the new threshold.  double **get\_lProb** (int idx) const\
 get the log-probability of the idx-th subisotopologue, see details in **PrecalculatedMarginal::get\_lProb**.  double **get\_prob** (int idx) const\
 get the probability of the idx-th subisotopologue, see details in **PrecalculatedMarginal::get\_eProb**.  double **get\_mass** (int idx) const\
 get the mass of the idx-th subisotopologue, see details in **PrecalculatedMarginal::get\_mass**.  const double \* **get\_lProbs\_ptr** () const\
 get the pointer to lProbs array. Accessing index -1 is legal and returns a guardian of -inf. Warning: The pointer gets invalidated on calls to **extend()**  const Conf & **get\_conf** (int idx) const\
 get the counts of isotopes that define the subisotopologue, see details in **PrecalculatedMarginal::get\_conf**.  unsigned int **get\_no\_confs** () const\
 Get the number of precomputed subisotopologues, see details in **PrecalculatedMarginal::get\_no\_confs**.  double **get\_min\_mass** () const\
 Get the minimal mass in current layer.  double **get\_max\_mass** () const\
 Get the maximal mass in current layer.  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** ()\

### 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\

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**\

## Detailed Description

**LayeredMarginal** class.

An extendable version of the **PrecalculatedMarginal**, where you can extend the threshold at will.

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

## Constructor & Destructor Documentation

### IsoSpec::LayeredMarginal::LayeredMarginal (Marginal && m, int tabSize = `1000`, int hashSize = `1000`)

Move constructor: specializes the **Marginal** class.

**Parameters**

*tabSize* The size of the table used to store configurations in the allocator. \
 *hashSize* The size of the hash table used to store visited subisotopologues.

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

## Member Function Documentation

### bool IsoSpec::LayeredMarginal::extend (double new\_threshold, bool do\_sort = `true`)

Extend the set of computed subisotopologues to those above the new threshold.

**Parameters**

*new\_threshold* The new log-probability limiting the subisotopologues from below.

**Returns**

Returns false, if there are no fringe-subisotopologues (subisotopologues that were neighbours of the previously calculated subisotopologues, with log-probability below the previous threshold).

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

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

get the counts of isotopes that define the subisotopologue, see details in **PrecalculatedMarginal::get\_conf**.

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

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

get the log-probability of the idx-th subisotopologue, see details in **PrecalculatedMarginal::get\_lProb**.

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

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

get the pointer to lProbs array. Accessing index -1 is legal and returns a guardian of -inf. Warning: The pointer gets invalidated on calls to **extend()**

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

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

get the mass of the idx-th subisotopologue, see details in **PrecalculatedMarginal::get\_mass**.

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

### double IsoSpec::LayeredMarginal::get\_max\_mass () const

Get the maximal mass in current layer.

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

### double IsoSpec::LayeredMarginal::get\_min\_mass () const

Get the minimal mass in current layer.

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

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

Get the number of precomputed subisotopologues, see details in **PrecalculatedMarginal::get\_no\_confs**.

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

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

get the probability of the idx-th subisotopologue, see details in **PrecalculatedMarginal::get\_eProb**.

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

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

Get the log-probability of the mode subisotopologue.

**Returns**

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

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

## Author

Generated automatically by Doxygen for IsoSpec from the source code.
