-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery_processor.h
63 lines (40 loc) · 1.31 KB
/
query_processor.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include <pythonic.h>
#include <expression_parsing.h>
struct base_query
{
std::string user_name = "Not Vova";
std::string target_path;
std::string identifier = "None";
std::string tree_name = "GDs_with_learning_rates"; // TODO: add ability to change this from UI!
};
void to_json(json& j, const base_query& query);
void from_json(const json& j, base_query& query);
struct optimization_query : base_query
{
std::string expression;
std::unordered_set<std::string> variables;
std::unordered_map<std::string, std::pair<double, double>> variable_ranges;
double target_minimum = 0;
size_t iterations = 1000000;
};
struct equation_solving_query : base_query // TODO
{
std::string expression;
std::unordered_set<std::string> variables;
std::unordered_map<std::string, std::pair<double, double>> variable_ranges;
size_t iterations = 1000000;
};
void from_json(const json& j, equation_solving_query& query);
struct plotting_query : base_query
{
std::vector<std::string> functions;
double from = 0;
double to = 50;
size_t steps = 1;
std::string text_path;
};
void to_json(json& j, const plotting_query& query);
void from_json(const json& j, plotting_query& query);
optimization_query load_optimization_query_from_json(const std::string& filename);
void process_user_input(int argc, const char* argv[]);