git-svn-id: svn://db.shs.com.ru/pip@647 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2018-10-16 11:36:38 +00:00
parent dd00a36be3
commit 1548cba46e
3 changed files with 86 additions and 27 deletions

View File

@@ -699,8 +699,8 @@ void PIEvaluator::convert() {
const PIString & PIEvaluator::preprocess(const PIString & string) {
static PIString ret;
PIString PIEvaluator::preprocess(const PIString & string) {
PIString ret;
int lind;
ret = prepare(string);
convert();
@@ -1180,6 +1180,7 @@ inline void PIEvaluator::execFunction(const PIEvaluatorTypes::Instruction & ci)
inline bool PIEvaluator::execInstructions() {
kvars = &(content.variables);
PIEvaluatorTypes::Instruction ci;
int oi;
complexd tmp;
@@ -1266,3 +1267,16 @@ complexd PIEvaluator::evaluate() {
if (fabs(out.imag()) < 1E-300) out = complexd(out.real(), 0.);
return out;
}
PIByteArray PIEvaluator::save() const {
PIByteArray ret;
ret << content << elements << currentVariables << unknownVars << variables << instructions << currentString << lastError << out << correct;
return ret;
}
void PIEvaluator::load(PIByteArray ba) {
if (ba.size() <= 4) return;
ba >> content >> elements >> currentVariables >> unknownVars >> variables >> instructions >> currentString >> lastError >> out >> correct;
}