-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug_printer.cpp
82 lines (61 loc) · 1.66 KB
/
debug_printer.cpp
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
//Created: 18-08-2014
//Modified: Wed 10 Dec 2014 10:37:06 CET
//Author: Jonas R. Glesaaen ([email protected])
#include"debug_printer.hpp"
#include"pm.config.h"
#include"pm.paths.h"
namespace hop {
void DebugPrinter::PrintPMConfig(const PMConfig & conf)
{
int next_trace_index = conf.upper_trace_bound(0);
for(int i = 0; i < conf.getLen(); ++i) {
if(i == next_trace_index) {
os << '.';
next_trace_index = conf.upper_trace_bound(i);
}
os << ( (conf[i] == Cfg_P) ? 'p' : 'm' );
}
os << " (" << conf.get_prefactor() << ")" << std::endl;
};
void DebugPrinter::PrintPMConfigExit(const PMConfig &)
{
os << std::endl;
};
void DebugPrinter::PrintPMPath(const PMPath & path)
{
int i_char = (int)'i' - 1;
os << "{" << (char)(i_char + abs(path[0]));
for(int i = 1; i < path.size(); ++i)
os << ',' << (char)(i_char + abs(path[i]));
os << "}" << std::endl;
};
void DebugPrinter::PrintPMPathExit(const PMPath &)
{
os << std::endl;
};
void DebugPrinter::PrintPathList(const std::vector<int> & path)
{
int i_char = (int)'i' - 1;
os << " {" << (char)(i_char + abs(path[0]));
for(int i = 1; i < path.size(); ++i)
os << ',' << (char)(i_char + abs(path[i]));
os << "}" << std::endl;
};
void DebugPrinter::PrintWilsonString(const WilsonString &)
{
os << '\t';
};
void DebugPrinter::PrintWilsonStringExit(const WilsonString & ws)
{
os << " (" << ws.prefactor << " Nf";
if (ws.number_of_traces > 1)
os << "^" << ws.number_of_traces;
os << ")" << std::endl;
};
void DebugPrinter::PrintWilson(const Wilson & w)
{
os << "W(" << w.n << "," << w.m << ",";
position_printer->print(w.pos);
os << ")";
};
} //Namespace hop