|
|
|
|
@@ -31,12 +31,12 @@ typedef complexd (*FuncFunc)(void * , int, complexd * );
|
|
|
|
|
namespace PIEvaluatorTypes {
|
|
|
|
|
static const int operationCount = 14;
|
|
|
|
|
|
|
|
|
|
enum eType {etNumber, etOperator, etVariable, etFunction};
|
|
|
|
|
enum Operation {oNone, oAdd, oSubtract, oMultiply, oDivide, oResidue, oPower,
|
|
|
|
|
enum PIP_EXPORT eType {etNumber, etOperator, etVariable, etFunction};
|
|
|
|
|
enum PIP_EXPORT Operation {oNone, oAdd, oSubtract, oMultiply, oDivide, oResidue, oPower,
|
|
|
|
|
oEqual, oNotEqual, oGreater, oSmaller, oGreaterEqual, oSmallerEqual,
|
|
|
|
|
oAnd, oOr, oFunction
|
|
|
|
|
};
|
|
|
|
|
enum BaseFunctions {bfUnknown, bfSin, bfCos, bfTg, bfCtg,
|
|
|
|
|
enum PIP_EXPORT BaseFunctions {bfUnknown, bfSin, bfCos, bfTg, bfCtg,
|
|
|
|
|
bfArcsin, bfArccos, bfArctg, bfArcctg,
|
|
|
|
|
bfExp, bfRandom, bfRandomn,
|
|
|
|
|
bfSh, bfCh, bfTh, bfCth,
|
|
|
|
|
@@ -50,7 +50,7 @@ namespace PIEvaluatorTypes {
|
|
|
|
|
bfCustom = 0xFFFF
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Instruction {
|
|
|
|
|
struct PIP_EXPORT Instruction {
|
|
|
|
|
Instruction() {out = -1; function = -1; operation = oNone;}
|
|
|
|
|
Instruction(Operation oper, PIVector<int> opers, int out_ind, int func = -1) {
|
|
|
|
|
operation = oper; operators = opers; out = out_ind; function = func;}
|
|
|
|
|
@@ -59,7 +59,7 @@ namespace PIEvaluatorTypes {
|
|
|
|
|
int out;
|
|
|
|
|
int function;
|
|
|
|
|
};
|
|
|
|
|
struct Element {
|
|
|
|
|
struct PIP_EXPORT Element {
|
|
|
|
|
Element() {num = 0; var_num = -1; type = etNumber;}
|
|
|
|
|
Element(eType new_type, int new_num, int new_var_num = -1) {set(new_type, new_num, new_var_num);}
|
|
|
|
|
void set(eType new_type, int new_num, int new_var_num = -1) {type = new_type; num = new_num; var_num = new_var_num;}
|
|
|
|
|
@@ -67,7 +67,7 @@ namespace PIEvaluatorTypes {
|
|
|
|
|
int num;
|
|
|
|
|
int var_num;
|
|
|
|
|
};
|
|
|
|
|
struct Function {
|
|
|
|
|
struct PIP_EXPORT Function {
|
|
|
|
|
Function() {arguments = 0; type = bfUnknown; handler = 0;}
|
|
|
|
|
Function(const PIString & name, int args, BaseFunctions ftype) {identifier = name; arguments = args; type = ftype; handler = 0;}
|
|
|
|
|
Function(const PIString & name, int args, FuncFunc h) {identifier = name; arguments = args; type = bfCustom; handler = h;}
|
|
|
|
|
@@ -76,7 +76,7 @@ namespace PIEvaluatorTypes {
|
|
|
|
|
FuncFunc handler;
|
|
|
|
|
int arguments;
|
|
|
|
|
};
|
|
|
|
|
struct Variable {
|
|
|
|
|
struct PIP_EXPORT Variable {
|
|
|
|
|
Variable() {value = 0.;}
|
|
|
|
|
Variable(const PIString & var_name, complexd val) {name = var_name; value = val;}
|
|
|
|
|
PIString name;
|
|
|
|
|
|