-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackend.h
31 lines (24 loc) · 944 Bytes
/
backend.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
#ifndef BACKEND_H
#define BACKEND_H
#include <string>
#include "function.h"
#include "solutionsummaries.h"
class Backend
{
Function *function = nullptr;
struct SingleFloatSummary floatSummary(long double solution, std::string more = "");
struct SingleIntervalSummary intervalSummary(interval solution, std::string more = "");
public:
Backend();
~Backend();
int decimals = 16;
long double bisectionTolerance = 1e-16;
int bisectionIterations = 60;
static std::string intervalToString(interval x, int decimals = 16);
static long double stringToFloat(const std::string &value);
static interval stringToInterval(const std::string &value, char separator = ':');
void loadFunction(char filename[]);
struct FloatSummary solveFloatingPoint(const std::string &a, const std::string &b);
struct IntervalSummary solveInterval(const std::string &a, const std::string &b);
};
#endif // BACKEND_H