 |
IsoSpec
1.95
|
20 #include <unordered_map>
24 #include "allocator.h"
25 #include "operators.h"
35 void printMarginal(
const std::tuple<double*,double*,int*,int>& results,
int dim);
72 const double* _masses,
148 std::unordered_map<Conf,int,KeyHasher,ConfEqual> visited;
153 std::vector<double> _conf_lprobs;
154 std::vector<double> _conf_masses;
155 std::vector<int*> _confs;
158 bool add_next_conf();
181 while(current_count <= idx)
195 inline const std::vector<double>& conf_lprobs()
const {
return _conf_lprobs; };
196 inline const std::vector<double>& conf_masses()
const {
return _conf_masses; };
197 inline const std::vector<int*>& confs()
const {
return _confs; };
216 std::vector<Conf> configurations;
218 unsigned int no_confs;
247 inline bool inRange(
unsigned int idx)
const {
return idx < no_confs; };
254 inline const double&
get_lProb(
int idx)
const {
return lProbs[idx]; };
261 inline const double&
get_prob(
int idx)
const {
return probs[idx]; };
268 inline const double&
get_mass(
int idx)
const {
return masses[idx]; };
288 inline const Conf&
get_conf(
int idx)
const {
return confs[idx]; };
PrecalculatedMarginal(Marginal &&m, double lCutOff, bool sort=true, int tabSize=1000, int hashSize=1000)
The move constructor (disowns the Marginal).
Marginal(const double *_masses, const double *_probs, int _isotopeNo, int _atomCnt)
Class constructor.
const double * get_masses_ptr() const
Get the table of the masses of subisotopologues.
Precalculated Marginal class.
The marginal distribution class (a subisotopologue).
const double * get_lProbs_ptr() const
Get the table of the log-probabilities of subisotopologues.
const double & get_mass(int idx) const
Get the mass of the idx-th subisotopologue.
double logProb(Conf conf) const
Calculate the log-probability of a given subisotopologue.
int processUntilCutoff(double cutoff)
Calculate subisotopologues with probability above or equal to the cut-off.
double getHeaviestConfMass() const
Get the mass of the heaviest subisotopologue.
const double smallest_lprob
double getSmallestLProb() const
The the log-probability of the lightest subisotopologue.
Conf initialConfigure(const int atomCnt, const int isotopeNo, const double *probs, const double *lprobs)
Find one of the most probable subisotopologues.
double getModeLProb() const
Get the log-probability of the mode subisotopologue.
const Conf & get_conf(int idx) const
Get the counts of isotopes that define the subisotopologue.
const double & get_lProb(int idx) const
Get the log-probability of the idx-th subisotopologue.
virtual ~PrecalculatedMarginal()
Destructor.
double getLightestConfMass() const
Get the mass of the lightest subisotopologue.
const double *const atom_masses
const unsigned int atomCnt
unsigned int get_no_confs() const
Get the number of precomputed subisotopologues.
double getModeMass() const
The the mass of the mode subisotopologue.
bool probeConfigurationIdx(int idx)
Check if the table of computed subisotopologues does not have to be extended.
int get_isotopeNo() const
Get the number of isotopes of the investigated element.
const double *const atom_lProbs
virtual ~Marginal()
Destructor.
double getModeProb() const
The the probability of the mode subisotopologue.
MarginalTrek(Marginal &&m, int tabSize=1000, int hashSize=1000)
Move constructor: specializes the Marginal class.
bool inRange(unsigned int idx) const
Is there a subisotopologue with a given number?
The marginal distribution class (a subisotopologue).
const double & get_prob(int idx) const
Get the probability of the idx-th subisotopologue.
const unsigned int isotopeNo
const double loggamma_nominator