-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
103 lines (77 loc) · 2.4 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#include <pythonic.h>
#include <tests/optimization_tree_tests/raw_optimization_tree_test.h>
#include <tests/other_tests.h>
#include "query_processor.h"
#include "benchmark/length_benchmark.h"
#include "math_bot_config.h"
void test_query_processing(const std::string& process_name, const std::string& dir_name, const std::string& file_name) {
auto path = (math_bot_query_path / dir_name / file_name).string();
const char* emulated_argv[] = {
"",
process_name.c_str(),
path.c_str()
};
std::cout << console_colors::green
<< "Testing math bot query: " << process_name
<< console_colors::remove_all_colors << std::endl;
process_user_input(3, emulated_argv);
}
void test_process_plotting(){
std::string dir_with_examples = "_examples";
std::string example_filename = "plotting_example.json";
const std::string& this_filename = example_filename;
const std::string& this_dir = dir_with_examples;
test_query_processing(
"plot",
this_dir,
this_filename
);
}
void test_process_optimizing(){
std::string dir_with_examples = "_examples";
std::string example_filename = "optimizing_example.json";
const std::string& this_dir = "215659697";
const std::string& this_filename = "543.json";
// const std::string& this_dir = dir_with_examples;
// const std::string& this_filename = example_filename;
test_query_processing(
"optimize",
this_dir,
this_filename
);
}
void test_process_solving(){
// std::string dir_with_examples = "_examples";
// std::string example_filename = "solving_example.json";
// std::string non_solvable_filename = "non_solvable_example.json";
const std::string& this_dir = "215659697";
const std::string& this_filename = "627.json";
// const std::string& this_dir = dir_with_examples;
// const std::string& this_filename = example_filename;
// const std::string& this_filename = non_solvable_filename;
test_query_processing(
"solve",
this_dir,
this_filename
);
}
int main (int argc, const char **argv)
{
set_utf8_in_console();
if (argc == 1) {
/// Testing:
// plot_expression_derivative_length_graph();
// test_raw_optimization_tree();
// rubbish_tests();
std::cout << math_bot_pch_file_path << std::endl;
std::cout << math_bot_base_dir << std::endl;
// test_process_optimizing();
// test_process_plotting();
test_process_solving();
}
else {
/// Actual work:
process_user_input(argc, reinterpret_cast<const char **>(argv));
}
return 0;
}