[poincare] Add complex format as an argument of simplification

This commit is contained in:
Émilie Feral
2018-12-21 16:18:15 +01:00
committed by Léa Saviot
parent 1f247b731d
commit 26e2e9be0d
136 changed files with 943 additions and 908 deletions

View File

@@ -62,8 +62,8 @@ int FunctionNode::serialize(char * buffer, int bufferSize, Preferences::PrintFlo
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, name());
}
Expression FunctionNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, ReductionTarget target) {
return Function(this).shallowReduce(context, angleUnit, target); // This uses Symbol::shallowReduce
Expression FunctionNode::shallowReduce(Context & context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit, ReductionTarget target) {
return Function(this).shallowReduce(context, complexFormat, angleUnit, target); // This uses Symbol::shallowReduce
}
Expression FunctionNode::shallowReplaceReplaceableSymbols(Context & context) {
@@ -113,12 +113,12 @@ Expression Function::replaceSymbolWithExpression(const SymbolAbstract & symbol,
return *this;
}
Expression Function::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, ExpressionNode::ReductionTarget target) {
Expression Function::shallowReduce(Context & context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit, ExpressionNode::ReductionTarget target) {
Function f(*this);
Expression e = SymbolAbstract::Expand(f, context, true);
if (!e.isUninitialized()) {
replaceWithInPlace(e);
return e.deepReduce(context, angleUnit, target);
return e.deepReduce(context, complexFormat, angleUnit, target);
}
return *this;
}