-
Notifications
You must be signed in to change notification settings - Fork 0
/
gfun.h
45 lines (34 loc) · 888 Bytes
/
gfun.h
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
#ifndef GFUN_H
#define GFUN_H
#include <cstdlib>
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <cassert>
#include <ctime>
using namespace std;
//==========================================================
// GLOBAL FUNCTION :
//==========================================================
template <class T>
static void READ_VALUE(ifstream &ifs, T &v)
{
ifs >> v;
ifs.ignore(150, '\n');
return;
}
bool SCAN_BEGIN(ifstream &ifs, const string &TargetName, const bool restart=1);
// Mohan warning : the last term can't be written as const bool &restart,
// I don't know why.
void TITLE(const string &class_name,const string &function_name);
void QUIT(const string &name);
template <class T>
inline void ZEROS(T a, const int &size)
{
assert(size>0);
for(int i=0; i<size; ++i) a[i]=0;
}
#endif