IsoSpecPy 2.3.0.dev11__cp313-cp313-win_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,573 @@
1
+ /*
2
+ * Copyright (C) 2015-2020 Mateusz Łącki and Michał Startek.
3
+ *
4
+ * This file is part of IsoSpec.
5
+ *
6
+ * IsoSpec is free software: you can redistribute it and/or modify
7
+ * it under the terms of the Simplified ("2-clause") BSD licence.
8
+ *
9
+ * IsoSpec is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ *
13
+ * You should have received a copy of the Simplified BSD Licence
14
+ * along with IsoSpec. If not, see <https://opensource.org/licenses/BSD-2-Clause>.
15
+ */
16
+
17
+ #pragma once
18
+
19
+ #include <queue>
20
+ #include <algorithm>
21
+ #include <vector>
22
+ #include <functional>
23
+ #include <utility>
24
+ #include <memory>
25
+ #include "conf.h"
26
+ #include "allocator.h"
27
+ #include "operators.h"
28
+ #include "summator.h"
29
+ #include "pod_vector.h"
30
+
31
+
32
+ namespace IsoSpec
33
+ {
34
+
35
+ //! The marginal distribution class (a subisotopologue).
36
+ /*!
37
+ This class mostly provides some basic common API for subclasses, but itself is not abstract.
38
+ This class represents the probability distribution generated by one element only -- a subisotopologue.
39
+ For instance, it might be the distribution of C200, that might be part of, say, C200H402.
40
+ It corresponds to the multinomial distribution, where each configuration can also be attributed a precise mass.
41
+ The constructor method perform initial hill-climbing to find the most probable sub-isotopologue (the mode).
42
+ */
43
+ class Marginal
44
+ {
45
+ private:
46
+ bool disowned;
47
+ protected:
48
+ const unsigned int isotopeNo; /*!< The number of isotopes of the given element. */
49
+ const unsigned int atomCnt; /*!< The number of atoms of the given element. */
50
+ const double* const atom_lProbs; /*!< Table of log-probabilities of all the isotopeNo isotopes. */
51
+ const double* const atom_masses; /*!< Table of atomic masses of all the isotopeNo isotopes. */
52
+ const double loggamma_nominator; /*!< The constant nominator that appears in the expressions for the multinomial probabilities. */
53
+ Conf mode_conf; /*!< A subisotopologue with most probability. If not unique, one of the representatives of that class of subisotopologues. */
54
+ double mode_lprob; /*!< The log-probability of the mode subisotopologue.*/
55
+
56
+
57
+ public:
58
+ //! Class constructor.
59
+ /*!
60
+ \param _masses A table of masses of the stable isotopes of the investigated element, e.g. for C10 it is 2: C12 and C13.
61
+ \param _probs A table of natural frequencies of the stable isotopes of the investigated element, see IUPAC at https://iupac.org/isotopesmatter/
62
+ \param _isotopeNo Number of isotopes of a given element.
63
+ \param _atomCnt The number of atoms of the given element, e.g. 10 for C10.
64
+ \return An instance of the Marginal class.
65
+ */
66
+ Marginal(
67
+ const double* _masses, // masses size = logProbs size = isotopeNo
68
+ const double* _probs,
69
+ int _isotopeNo,
70
+ int _atomCnt
71
+ );
72
+
73
+ // Get rid of the C++ generated assignment constructor.
74
+ Marginal& operator= (const Marginal& other) = delete;
75
+
76
+ //! Copy constructor
77
+ Marginal(const Marginal& other);
78
+
79
+ //! Move constructor.
80
+ Marginal(Marginal&& other);
81
+
82
+ //! Destructor.
83
+ virtual ~Marginal();
84
+
85
+ //! Get the number of isotopes of the investigated element.
86
+ /*!
87
+ \return The integer number of isotopes of the investigated element.
88
+ */
89
+ inline int get_isotopeNo() const { return isotopeNo; }
90
+
91
+ inline const double* get_lProbs() const { return atom_lProbs; }
92
+
93
+ //! Get the mass of the lightest subisotopologue.
94
+ /*! This is trivially obtained by considering all atomNo atoms to be the lightest isotope possible.
95
+ \return The mass of the lightiest subisotopologue.
96
+ */
97
+ double getLightestConfMass() const;
98
+
99
+ //! Get the mass of the heaviest subisotopologue.
100
+ /*! This is trivially obtained by considering all atomNo atoms to be the heaviest isotope possible.
101
+ \return The mass of the heaviest subisotopologue.
102
+ */
103
+ double getHeaviestConfMass() const;
104
+
105
+ //! Get the mass of the monoisotopic subisotopologue.
106
+ /*! The monoisotopic subisotopologue is defined as the molecule consiting only
107
+ of the most likely isotope. This is frequently the lightest subisotopologue,
108
+ making this frequently (but not always) equal to getLightestConfMass()
109
+ */
110
+ double getMonoisotopicConfMass() const;
111
+
112
+ //! The the mass of the mode subisotopologue.
113
+ /*!
114
+ \return The mass of one of the most probable subisotopologues.
115
+ */
116
+ inline double getModeMass() { ensureModeConf(); return calc_mass(mode_conf, atom_masses, isotopeNo); }
117
+
118
+ //! Get the log-probability of the mode subisotopologue.
119
+ /*!
120
+ \return The log-probability of a/the most probable subisotopologue.
121
+ */
122
+ inline double getModeLProb() { ensureModeConf(); return mode_lprob; }
123
+
124
+ //! Get the log-probability of the mode subisotopologue. Results undefined if ensureModeConf() wasn't called before.
125
+ inline double fastGetModeLProb() { return mode_lprob; }
126
+
127
+ //! The the probability of the mode subisotopologue.
128
+ /*!
129
+ \return The probability of a/the most probable subisotopologue.
130
+ */
131
+ // inline double getModeProb() const { return exp(getModeLProb()); }
132
+
133
+ //! Computes and returns the mode configuration, a isotopeNo-large array that the caller is responsible for delete[]-ing.
134
+ Conf computeModeConf() const;
135
+
136
+ //! The the log-probability of the lightest subisotopologue.
137
+ /*!
138
+ \return The logarithm of the smallest non-zero probability of a subisotopologue.
139
+ */
140
+ inline double getSmallestLProb() const { return atomCnt * *std::min_element(atom_lProbs, atom_lProbs+isotopeNo); }
141
+
142
+ //! The average mass of a single atom.
143
+ /*!
144
+ \return The average mass of a single atom.
145
+ */
146
+ double getAtomAverageMass() const;
147
+
148
+ //! The theoretical average mass of the molecule.
149
+ /*!
150
+ \return The theoretical average mass of the molecule.
151
+ */
152
+ inline double getTheoreticalAverageMass() const { return getAtomAverageMass() * atomCnt; }
153
+
154
+ //! Calculate the log-probability of a given subisotopologue.
155
+ /*!
156
+ \param conf A subisotopologue (a table of integers describing subsequent isotope-counts).
157
+ \return The log-probability of the input subisotopologue.
158
+ */
159
+ protected:
160
+ ISOSPEC_FORCE_INLINE double unnormalized_logProb(Conf conf) const { double ret = 0.0; for(size_t ii = 0; ii < isotopeNo; ii++) ret += minuslogFactorial(conf[ii]) + conf[ii] * atom_lProbs[ii]; return ret; }
161
+ ISOSPEC_FORCE_INLINE double logProb(Conf conf) const { return loggamma_nominator + unnormalized_logProb(conf); }
162
+ public:
163
+ //! Calculate the variance of the theoretical distribution describing the subisotopologue
164
+ double variance() const;
165
+
166
+ //! Return estimated logarithm of size of the marginal at a given ellipsoid radius
167
+ double getLogSizeEstimate(double logEllipsoidRadius) const;
168
+
169
+ inline void ensureModeConf() { if (mode_conf == nullptr) setupMode(); }
170
+ private:
171
+ void setupMode();
172
+ };
173
+
174
+
175
+ //! The marginal distribution class (a subisotopologue).
176
+ class MarginalTrek : public Marginal
177
+ {
178
+ private:
179
+ int current_count;
180
+ const ConfOrderMarginal orderMarginal;
181
+ std::priority_queue<ProbAndConfPtr, pod_vector<ProbAndConfPtr> > pq;
182
+ pod_vector<unsafe_pod_vector<ProbAndConfPtr> > fringe;
183
+ Allocator<int> allocator;
184
+ pod_vector<double> _conf_lprobs;
185
+ pod_vector<double> _conf_masses;
186
+ pod_vector<int*> _confs;
187
+
188
+ const double min_lprob;
189
+ size_t current_bucket;
190
+ size_t initialized_until;
191
+
192
+ //! Proceed to the next configuration and memoize it (as it will be surely needed).
193
+ bool add_next_conf();
194
+
195
+ size_t bucket_no(double lprob) { return static_cast<size_t>( (mode_lprob - lprob) * 100.0 ); }
196
+
197
+ public:
198
+ //! Move constructor: specializes the Marginal class.
199
+ /*!
200
+ \param tabSize The size of the table used to store configurations in the allocator.
201
+ \param hashSize The size of the hash table used to store visited subisotopologues.
202
+ */
203
+ MarginalTrek(
204
+ Marginal&& m,
205
+ int tabSize = 1000,
206
+ int hashSize = 1000
207
+ ); // NOLINT(runtime/explicit) - Constructor deliberately left usable as a conversion.
208
+
209
+ MarginalTrek(const MarginalTrek& other) = delete;
210
+ MarginalTrek& operator=(const MarginalTrek& other) = delete;
211
+
212
+ //! Check if the table of computed subisotopologues does not have to be extended.
213
+ /*!
214
+ This function checks if the idx-th most probable subisotopologue was memoized and if not, computes it and memoizes it.
215
+
216
+ \param idx The number of the idx-th most probable subisotopologue.
217
+ \return Returns false if it the provided idx exceeds the total number of subisotopologues.
218
+ */
219
+ inline bool probeConfigurationIdx(int idx)
220
+ {
221
+ while(current_count <= idx)
222
+ if(!add_next_conf())
223
+ return false;
224
+ return true;
225
+ }
226
+
227
+ //! Get the log-probability of the mode subisotopologue.
228
+ /*!
229
+ \return The log-probability of a/the most probable subisotopologue.
230
+ */
231
+ inline double getModeLProb() const { return mode_lprob; }
232
+
233
+
234
+ inline const pod_vector<double>& conf_lprobs() const { return _conf_lprobs; }
235
+ inline const pod_vector<double>& conf_masses() const { return _conf_masses; }
236
+ inline const pod_vector<Conf>& confs() const { return _confs; }
237
+
238
+
239
+ virtual ~MarginalTrek();
240
+ };
241
+
242
+
243
+ //! Precalculated Marginal class
244
+ /*!
245
+ This class serves to calculate a set of isotopologues that
246
+ is defined by the minimal probability threshold.
247
+
248
+ This works faster than if you did not know the threshold.
249
+ If you have no idea about the threshold, you would need to call us,
250
+ to change encode the layered version of the marginal.
251
+ */
252
+ class PrecalculatedMarginal : public Marginal
253
+ {
254
+ protected:
255
+ pod_vector<Conf> configurations;
256
+ Conf* confs;
257
+ unsigned int no_confs;
258
+ double* masses;
259
+ pod_vector<double> lProbs;
260
+ double* probs;
261
+ Allocator<int> allocator;
262
+ public:
263
+ //! The move constructor (disowns the Marginal).
264
+ /*!
265
+ This constructor memoizes all subisotopologues with log-probability above the provided threshold lCutOff
266
+ \param Marginal An instance of the Marginal class this class is about to disown.
267
+ \param lCutOff The lower limit on the log-probability of the precomputed subisotopologues.
268
+ \param sort Should the subisotopologues be stored with descending probability ?
269
+ \return An instance of the PrecalculatedMarginal class.
270
+ */
271
+ PrecalculatedMarginal(
272
+ Marginal&& m,
273
+ double lCutOff,
274
+ bool sort = true,
275
+ int tabSize = 1000,
276
+ int hashSize = 1000
277
+ );
278
+
279
+ PrecalculatedMarginal(const PrecalculatedMarginal& other) = delete;
280
+ PrecalculatedMarginal& operator=(const PrecalculatedMarginal& other) = delete;
281
+
282
+ //! Destructor.
283
+ virtual ~PrecalculatedMarginal();
284
+
285
+ //! Is there a subisotopologue with a given number?
286
+ /*!
287
+ \return Returns true if idx does not exceed the number of pre-computed configurations.
288
+ */
289
+ inline bool inRange(unsigned int idx) const { return idx < no_confs; }
290
+
291
+ //! Get the log-probability of the idx-th subisotopologue.
292
+ /*!
293
+ \param idx The number of the considered subisotopologue.
294
+ \return The log-probability of the idx-th subisotopologue.
295
+ */
296
+ inline const double& get_lProb(int idx) const { return lProbs[idx]; }
297
+
298
+ //! Get the probability of the idx-th subisotopologue.
299
+ /*!
300
+ \param idx The number of the considered subisotopologue.
301
+ \return The probability of the idx-th subisotopologue.
302
+ */
303
+ inline const double& get_prob(int idx) const { return probs[idx]; }
304
+
305
+ //! Get the mass of the idx-th subisotopologue.
306
+ /*!
307
+ \param idx The number of the considered subisotopologue.
308
+ \return The mass of the idx-th subisotopologue.
309
+ */
310
+ inline const double& get_mass(int idx) const { return masses[idx]; }
311
+
312
+ //! Get the table of the log-probabilities of subisotopologues.
313
+ /*!
314
+ \return Pointer to the first element in the table storing log-probabilities of subisotopologues.
315
+ */
316
+ inline const double* get_lProbs_ptr() const { return lProbs.data(); }
317
+
318
+ //! Get the table of the masses of subisotopologues.
319
+ /*!
320
+ \return Pointer to the first element in the table storing masses of subisotopologues.
321
+ */
322
+ inline const double* get_masses_ptr() const { return masses; }
323
+
324
+
325
+ //! Get the counts of isotopes that define the subisotopologue.
326
+ /*!
327
+ \param idx The number of the considered subisotopologue.
328
+ \return The counts of isotopes that define the subisotopologue.
329
+ */
330
+ inline const Conf& get_conf(int idx) const { return confs[idx]; }
331
+
332
+ //! Get the number of precomputed subisotopologues.
333
+ /*!
334
+ \return The number of precomputed subisotopologues.
335
+ */
336
+ inline unsigned int get_no_confs() const { return no_confs; }
337
+
338
+ //! Get the log-probability of the mode subisotopologue.
339
+ /*!
340
+ \return The log-probability of a/the most probable subisotopologue.
341
+ */
342
+ inline double getModeLProb() const { return mode_lprob; }
343
+ };
344
+
345
+
346
+
347
+ //! LayeredMarginal class
348
+ /*!
349
+ An extendable version of the PrecalculatedMarginal, where you can extend the threshold at will.
350
+ */
351
+ class LayeredMarginal : public Marginal
352
+ {
353
+ private:
354
+ double current_threshold;
355
+ pod_vector<Conf> configurations;
356
+ pod_vector<Conf> fringe;
357
+ pod_vector<double> fringe_unn_lprobs;
358
+ Allocator<int> allocator;
359
+ const ConfEqual equalizer;
360
+ const KeyHasher keyHasher;
361
+ pod_vector<double> lProbs;
362
+ pod_vector<double> probs;
363
+ pod_vector<double> masses;
364
+ double* guarded_lProbs;
365
+
366
+ public:
367
+ //! Move constructor: specializes the Marginal class.
368
+ /*!
369
+ \param tabSize The size of the table used to store configurations in the allocator.
370
+ \param hashSize The size of the hash table used to store visited subisotopologues.
371
+ */
372
+ LayeredMarginal(Marginal&& m, int tabSize = 1000, int hashSize = 1000); // NOLINT(runtime/explicit) - constructor deliberately left usable as a conversion
373
+
374
+ LayeredMarginal(const LayeredMarginal& other) = delete;
375
+ LayeredMarginal& operator=(const LayeredMarginal& other) = delete;
376
+
377
+ //! Extend the set of computed subisotopologues to those above the new threshold.
378
+ /*!
379
+ \param new_threshold The new log-probability limiting the subisotopologues from below.
380
+ \return Returns false, if there are no fringe-subisotopologues (subisotopologues that were neighbours of the previously calculated subisotopologues, with log-probability below the previous threshold).
381
+ */
382
+ bool extend(double new_threshold, bool do_sort = true);
383
+
384
+ //! get the log-probability of the idx-th subisotopologue, see details in @ref PrecalculatedMarginal::get_lProb.
385
+ inline double get_lProb(int idx) const { return guarded_lProbs[idx]; } // access to idx == -1 is valid and gives a guardian of +inf
386
+
387
+ //! get the probability of the idx-th subisotopologue, see details in @ref PrecalculatedMarginal::get_eProb.
388
+ inline double get_prob(int idx) const { return probs[idx]; }
389
+
390
+ //! get the mass of the idx-th subisotopologue, see details in @ref PrecalculatedMarginal::get_mass.
391
+ inline double get_mass(int idx) const { return masses[idx]; }
392
+
393
+ //! 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()
394
+ inline const double* get_lProbs_ptr() const { return lProbs.data()+1; }
395
+
396
+ //! get the counts of isotopes that define the subisotopologue, see details in @ref PrecalculatedMarginal::get_conf.
397
+ inline const Conf& get_conf(int idx) const { return configurations[idx]; }
398
+
399
+ //! Get the number of precomputed subisotopologues, see details in @ref PrecalculatedMarginal::get_no_confs.
400
+ inline unsigned int get_no_confs() const { return configurations.size(); }
401
+
402
+ //! Get the minimal mass in current layer
403
+ double get_min_mass() const;
404
+
405
+ //! Get the maximal mass in current layer
406
+ double get_max_mass() const;
407
+
408
+ //! Get the log-probability of the mode subisotopologue.
409
+ /*!
410
+ \return The log-probability of a/the most probable subisotopologue.
411
+ */
412
+ inline double getModeLProb() const { return mode_lprob; }
413
+ const pod_vector<double>& conf_lprobs() const { return lProbs; }
414
+ const pod_vector<double>& conf_masses() const { return masses; }
415
+
416
+ };
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+ template <bool add_guards>
426
+ class SingleAtomMarginal : public Marginal
427
+ {
428
+ private:
429
+ double current_threshold;
430
+ pod_vector<double> lProbs;
431
+ pod_vector<double> probs;
432
+ pod_vector<double> masses;
433
+ pod_vector<size_t> original_indexes;
434
+ double* guarded_lProbs;
435
+ int extended_to_idx;
436
+
437
+ public:
438
+ //! Move constructor: specializes the Marginal class.
439
+ /*!
440
+ */
441
+ SingleAtomMarginal(Marginal&& m, int tabSize = 1000, int hashSize = 1000); // NOLINT(runtime/explicit) - constructor deliberately left usable as a conversion
442
+
443
+ SingleAtomMarginal(const SingleAtomMarginal& other) = delete;
444
+ SingleAtomMarginal& operator=(const SingleAtomMarginal& other) = delete;
445
+
446
+ //! Extend the set of computed subisotopologues to those above the new threshold.
447
+ /*!
448
+ \param new_threshold The new log-probability limiting the subisotopologues from below.
449
+ \return Returns false, if there are no fringe-subisotopologues (subisotopologues that were neighbours of the previously calculated subisotopologues, with log-probability below the previous threshold).
450
+ */
451
+ bool extend(double new_threshold, [[maybe_unused]] bool do_sort = true) {
452
+ static_assert(add_guards, "SingleAtomMarginal::extend: add_guards must be true");
453
+ current_threshold = new_threshold;
454
+ bool extended = false;
455
+ while(guarded_lProbs[extended_to_idx] >= current_threshold)
456
+ {
457
+ extended_to_idx++;
458
+ extended = true;
459
+ }
460
+ return extended || (guarded_lProbs[extended_to_idx] != -std::numeric_limits<double>::infinity());
461
+ };
462
+
463
+ //! get the log-probability of the idx-th subisotopologue, see details in @ref PrecalculatedMarginal::get_lProb.
464
+ inline double get_lProb(int idx) const { return guarded_lProbs[idx]; } // access to idx == -1 is valid and gives a guardian of +inf
465
+
466
+ //! get the probability of the idx-th subisotopologue, see details in @ref PrecalculatedMarginal::get_eProb.
467
+ inline double get_prob(int idx) const { return probs[idx]; }
468
+
469
+ //! get the mass of the idx-th subisotopologue, see details in @ref PrecalculatedMarginal::get_mass.
470
+ inline double get_mass(int idx) const { return masses[idx]; }
471
+
472
+ //! 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()
473
+ inline const double* get_lProbs_ptr() const { return lProbs.data()+1; }
474
+
475
+ //! get the counts of isotopes that define the subisotopologue, see details in @ref PrecalculatedMarginal::get_conf.
476
+ inline const Conf& get_conf([[maybe_unused]] int idx) const { throw std::logic_error("SingleAtomMarginal.get_conf: not implemented"); /*return configurations[idx];*/ }
477
+
478
+ //! Get the number of precomputed subisotopologues, see details in @ref PrecalculatedMarginal::get_no_confs.
479
+ inline unsigned int get_no_confs() const {
480
+ if constexpr(add_guards)
481
+ return extended_to_idx;
482
+ else
483
+ return static_cast<unsigned int>(original_indexes.size());}
484
+
485
+ //! Get the minimal mass in current layer
486
+ inline double get_min_mass() const { throw std::logic_error("SingleAtomMarginal.get_min_mass: not implemented"); };
487
+
488
+ //! Get the maximal mass in current layer
489
+ double get_max_mass() const { throw std::logic_error("SingleAtomMarginal.get_max_mass: not implemented"); };
490
+
491
+ //! Get the log-probability of the mode subisotopologue.
492
+ /*!
493
+ \return The log-probability of a/the most probable subisotopologue.
494
+ */
495
+ inline double getModeLProb() const { return mode_lprob; }
496
+
497
+ inline bool probeConfigurationIdx(int idx)
498
+ {
499
+ return idx < static_cast<int>(original_indexes.size());
500
+ }
501
+ const pod_vector<double>& conf_lprobs() const { return lProbs; }
502
+ const pod_vector<double>& conf_masses() const { return masses; }
503
+
504
+ int get_original_position(int idx) const
505
+ {
506
+ #ifdef ISOSPEC_DEBUG
507
+ if (idx < 0 || static_cast<size_t>(idx) >= original_indexes.size())
508
+ throw std::out_of_range("Index out of range in SingleAtomMarginal::et_original_position");
509
+ #endif
510
+ return original_indexes[idx];
511
+ }
512
+ };
513
+
514
+
515
+
516
+
517
+ template <typename T>
518
+ class LoggingMarginal : public Marginal
519
+ {
520
+ private:
521
+ std::unique_ptr<T> real_marginal;
522
+ public:
523
+
524
+
525
+ LoggingMarginal(T&& m) : Marginal(m), real_marginal(std::make_unique(std::move(m))) {}
526
+ LoggingMarginal(T&& m, int tabSize, int hashSize)
527
+ : Marginal(m), real_marginal(std::make_unique<T>(std::move(m), tabSize, hashSize)) {}
528
+
529
+ LoggingMarginal(const LoggingMarginal& other) = delete;
530
+ LoggingMarginal& operator=(const LoggingMarginal& other) = delete;
531
+
532
+ inline double getModeLProb() const { auto ret = real_marginal->getModeLProb(); std::cout << "LoggingMarginal::getModeLProb: " << ret << std::endl; return ret; }
533
+ inline double get_lProb(int idx) const { auto ret = real_marginal->get_lProb(idx); std::cout << "LoggingMarginal::get_lProb: " << idx << " " << ret << std::endl; return ret; }
534
+ inline double get_prob(int idx) const { auto ret = real_marginal->get_prob(idx); std::cout << "LoggingMarginal::get_prob: " << idx << " " << ret << std::endl; return ret; }
535
+ inline double get_mass(int idx) const { auto ret = real_marginal->get_mass(idx); std::cout << "LoggingMarginal::get_mass: " << idx << " " << ret << std::endl; return ret; }
536
+ inline const double* get_lProbs_ptr() const { auto ret = real_marginal->get_lProbs_ptr(); std::cout << "LoggingMarginal::get_lProbs_ptr: "; printArray<double>(ret, real_marginal->get_no_confs()); return ret; }
537
+ inline const Conf& get_conf(int idx) const { auto ret = real_marginal->get_conf(idx); std::cout << "LoggingMarginal::get_conf: " << idx << std::endl; return ret; }
538
+ inline unsigned int get_no_confs() const { auto ret = real_marginal->get_no_confs(); std::cout << "LoggingMarginal::get_no_confs: " << ret << std::endl; return ret; }
539
+ inline bool probeConfigurationIdx(int idx) { auto ret = real_marginal->probeConfigurationIdx(idx); std::cout << "LoggingMarginal::probeConfigurationIdx: " << idx << " " << ret << std::endl; return ret; }
540
+ inline double get_min_mass() const { auto ret = real_marginal->get_min_mass(); std::cout << "LoggingMarginal::get_min_mass: " << ret << std::endl; return ret; }
541
+ inline double get_max_mass() const { auto ret = real_marginal->get_max_mass(); std::cout << "LoggingMarginal::get_max_mass: " << ret << std::endl; return ret; }
542
+ inline double getModeMass() const { auto ret = real_marginal->getModeMass(); std::cout << "LoggingMarginal::getModeMass: " << ret << std::endl; return ret; }
543
+ inline double getLightestConfMass() const { auto ret = real_marginal->getLightestConfMass(); std::cout << "LoggingMarginal::getLightestConfMass: " << ret << std::endl; return ret; }
544
+ inline double getHeaviestConfMass() const { auto ret = real_marginal->getHeaviestConfMass(); std::cout << "LoggingMarginal::getHeaviestConfMass: " << ret << std::endl; return ret; }
545
+ inline double getMonoisotopicConfMass() const { auto ret = real_marginal->getMonoisotopicConfMass(); std::cout << "LoggingMarginal::getMonoisotopicConfMass: " << ret << std::endl; return ret; }
546
+ inline double getAtomAverageMass() const { auto ret = real_marginal->getAtomAverageMass(); std::cout << "LoggingMarginal::getAtomAverageMass: " << ret << std::endl; return ret; }
547
+ inline double variance() const { auto ret = real_marginal->variance(); std::cout << "LoggingMarginal::variance: " << ret << std::endl; return ret; }
548
+ inline double getTheoreticalAverageMass() const { auto ret = real_marginal->getTheoreticalAverageMass(); std::cout << "LoggingMarginal::getTheoreticalAverageMass: " << ret << std::endl; return ret; }
549
+ inline double getLogSizeEstimate(double logEllipsoidRadius) const
550
+ {
551
+ auto ret = real_marginal->getLogSizeEstimate(logEllipsoidRadius);
552
+ std::cout << "LoggingMarginal::getLogSizeEstimate: " << logEllipsoidRadius << " " << ret << std::endl;
553
+ return ret;
554
+ }
555
+ inline void ensureModeConf() { real_marginal->ensureModeConf(); std::cout << "LoggingMarginal::ensureModeConf" << std::endl; }
556
+ inline const pod_vector<double>& conf_lprobs() const { return real_marginal->conf_lprobs(); }
557
+ inline const pod_vector<double>& conf_masses() const { return real_marginal->conf_masses(); }
558
+ inline int get_original_position(int idx) const { return real_marginal->get_original_position(idx); }
559
+ inline int get_isotopeNo() const { return real_marginal->get_isotopeNo(); }
560
+ inline const double* get_lProbs() const { return real_marginal->get_lProbs(); }
561
+ inline const double* get_masses() const { return real_marginal->get_masses(); }
562
+ inline const double* get_atom_lProbs() const { return real_marginal->get_lProbs(); }
563
+ inline const double* get_atom_masses() const { return real_marginal->get_masses(); }
564
+ inline bool extend(double new_threshold, bool do_sort = true)
565
+ {
566
+ auto ret = real_marginal->extend(new_threshold, do_sort);
567
+ std::cout << "LoggingMarginal::extend: " << new_threshold << " " << ret << std::endl;
568
+ return ret;
569
+ }
570
+ };
571
+
572
+
573
+ } // namespace IsoSpec