-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormula.cpp
More file actions
64 lines (56 loc) · 912 Bytes
/
Formula.cpp
File metadata and controls
64 lines (56 loc) · 912 Bytes
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
#include<iostream>
#include<windows.h>
#include<stdarg.h>
#include"Formula.h"
#include"Functions.h"
#include"Print.h"
Formula::Formula(char id) {
this->id = id;
this->fs = nullptr;
this->IsUpdated = 0;
return;
}
Formula::~Formula()
{
}
void Formula::AddToFrame(Frame* fs)
{
this->fs = fs;
fs->AddFormula(this);
}
void Formula::Init(string exp) {
pNode node = NewNode();
this->root = NewPol();
SplitString(exp, 0, 0, node->exp, false);
Parse3_End(node, this->root);
return;
}
void Formula::Init(pPol root)
{
}
void Formula::Init(Formula exp)
{
}
void Formula::Assign(rational value)
{
this->IsUpdated = true;
this->value = value;
}
void Formula::Culc()
{
this->IsUpdated = true;
this->value = PolCulc(this->root, this->fs);
}
rational Formula::GetValue()
{
return this->value;
}
void Formula::Simplify()
{
PolSimp(this->root);
return;
}
void Formula::Print()
{
PolsPrint(this->root);
}