File: nr_conf.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 (111 lines) | stat: -rw-r--r-- 3,512 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <iostream>
#include <string>
#include <cassert>

#include "../../IsoSpec++/unity-build.cpp"

int main()
{
  std::string formula = "C100";

  int tabSize = 1000;
  int hashSize = 1000;
  double threshold = 0.01;
  bool absolute = false;

  threshold = 1e-2;
  {
    Iso* iso = new Iso(formula.c_str());
    IsoThresholdGenerator* generator = new IsoThresholdGenerator(std::move(*iso), threshold, absolute, tabSize, hashSize); 
    Tabulator<IsoThresholdGenerator>* tabulator = new Tabulator<IsoThresholdGenerator>(generator, true, true, false, true); 
    int64_t size = tabulator->confs_no();
    std::cout << size << std::endl;

    delete iso;
    delete generator;
    delete tabulator;
  }


  threshold = 1e-200;
  {
    Iso* iso = new Iso(formula.c_str());
    IsoThresholdGenerator* generator = new IsoThresholdGenerator(std::move(*iso), threshold, absolute, tabSize, hashSize); 
    Tabulator<IsoThresholdGenerator>* tabulator = new Tabulator<IsoThresholdGenerator>(generator, true, true, false, true); 
    int64_t size = tabulator->confs_no();
    std::cout << size << std::endl;

    delete iso;
    delete generator;
    delete tabulator;
  }

  formula = "C520H817N139O147S8";

  threshold = 1e-10;
  {
    Iso* iso = new Iso(formula.c_str());
    IsoThresholdGenerator* generator = new IsoThresholdGenerator(std::move(*iso), threshold, absolute, tabSize, hashSize); 
    Tabulator<IsoThresholdGenerator>* tabulator = new Tabulator<IsoThresholdGenerator>(generator, true, true, false, true); 
    int64_t size = tabulator->confs_no();
    std::cout << size << std::endl;

    delete iso;
    delete generator;
    delete tabulator;
  }

  threshold = 1e-50;
  {
    Iso* iso = new Iso(formula.c_str());
    IsoThresholdGenerator* generator = new IsoThresholdGenerator(std::move(*iso), threshold, absolute, tabSize, hashSize); 
    Tabulator<IsoThresholdGenerator>* tabulator = new Tabulator<IsoThresholdGenerator>(generator, true, true, false, true); 
    int64_t size = tabulator->confs_no();
    std::cout << size << std::endl;

    delete iso;
    delete generator;
    delete tabulator;
  }

  threshold = 1e-100;
  {
    Iso* iso = new Iso(formula.c_str());
    IsoThresholdGenerator* generator = new IsoThresholdGenerator(std::move(*iso), threshold, absolute, tabSize, hashSize); 
    Tabulator<IsoThresholdGenerator>* tabulator = new Tabulator<IsoThresholdGenerator>(generator, true, true, false, true); 
    int64_t size = tabulator->confs_no();
    std::cout << size << std::endl;

    delete iso;
    delete generator;
    delete tabulator;
  }

#if 0
  threshold = 1e-200;
  {
    Iso* iso = new Iso(formula.c_str());
    IsoThresholdGenerator* generator = new IsoThresholdGenerator(std::move(*iso), threshold, absolute, tabSize, hashSize); 
    Tabulator<IsoThresholdGenerator>* tabulator = new Tabulator<IsoThresholdGenerator>(generator, true, true, false, true); 
    int64_t size = tabulator->confs_no();
    std::cout << size << std::endl;

    delete iso;
    delete generator;
    delete tabulator;
  }

  threshold = 1e-300;
  {
    Iso* iso = new Iso(formula.c_str());
    IsoThresholdGenerator* generator = new IsoThresholdGenerator(std::move(*iso), threshold, absolute, tabSize, hashSize); 
    Tabulator<IsoThresholdGenerator>* tabulator = new Tabulator<IsoThresholdGenerator>(generator, true, true, false, true); 
    int64_t size = tabulator->confs_no();
    std::cout << size << std::endl;

    delete iso;
    delete generator;
    delete tabulator;
  }
#endif
}