-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
78 lines (73 loc) · 2.09 KB
/
Copy pathmain.cpp
File metadata and controls
78 lines (73 loc) · 2.09 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
#include <iostream>
#include <vector>
#include <queue> //* queue<int> q; //FIFO
#include <algorithm> //*generate,sort,begin,end, reverse, max,min
#include <functional> //*std::function,placeholders::_1
#include <memory> //* shared_ptr
#include "numcpp.h"
//* ---pyrallis---
#include <stdio.h>
#include <unistd.h>
#include <bits/getopt_core.h>
#include <filesystem>
#include <string>
#include <random>
#include <iomanip>
#include "numcpp.h"
#include "func.h"
#define GET_VARIABLE_NAME(Variable) (#Variable)
using std::stoi;
using std::vector;
using std::queue;
using std::cout;
using std::cin;
using std::endl;
using std::string;
using namespace nc;
#include "examples.h"
//*./main -i -o file.txt -lr -x 'hero'
int main(int argc, char *argv[]){
int opt;
int run_opt = 0;
while((opt = getopt(argc, argv, ":i:o:p:r:k:x")) != -1) {
switch(opt) {
case 'o': run_opt = stoi(optarg); break;
case ':': printf("option needs a value\n"); break;
case '?': printf("unknown option: %c\n", optopt); break;
}
}
for(; optind < argc; optind++){
printf("extra arguments: %s\n", argv[optind]);
}
//*-------------------------
if (run_opt==0){ ex0();
}else if (run_opt==1){ex1(); //numcpp_2D nc_init.cpp
}else if (run_opt==2){ex2();
}else if (run_opt==3){ex3();
}else if (run_opt==4){ex4();
}else if (run_opt==5){ex5();
}else if (run_opt==6){ex6();
}else if (run_opt==7){ex7();
//*-----tensor-----
}else if(run_opt==10){ex10();
}else if(run_opt==11){ex11();
}else if(run_opt==12){ex12();
}else if(run_opt==13){ex13();
}else if(run_opt==14){ex14();
}else if(run_opt==15){ex15();
}else if(run_opt==16){ex16();
}else if(run_opt==17){ex17();
//todo cuda
}else if(run_opt==18){ex18();
}else if(run_opt==20){ex20();
}else if(run_opt==21){ex21();
}else{
ex0(false); ex1(false); ex2(false); ex3(false); ex4(false);
ex5(false); ex6(false); ex7(false);
ex10(false);ex11(false);ex12(false);ex13(false);ex14(false);
ex15(false);ex16(false);ex17(false);
//* cuda
ex18(false);ex20(false);ex21(false);
}
return 0;
}