-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.h
110 lines (80 loc) · 2.19 KB
/
mainwindow.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
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
104
105
106
107
108
109
110
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QListWidget>
struct pair{
double val;
int i;
};
struct Polynom{
double k;
int n;
Polynom * next;
};
struct polTrip{
Polynom * start;
Polynom * finish;
int len;
};
struct polPair{
Polynom * a;
Polynom * b;
};
struct MainList{
Polynom * polynom;
MainList * next;
};
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
void updateDb();
QString getPolynomString(Polynom * pol);
QString getDegree(int n);
pair getK(QString & s, int i);
pair getN(QString & s, int i);
bool parseInput(Polynom * pol,QString & s, int i);
void addPolynomToDb(Polynom * pol);
void normalize(Polynom * pol);
polTrip sort(Polynom * pol, int len);
void cutZero(Polynom * pol);
Polynom * Plus (Polynom * pol1, Polynom * pol2);
Polynom * Minus (Polynom * pol1, Polynom * pol2);
Polynom * Multiply (Polynom * pol1, Polynom * pol2);
Polynom * Derivative (Polynom * pol);
bool Equal(Polynom * pol1, Polynom * pol2);
void updatePlaceholders();
polPair Division(Polynom * pol1, Polynom * pol2);
double Point(Polynom * pol, double x);
double pow(double x, int n);
void setSavabilityPolynom(bool t);
Polynom * complex(Polynom * pol);
bool checkNull(Polynom * pol);
private slots:
void on_btnAddPolynom_clicked();
void on_btnGetResult_clicked();
void on_bntClearInputField1_clicked();
void on_bntClearInputField2_clicked();
void on_bntClearOutputResult_clicked();
void on_btnSave_clicked();
void on_bntClearInputPolymon_clicked();
void onDblClicked(QListWidgetItem * item);
void on_rbtnPlus_clicked();
void on_rbtnMinus_clicked();
void on_rbtnMultiply_clicked();
void on_rbtnDivision_clicked();
void on_rbtnEqual_clicked();
void on_rbtnPoint_clicked();
void on_rbtnDerivative_clicked();
void on_bntClearInputField3_clicked();
void on_btnFindRoots_clicked();
void on_bntClearOutputField2_clicked();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H