PIEvaluator simplify variables sort

This commit is contained in:
2021-04-02 11:42:01 +03:00
parent 58bdcd65a3
commit 8a05a25bca
3 changed files with 45 additions and 68 deletions

View File

@@ -76,13 +76,12 @@ namespace PIEvaluatorTypes {
short arguments;
};
struct PIP_EXPORT Variable {
Variable() {value = 0.; index = -1;}
Variable(const PIString & var_name, complexd val, int ind = -1) {name = var_name; value = val; index = ind;}
int index;
Variable() {value = 0.;}
Variable(const PIString & var_name, complexd val) {name = var_name; value = val;}
PIString name;
complexd value;
};
};
}
/*
≠ :
≥ }
@@ -231,8 +230,6 @@ private:
inline bool operator ==(PIEvaluatorTypes::Element e1, PIEvaluatorTypes::Element e2) {return (e1.type == e2.type && e1.num == e2.num);}
inline bool operator !=(PIEvaluatorTypes::Element e1, PIEvaluatorTypes::Element e2) {return (e1.type != e2.type || e1.num != e2.num);}
inline bool operator < (PIEvaluatorTypes::Variable e1, PIEvaluatorTypes::Variable e2) {return e1.name > e2.name;}
inline bool operator ==(PIEvaluatorTypes::Variable e1, PIEvaluatorTypes::Variable e2) {return e1.name == e2.name;}
inline PIByteArray & operator <<(PIByteArray & s, const PIEvaluatorTypes::Instruction & v) {
s << PIByteArray::RawData(&v, sizeof(v) - sizeof(v.operators)) << v.operators;