mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 23:00:45 +01:00
[poincare] Replace functions when replacing symbols iteratively
This commit is contained in:
@@ -73,6 +73,10 @@ Expression FunctionNode::shallowReduce(Context & context, Preferences::AngleUnit
|
||||
return Function(this).shallowReduce(context, angleUnit, replaceSymbols); // This uses Symbol::shallowReduce
|
||||
}
|
||||
|
||||
Expression FunctionNode::replaceReplaceableSymbols(Context & context) {
|
||||
return Function(this).replaceReplaceableSymbols(context);
|
||||
}
|
||||
|
||||
Evaluation<float> FunctionNode::approximate(SinglePrecision p, Context& context, Preferences::AngleUnit angleUnit) const {
|
||||
return templatedApproximate<float>(context, angleUnit);
|
||||
}
|
||||
@@ -134,4 +138,13 @@ Expression Function::shallowReduce(Context & context, Preferences::AngleUnit ang
|
||||
return *this;
|
||||
}
|
||||
|
||||
Expression Function::replaceReplaceableSymbols(Context & context) {
|
||||
Expression e = context.expressionForSymbol(*this);
|
||||
if (e.isUninitialized()) {
|
||||
return *this;
|
||||
}
|
||||
replaceWithInPlace(e);
|
||||
return e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user