---
name: "IsoSpec_FixedEnvelope"
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_FixedEnvelope"
---

# IsoSpec\_FixedEnvelope(3)

## NAME

IsoSpec::FixedEnvelope

## SYNOPSIS

### Public Member Functions

**FixedEnvelope** (const **FixedEnvelope** &other)\
 **FixedEnvelope** (**FixedEnvelope** &&other)\
 **FixedEnvelope** (double \*masses, double \*probs, size\_t confs\_no, bool masses\_sorted=false, bool probs\_sorted=false, double \_total\_prob=NAN)\
 **FixedEnvelope** **operator+** (const **FixedEnvelope** &other) const\
 **FixedEnvelope** **operator\*** (const **FixedEnvelope** &other) const\
 size\_t **confs\_no** () const\
 int **getAllDim** () const\
 const double \* **masses** () const\
 const double \* **probs** () const\
 const int \* **confs** () const\
 double \* **release\_masses** ()\
 double \* **release\_probs** ()\
 int \* **release\_confs** ()\
 void **release\_everything** ()\
 double **mass** (size\_t i) const\
 double **prob** (size\_t i) const\
 const int \* **conf** (size\_t i) const\
 void **sort\_by\_mass** ()\
 void **sort\_by\_prob** ()\
 double **get\_total\_prob** ()\
 void **scale** (double factor)\
 void **normalize** ()\
 void **shift\_mass** (double shift)\
 void **resample** (size\_t ionic\_current, double beta\_bias=1.0)\
 double **empiric\_average\_mass** ()\
 double **empiric\_variance** ()\
 double **empiric\_stddev** ()\
 double **WassersteinDistance** (**FixedEnvelope** &other)\
 double **OrientedWassersteinDistance** (**FixedEnvelope** &other)\
 double **AbyssalWassersteinDistance** (**FixedEnvelope** &other, double abyss\_depth, double other\_scale=1.0)\
 std::tuple\< double, double, double \> **WassersteinMatch** (**FixedEnvelope** &other, double flow\_distance, double other\_scale=1.0)\
 **FixedEnvelope** **bin** (double bin\_width=1.0, double middle=0.0)\
 template\<bool tgetConfs\> void **threshold\_init** (**Iso** &&iso, double threshold, bool absolute)\
 template\<bool tgetConfs, typename GenType  = IsoLayeredGenerator\> void **addConfILG** (const GenType &generator)\
 template\<bool tgetConfs\> void **total\_prob\_init** (**Iso** &&iso, double target\_prob, bool trim)\
 template\<bool tgetConfs\> void **stochastic\_init** (**Iso** &&iso, size\_t \_no\_molecules, double \_precision, double \_beta\_bias)\

### Static Public Member Functions

static **FixedEnvelope** **LinearCombination** (const std::vector\< const **FixedEnvelope** \* \> &spectra, const std::vector\< double \> &intensities)\
 static **FixedEnvelope** **LinearCombination** (const **FixedEnvelope** \*const \*spectra, const double \*intensities, size\_t size)\
 static **FixedEnvelope** **FromThreshold** (**Iso** &&iso, double threshold, bool absolute, bool tgetConfs=false)\
 static **FixedEnvelope** **FromThreshold** (const **Iso** &iso, double \_threshold, bool \_absolute, bool tgetConfs=false)\
 static **FixedEnvelope** **FromTotalProb** (**Iso** &&iso, double target\_total\_prob, bool optimize, bool tgetConfs=false)\
 static **FixedEnvelope** **FromTotalProb** (const **Iso** &iso, double \_target\_total\_prob, bool \_optimize, bool tgetConfs=false)\
 static **FixedEnvelope** **FromStochastic** (**Iso** &&iso, size\_t \_no\_molecules, double \_precision=0.9999, double \_beta\_bias=5.0, bool tgetConfs=false)\
 static **FixedEnvelope** **FromStochastic** (const **Iso** &iso, size\_t \_no\_molecules, double \_precision=0.9999, double \_beta\_bias=5.0, bool tgetConfs=false)\
 static **FixedEnvelope** **Binned** (**Iso** &&iso, double target\_total\_prob, double bin\_width, double bin\_middle=0.0)\
 static **FixedEnvelope** **Binned** (const **Iso** &iso, double target\_total\_prob, double bin\_width, double bin\_middle=0.0)\

### Protected Member Functions

template\<typename T , bool tgetConfs\> ISOSPEC\_FORCE\_INLINE void **store\_conf** (const T &generator)\
 ISOSPEC\_FORCE\_INLINE void **store\_conf** (double \_mass, double \_prob)\
 template\<bool tgetConfs\> ISOSPEC\_FORCE\_INLINE void **swap** (size\_t idx1, size\_t idx2, ISOSPEC\_MAYBE\_UNUSED int \*conf\_swapspace)\
 template\<bool tgetConfs\> void **reallocate\_memory** (size\_t new\_size)\
 void **slow\_reallocate\_memory** (size\_t new\_size)\

### Protected Attributes

double \* **\_masses**\
 double \* **\_probs**\
 int \* **\_confs**\
 size\_t **\_confs\_no**\
 int **allDim**\
 bool **sorted\_by\_mass**\
 bool **sorted\_by\_prob**\
 double **total\_prob**\
 size\_t **current\_size**\
 double \* **tmasses**\
 double \* **tprobs**\
 int \* **tconfs**\
 int **allDimSizeofInt**\

### Friends

double **AbyssalWassersteinDistanceGrad** (**FixedEnvelope** \*const \*envelopes, const double \*scales, double \*ret\_gradient, size\_t N, double abyss\_depth\_exp, double abyss\_depth\_the)\

## Detailed Description

Definition at line **40** of file **fixedEnvelopes.h**.

## Constructor & Destructor Documentation

### ISOSPEC\_FORCE\_INLINE IsoSpec::FixedEnvelope::FixedEnvelope ()` [inline]`

Definition at line **57** of file **fixedEnvelopes.h**.

### IsoSpec::FixedEnvelope::FixedEnvelope (const FixedEnvelope & other)

Definition at line **24** of file **fixedEnvelopes.cpp**.

### IsoSpec::FixedEnvelope::FixedEnvelope (FixedEnvelope && other)

Definition at line **35** of file **fixedEnvelopes.cpp**.

### IsoSpec::FixedEnvelope::FixedEnvelope (double \* masses, double \* probs, size\_t confs\_no, bool masses\_sorted = `false`, bool probs\_sorted = `false`, double \_total\_prob = `NAN`)

Definition at line **52** of file **fixedEnvelopes.cpp**.

### virtual IsoSpec::FixedEnvelope::~FixedEnvelope ()` [inline]`, ` [virtual]`

Definition at line **75** of file **fixedEnvelopes.h**.

## Member Function Documentation

### double IsoSpec::FixedEnvelope::AbyssalWassersteinDistance (FixedEnvelope & other, double abyss\_depth, double other\_scale = `1.0`)

Definition at line **414** of file **fixedEnvelopes.cpp**.

### template\<bool tgetConfs, typename GenType = IsoLayeredGenerator\> void IsoSpec::FixedEnvelope::addConfILG (const GenType & generator)` [inline]`

Definition at line **172** of file **fixedEnvelopes.h**.

### FixedEnvelope IsoSpec::FixedEnvelope::bin (double bin\_width = `1.0`, double middle = `0.0`)

Definition at line **799** of file **fixedEnvelopes.cpp**.

### static FixedEnvelope IsoSpec::FixedEnvelope::Binned (const Iso & iso, double target\_total\_prob, double bin\_width, double bin\_middle = `0.0`)` [inline]`, ` [static]`

Definition at line **236** of file **fixedEnvelopes.h**.

### FixedEnvelope IsoSpec::FixedEnvelope::Binned (Iso && iso, double target\_total\_prob, double bin\_width, double bin\_middle = `0.0`)` [static]`

Definition at line **1088** of file **fixedEnvelopes.cpp**.

### const int \* IsoSpec::FixedEnvelope::conf (size\_t i) const` [inline]`

Definition at line **100** of file **fixedEnvelopes.h**.

### const int \* IsoSpec::FixedEnvelope::confs () const` [inline]`

Definition at line **90** of file **fixedEnvelopes.h**.

### size\_t IsoSpec::FixedEnvelope::confs\_no () const` [inline]`

Definition at line **85** of file **fixedEnvelopes.h**.

### double IsoSpec::FixedEnvelope::empiric\_average\_mass ()

Definition at line **1065** of file **fixedEnvelopes.cpp**.

### double IsoSpec::FixedEnvelope::empiric\_stddev ()` [inline]`

Definition at line **113** of file **fixedEnvelopes.h**.

### double IsoSpec::FixedEnvelope::empiric\_variance ()

Definition at line **1075** of file **fixedEnvelopes.cpp**.

### static FixedEnvelope IsoSpec::FixedEnvelope::FromStochastic (const Iso & iso, size\_t \_no\_molecules, double \_precision = `0.9999`, double \_beta\_bias = `5.0`, bool tgetConfs = `false`)` [inline]`, ` [static]`

Definition at line **230** of file **fixedEnvelopes.h**.

### static FixedEnvelope IsoSpec::FixedEnvelope::FromStochastic (Iso && iso, size\_t \_no\_molecules, double \_precision = `0.9999`, double \_beta\_bias = `5.0`, bool tgetConfs = `false`)` [inline]`, ` [static]`

Definition at line **218** of file **fixedEnvelopes.h**.

### static FixedEnvelope IsoSpec::FixedEnvelope::FromThreshold (const Iso & iso, double \_threshold, bool \_absolute, bool tgetConfs = `false`)` [inline]`, ` [static]`

Definition at line **194** of file **fixedEnvelopes.h**.

### static FixedEnvelope IsoSpec::FixedEnvelope::FromThreshold (Iso && iso, double threshold, bool absolute, bool tgetConfs = `false`)` [inline]`, ` [static]`

Definition at line **183** of file **fixedEnvelopes.h**.

### static FixedEnvelope IsoSpec::FixedEnvelope::FromTotalProb (const Iso & iso, double \_target\_total\_prob, bool \_optimize, bool tgetConfs = `false`)` [inline]`, ` [static]`

Definition at line **211** of file **fixedEnvelopes.h**.

### static FixedEnvelope IsoSpec::FixedEnvelope::FromTotalProb (Iso && iso, double target\_total\_prob, bool optimize, bool tgetConfs = `false`)` [inline]`, ` [static]`

Definition at line **199** of file **fixedEnvelopes.h**.

### double IsoSpec::FixedEnvelope::get\_total\_prob ()

Definition at line **192** of file **fixedEnvelopes.cpp**.

### int IsoSpec::FixedEnvelope::getAllDim () const` [inline]`

Definition at line **86** of file **fixedEnvelopes.h**.

### FixedEnvelope IsoSpec::FixedEnvelope::LinearCombination (const FixedEnvelope \*const \* spectra, const double \* intensities, size\_t size)` [static]`

Definition at line **271** of file **fixedEnvelopes.cpp**.

### FixedEnvelope IsoSpec::FixedEnvelope::LinearCombination (const std::vector\< const FixedEnvelope \* \> & spectra, const std::vector\< double \> & intensities)` [static]`

Definition at line **266** of file **fixedEnvelopes.cpp**.

### double IsoSpec::FixedEnvelope::mass (size\_t i) const` [inline]`

Definition at line **98** of file **fixedEnvelopes.h**.

### const double \* IsoSpec::FixedEnvelope::masses () const` [inline]`

Definition at line **88** of file **fixedEnvelopes.h**.

### void IsoSpec::FixedEnvelope::normalize ()

Definition at line **210** of file **fixedEnvelopes.cpp**.

### FixedEnvelope IsoSpec::FixedEnvelope::operator\* (const FixedEnvelope & other) const

Definition at line **84** of file **fixedEnvelopes.cpp**.

### FixedEnvelope IsoSpec::FixedEnvelope::operator+ (const FixedEnvelope & other) const

Definition at line **63** of file **fixedEnvelopes.cpp**.

### double IsoSpec::FixedEnvelope::OrientedWassersteinDistance (FixedEnvelope & other)

Definition at line **358** of file **fixedEnvelopes.cpp**.

### double IsoSpec::FixedEnvelope::prob (size\_t i) const` [inline]`

Definition at line **99** of file **fixedEnvelopes.h**.

### const double \* IsoSpec::FixedEnvelope::probs () const` [inline]`

Definition at line **89** of file **fixedEnvelopes.h**.

### template\<bool tgetConfs\> void IsoSpec::FixedEnvelope::reallocate\_memory (size\_t new\_size)` [protected]`

Definition at line **851** of file **fixedEnvelopes.cpp**.

### int \* IsoSpec::FixedEnvelope::release\_confs ()` [inline]`

Definition at line **94** of file **fixedEnvelopes.h**.

### void IsoSpec::FixedEnvelope::release\_everything ()` [inline]`

Definition at line **95** of file **fixedEnvelopes.h**.

### double \* IsoSpec::FixedEnvelope::release\_masses ()` [inline]`

Definition at line **92** of file **fixedEnvelopes.h**.

### double \* IsoSpec::FixedEnvelope::release\_probs ()` [inline]`

Definition at line **93** of file **fixedEnvelopes.h**.

### void IsoSpec::FixedEnvelope::resample (size\_t ionic\_current, double beta\_bias = `1.0`)

Definition at line **226** of file **fixedEnvelopes.cpp**.

### void IsoSpec::FixedEnvelope::scale (double factor)

Definition at line **203** of file **fixedEnvelopes.cpp**.

### void IsoSpec::FixedEnvelope::shift\_mass (double shift)

Definition at line **220** of file **fixedEnvelopes.cpp**.

### void IsoSpec::FixedEnvelope::slow\_reallocate\_memory (size\_t new\_size)` [protected]`

Definition at line **874** of file **fixedEnvelopes.cpp**.

### void IsoSpec::FixedEnvelope::sort\_by\_mass ()

Definition at line **111** of file **fixedEnvelopes.cpp**.

### void IsoSpec::FixedEnvelope::sort\_by\_prob ()

Definition at line **123** of file **fixedEnvelopes.cpp**.

### template\<bool tgetConfs\> template void IsoSpec::FixedEnvelope::stochastic\_init\< false \> (Iso && iso, size\_t \_no\_molecules, double \_precision, double \_beta\_bias)

Definition at line **1049** of file **fixedEnvelopes.cpp**.

### template\<typename T , bool tgetConfs\> ISOSPEC\_FORCE\_INLINE void IsoSpec::FixedEnvelope::store\_conf (const T & generator)` [inline]`, ` [protected]`

Definition at line **132** of file **fixedEnvelopes.h**.

### ISOSPEC\_FORCE\_INLINE void IsoSpec::FixedEnvelope::store\_conf (double \_mass, double \_prob)` [inline]`, ` [protected]`

Definition at line **139** of file **fixedEnvelopes.h**.

### template\<bool tgetConfs\> ISOSPEC\_FORCE\_INLINE void IsoSpec::FixedEnvelope::swap (size\_t idx1, size\_t idx2, ISOSPEC\_MAYBE\_UNUSED int \* conf\_swapspace)` [inline]`, ` [protected]`

Definition at line **152** of file **fixedEnvelopes.h**.

### template\<bool tgetConfs\> template void IsoSpec::FixedEnvelope::threshold\_init\< false \> (Iso && iso, double threshold, bool absolute)

Definition at line **897** of file **fixedEnvelopes.cpp**.

### template\<bool tgetConfs\> template void IsoSpec::FixedEnvelope::total\_prob\_init\< false \> (Iso && iso, double target\_prob, bool trim)

Definition at line **927** of file **fixedEnvelopes.cpp**.

### double IsoSpec::FixedEnvelope::WassersteinDistance (FixedEnvelope & other)

Definition at line **299** of file **fixedEnvelopes.cpp**.

### std::tuple\< double, double, double \> IsoSpec::FixedEnvelope::WassersteinMatch (FixedEnvelope & other, double flow\_distance, double other\_scale = `1.0`)

Definition at line **726** of file **fixedEnvelopes.cpp**.

## Member Data Documentation

### int\* IsoSpec::FixedEnvelope::\_confs` [protected]`

Definition at line **44** of file **fixedEnvelopes.h**.

### size\_t IsoSpec::FixedEnvelope::\_confs\_no` [protected]`

Definition at line **45** of file **fixedEnvelopes.h**.

### double\* IsoSpec::FixedEnvelope::\_masses` [protected]`

Definition at line **42** of file **fixedEnvelopes.h**.

### double\* IsoSpec::FixedEnvelope::\_probs` [protected]`

Definition at line **43** of file **fixedEnvelopes.h**.

### int IsoSpec::FixedEnvelope::allDim` [protected]`

Definition at line **46** of file **fixedEnvelopes.h**.

### int IsoSpec::FixedEnvelope::allDimSizeofInt` [protected]`

Definition at line **54** of file **fixedEnvelopes.h**.

### size\_t IsoSpec::FixedEnvelope::current\_size` [protected]`

Definition at line **50** of file **fixedEnvelopes.h**.

### bool IsoSpec::FixedEnvelope::sorted\_by\_mass` [protected]`

Definition at line **47** of file **fixedEnvelopes.h**.

### bool IsoSpec::FixedEnvelope::sorted\_by\_prob` [protected]`

Definition at line **48** of file **fixedEnvelopes.h**.

### int\* IsoSpec::FixedEnvelope::tconfs` [protected]`

Definition at line **53** of file **fixedEnvelopes.h**.

### double\* IsoSpec::FixedEnvelope::tmasses` [protected]`

Definition at line **51** of file **fixedEnvelopes.h**.

### double IsoSpec::FixedEnvelope::total\_prob` [protected]`

Definition at line **49** of file **fixedEnvelopes.h**.

### double\* IsoSpec::FixedEnvelope::tprobs` [protected]`

Definition at line **52** of file **fixedEnvelopes.h**.

## Author

Generated automatically by Doxygen for IsoSpec from the source code.
