-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
84 lines (73 loc) · 1.89 KB
/
Copy pathmain.cpp
File metadata and controls
84 lines (73 loc) · 1.89 KB
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
83
84
#include "allIncludes.hpp"
#include "mainUtil.hpp"
int main(int argc, char* argv[]){
if (argc!=7){
cout<<"Incorrect arguments"<<endl;
return -1;
}
string folderInput;
if (strcmp(argv[1],"-i")==0){
string temp(argv[2]);
folderInput=temp;
}
else if(strcmp(argv[3],"-i")==0){
string temp(argv[4]);
folderInput=temp;
}
else if(strcmp(argv[5],"-i")==0){
string temp(argv[6]);
folderInput=temp;
}
else{
cout<<"Incorrect arguments"<<endl;
return -1;
}
string fileOutput;
if (strcmp(argv[1],"-o")==0){
string temp(argv[2]);
fileOutput=temp;
}
else if(strcmp(argv[3],"-o")==0){
string temp(argv[4]);
fileOutput=temp;
}
else if(strcmp(argv[5],"-o")==0){
string temp(argv[6]);
fileOutput=temp;
}
else{
cout<<"Incorrect arguments"<<endl;
return -1;
}
int preprocess;
if (strcmp(argv[1],"-preprocess")==0){
preprocess=atoi(argv[2]);
}
else if(strcmp(argv[3],"-preprocess")==0){
preprocess=atoi(argv[4]);
}
else if(strcmp(argv[5],"-preprocess")==0){
preprocess=atoi(argv[6]);
}
else{
cout<<"Incorrect arguments"<<endl;
return -1;
}
cout<< folderInput<<endl;
cout << fileOutput<<endl;
cout<< preprocess<<endl;
unsigned int tmp = (unsigned) time(NULL);
srand(tmp);
ofstream outfile(fileOutput);
outfile <<"\t\t\t";
for (int i=0;i<CASES;i++)
outfile <<"||\t\t\t\t\t\t\tAlgorithm\t"<<i+1<<"\t\t\t\t\t\t\t";
outfile<<"||"<<endl;
outfile <<"Size \t\t";
for (int i=0;i<CASES;i++)
outfile <<"||\t" <<"Min Score \t\t"<<"Max Score\t\t" <<"Min Bound\t\t"<< "Max Bound\t\t";
outfile<<"||"<<endl;
readFolder(folderInput, &outfile, preprocess);
outfile.close();
return 0;
}