-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
76 lines (72 loc) · 1.47 KB
/
main.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
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <iterator>
#include <ctime>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include "lm.h"
#include "ograph.h"
#include "debug.h"
using namespace std;
int main(int argc, char ** argv)
{
int sys(0);
if(argc==1){
printf("usage: <input> [output.dot] [minimizer length]\n");
printf("Note: maximum minimizer length (minimizer length = 10) requires that you type 'ulimit -n 1100' in your shell prior to running bcalm, else the software will crash\n");
exit(1);
}
if(argc==2){
string input(argv[1]);
string output("compacted.dot");
int m(4);
if(testulimit(300)){
int k(detectk(input));
if(k<=2*m){
cout<<"k too low"<<endl;
}
else{
createoutfile(input.c_str(),output.c_str(),k,m);
}
}else{
cout<<"ulimit too low"<<endl;
}
}
if(argc==3){
string input(argv[1]);
string output(argv[2]);
int m(4);
if(testulimit(300)){
int k(detectk(input));
if(k<=2*m){
cout<<"k too low"<<endl;
}
else{
createoutfile(input.c_str(),output.c_str(),k,m);
}
}else{
cout<<"ulimit too low"<<endl;
}
}
if(argc==4){
string input(argv[1]);
string output(argv[2]);
int m(atoi(argv[3])/2);
if(testulimit(pow(4,m)+50))
{
int k(detectk(input));
if(k<=2*m){
cout<<"k too low"<<endl;
}
else{
createoutfile(input.c_str(),output.c_str(),k,m);
}
}else{
cout<<"ulimit too low"<<endl;
}
}
return sys;
}