13 #include "ThermalFISTConfig.h" 30 string NumberToString(
int num) {
36 string OutputString(
const string &strin) {
40 while (ret.size() < 78)
47 bool Disclaimer::PrintDisclaimer()
49 if (Disclaimer::DisclaimerPrinted)
52 cout << string(79,
'#') << endl;
54 cout <<
"#" << string(77,
' ') <<
"#" << endl;
58 tmpstr +=
"This is Thermal-FIST version ";
59 tmpstr += NumberToString(ThermalFIST_VERSION_MAJOR);
61 tmpstr += NumberToString(ThermalFIST_VERSION_MINOR);
63 if (ThermalFIST_VERSION_DEVEL != 0) {
65 tmpstr += NumberToString(ThermalFIST_VERSION_DEVEL);
68 tmpstr = OutputString(tmpstr);
70 cout << tmpstr << endl;
72 cout <<
"#" << string(77,
' ') <<
"#" << endl;
77 email += char(email[0] - 7);
79 email += char(
'a' + 2);
80 email += char(email[email.size() - 1] + 5);
84 char ch1 = email[email.size() - 2], ch2 = email[email.size() - 1];
85 email[email.size() - 1] = ch1;
86 email[email.size() - 2] = ch2;
89 email +=
"uni-frankfurt.de";
91 tmpstr =
"Copyright (c) 2020 Volodymyr Vovchenko <" + email +
">";
93 tmpstr = OutputString(tmpstr);
95 cout << tmpstr << endl;
97 cout <<
"#" << string(77,
' ') <<
"#" << endl;
99 tmpstr =
"Distributed under the GNU General Public License 3.0 (GPLv3 or later)";
101 tmpstr = OutputString(tmpstr);
103 cout << tmpstr << endl;
105 cout <<
"#" << string(77,
' ') <<
"#" << endl;
107 tmpstr =
"Please cite when using this code:";
108 tmpstr = OutputString(tmpstr);
109 cout << tmpstr << endl;
111 tmpstr =
"V. Vovchenko, H. Stoecker, Comput. Phys. Commun. 244, 295 (2019)";
112 tmpstr = OutputString(tmpstr);
113 cout << tmpstr << endl;
119 cout <<
"#" << string(77,
' ') <<
"#" << endl;
122 tmpstr =
"The latest version is available at https://github.com/vlvovch/Thermal-FIST";
124 tmpstr = OutputString(tmpstr);
126 cout << tmpstr << endl;
128 cout <<
"#" << string(77,
' ') <<
"#" << endl;
130 cout << string(79,
'#') << endl;
134 return Disclaimer::DisclaimerPrinted =
true;
137 bool Disclaimer::DisclaimerPrinted = PrintDisclaimer();
142 if (str.size() > 0 && str[0] ==
'-') {
146 for (
size_t i = ist; i < str.size(); ++i) {
147 if (str[i] >=
'0' && str[i] <=
'9') {
149 ret +=
static_cast<long long>(str[i] -
'0');
159 LARGE_INTEGER time,freq;
160 if (!QueryPerformanceFrequency(&freq)){
164 if (!QueryPerformanceCounter(&time)){
168 return (
double)time.QuadPart / freq.QuadPart;
173 if (GetProcessTimes(GetCurrentProcess(),&a,&b,&c,&d) != 0){
177 (
double)(d.dwLowDateTime |
178 ((
unsigned long long)d.dwHighDateTime << 32)) * 0.0000001;
189 if (gettimeofday(&time,NULL)){
193 return (
double)time.tv_sec + (double)time.tv_usec * .000001;
196 return (
double)clock() / CLOCKS_PER_SEC;
Contains some helper functions.
long long stringToLongLong(const string &str)
The main namespace where all classes and functions of the Thermal-FIST library reside.