Repository navigation
Expand file tree
/
Copy pathcalculator_basic.h
More file actions
74 lines (68 loc) · 1.44 KB
/
Copy pathcalculator_basic.h
File metadata and controls
74 lines (68 loc) · 1.44 KB
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
#ifndef CALCULATOR_BASIC_H
#define CALCULATOR_BASIC_H
#include "genericnumber.h"
#include <QtCore/qobject.h>
enum Sign{
PLUS,
MINUS,
MUL,
DOT,
CROSS,
PROJ,
PERP,
LENGTH,
RREF,
INVT,
TRANS,
NULL_SPACE,
COL_SPACE,
RANK,
BASE,
SOLVE,
DET,
EQU,
EIGEN_SPACE
};
struct SignDefinition{
SignDefinition(Sign sign, QString literal, bool isFunction = false, bool isExponent = false, bool isAbs = false){
this->sign = sign;
this->literal = literal;
this->isExponent = isExponent;
this->isAbs = isAbs;
this->isFunction = isFunction;
}
QString literal;
Sign sign;
bool isFunction;
bool isAbs;
bool isExponent;
};
const SignDefinition signs[] = {
{ PLUS, " + " },
{ MINUS, " - "},
{ MUL, " " },
{ DOT, " . "},
{ CROSS, " X "},
{ PROJ, "Proj", true },
{ PERP, "Perp", true },
{ LENGTH, "", false, false, true },
{ RREF, "RREF", true },
{ INVT, " -1", false, true },
{ TRANS, " T", false, true },
{ NULL_SPACE, "Null", true },
{ COL_SPACE, "Col", true },
{ RANK, "Rank", true },
{ BASE, "Base", true },
{ SOLVE, "Solve", true},
{ DET, "Det", true},
{ EQU, "=", false},
{ EIGEN_SPACE, "Eigen", true }
};
struct Calculation{
NumberType operandA;
NumberType operandB;
NumberType result;
Sign sign;
QString name;
};
#endif // CALCULATOR_BASIC_H