-
Notifications
You must be signed in to change notification settings - Fork 1
/
polynomial.h
42 lines (32 loc) · 1.07 KB
/
polynomial.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
#pragma once
#include "types.h"
//template <class ld = long double, index_t MaxDdegree = 32>
using ld = long double;
class Polynomial : public QObject {
Q_OBJECT
std::vector<ld> degrees_; //результат
std::vector<ld> degreesPrec_; //результат
Data data_; //массив входных данных
Data delta_;
int precision_ { 6 };
bool usePrecision_ {};
inline ld calcPoly(ld x, std::vector<ld> °rees, index_t size = {});
signals:
void degreesChanged(const Degrees&);
void dataChanged(const Data&);
void deltaChanged(const Data&);
public:
Polynomial();
void addData(double x, double y);
void addData(const DataPoint& xy);
void setData(const Data& xy);
void clear();
void calcDegrees(index_t D);
Data calcDataAndDeltaErr(Data in);
Degrees degrees() const;
void setDegrees(const Degrees& degrees);
int precision() const;
void setPrecision(int newPrecision);
bool usePrecision() const;
void setUsePrecision(bool newUsePrecision);
};