-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoullong.cpp
54 lines (42 loc) · 1.33 KB
/
coullong.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
#include "coullong.h"
coulLong::coulLong(coulLong &obj):potential(obj.getId1(),obj.getId2(),obj.getName1(),obj.getName2(),obj.getStyle(),obj.getFile())
{
}
coulLong::coulLong(int i1, int i2, bool ii,string n1, string n2):potential(i1,i2,n1,n2,ii)
{
setStyle("coul/long");
}
void coulLong::print(ofstream &out)
{
std::size_t foundsoft = getStyle().find("soft");
if (out.is_open())
{
if(foundsoft!=std::string::npos)
{
out<<setw(12)<<left<<prefix<<setw(4)<<getId1()<<setw(5)
<<getId2()<<setw(70)
<<getStyle()<<setw(13)
<<fixed<<setprecision(1)<<getLambda()<< resetiosflags(ios::fixed)<<setprecision(8)
<<" "<<right<<"#"
<<getName1()<<" "<<getName2()<<" "<< getFile()<< endl;
}else
{
out<<setw(12)<<left<<prefix<<setw(4)<<getId1()<<setw(5)
<<getId2()<<setw(30)
<<getStyle()<<setw(20)
<<" "<<setw(20)
<<" "<<setw(15)<<right<<"#"
<<getName1()<<" "<<getName2()<<" "<< getFile()<< endl;
}
}else
{
cout<<"Could not write to file\n";
}
}
void coulLong::printTerminal()
{
cout<<getId1()<<" "
<<getId2()<<" "
<<getStyle()<<" #"
<<getName1()<<" "<<getName2()<< endl;
}