-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathEngine.cc
70 lines (62 loc) · 1.49 KB
/
Engine.cc
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
//--------------------------------------------------------------------------
//
// Description:
// class Engine : see header file (Engine.hh) for description.
//
//------------------------------------------------------------------------
//-----------------------
// This Class's Header --
//-----------------------
#include "Engine.hh"
// ------------------------
// Collaborating classes --
//-------------------------
//--------------------
// C++
//--------------------
#include<numeric>
#include<iostream>
#include<stdexcept>
//--------------------
// C
//----------------
using namespace std;
//---------------
// Constructors --
//----------------
Engine::Engine():_lmax(-1)
{
}
//--------------
// Destructor --
//--------------
//-----------------
// Member functions --
//-----------------
void
Engine::writeCls(std::ostream &of){
vector<unsigned> lvec(_lmax-1,1);
lvec[0]=2;
partial_sum(lvec.begin(),lvec.end(),lvec.begin());
vector<double> cltt,clte,clee,clbb,clpp,cltp,clep;
bool hasLensing=false;
try{
getCls(lvec,cltt,clte,clee,clbb);
hasLensing=getLensing(lvec,clpp,cltp,clep);
}
catch (std::exception &e){
cout << "GIOSH" << e.what() << endl;
}
cout.precision( 16 );
for (size_t i=0;i<lvec.size();i++) {
of << lvec[i] << "\t"
<< cltt[i] << "\t"
<< clte[i] << "\t"
<< clee[i] << "\t"
<< clbb[i];
if (hasLensing){
of << "\t" << clpp[i] << "\t" << cltp[i] << "\t" << clep[i];
}
of << "\n";
}
}