File: marginal-test.cpp

package info (click to toggle)
isospec 2.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,472 kB
  • sloc: cpp: 9,530; python: 2,095; makefile: 180; ansic: 100; sh: 88
file content (44 lines) | stat: -rw-r--r-- 1,078 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <iostream>
#include "unity-build.cpp"
#include "marginalTrek++.h"
#include "summator.h"

using namespace IsoSpec;


int main()
{

    SSummator s;
    unsigned int cnt_tot = 0;
    int total_t = 10;
    double threshold = 0.1;
    double masses[] = {1.0, 1000.0};
    double probs[] = {0.9, 0.1};
    Marginal m(masses, probs, 2, 100);
    MarginalTrek mr(std::move(m));

    int ii = 0;
    while(mr.probeConfigurationIdx(ii))
    {
        std::cout << ii << " " << mr.conf_lprobs()[ii] << "\n";
        ii++;
    }

#if 0
    IsoThresholdGeneratorBoundMass* isob = new IsoThresholdGeneratorBoundMass("C169719H270464N45688O52237S911", threshold, mmin, mmax, false);
    std::cout << isob->getModeLProb() << std::endl;

    unsigned int confsig[5];
    double cnt = 1.0;
    cnt_tot = 0;
    double lc = isob->getModeLProb() + log(threshold);
    while(isob->advanceToNextConfiguration())
    {
    	cnt_tot++;
    }
    delete isob;

    std::cout <<  "The isotopologue set containing at least 0.9 probability has " << cnt_tot << " element(s)" << std::endl;
#endif
}