mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare] Fix ExpressionNode::shallowReplaceReplaceableSymbols
This commit is contained in:
@@ -30,7 +30,7 @@ void StorageExpressionModel::text(char * buffer, size_t bufferSize) const {
|
||||
|
||||
bool StorageExpressionModel::isCircularlyDefined(Poincare::Context * context) const {
|
||||
if (m_circular == -1) {
|
||||
m_circular = Expression::ExpressionWithoutSymbols(expressionReduced(context), *context).isUninitialized();
|
||||
m_circular = Expression::ExpressionWithoutSymbols(expressionClone(), *context).isUninitialized();
|
||||
}
|
||||
return m_circular;
|
||||
}
|
||||
|
||||
@@ -247,7 +247,6 @@ protected:
|
||||
int getPolynomialCoefficients(Context & context, const char * symbolName, Expression coefficients[]) const { return node()->getPolynomialCoefficients(context, symbolName, coefficients); }
|
||||
bool hasReplaceableSymbols(Context & context) const;
|
||||
Expression shallowReplaceReplaceableSymbols(Context & context) { return node()->shallowReplaceReplaceableSymbols(context); }
|
||||
Expression defaultReplaceReplaceableSymbols(Context & context);
|
||||
|
||||
/* Simplification */
|
||||
Expression denominator(Context & context, Preferences::AngleUnit angleUnit) const { return node()->denominator(context, angleUnit); }
|
||||
|
||||
@@ -238,14 +238,6 @@ bool Expression::hasReplaceableSymbols(Context & context) const {
|
||||
}, context, false);
|
||||
}
|
||||
|
||||
Expression Expression::defaultReplaceReplaceableSymbols(Context & context) {
|
||||
int nbChildren = numberOfChildren();
|
||||
for (int i = 0; i < nbChildren; i++) {
|
||||
childAtIndex(i).shallowReplaceReplaceableSymbols(context);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
Evaluation<U> Expression::approximateToEvaluation(Context& context, Preferences::AngleUnit angleUnit) const {
|
||||
return node()->approximate(U(), context, angleUnit);
|
||||
|
||||
@@ -28,7 +28,7 @@ int ExpressionNode::getPolynomialCoefficients(Context & context, const char * sy
|
||||
}
|
||||
|
||||
Expression ExpressionNode::shallowReplaceReplaceableSymbols(Context & context) {
|
||||
return Expression(this).defaultReplaceReplaceableSymbols(context);
|
||||
return Expression(this);
|
||||
}
|
||||
|
||||
int ExpressionNode::getVariables(Context & context, isVariableTest isVariable, char * variables, int maxSizeVariable) const {
|
||||
|
||||
Reference in New Issue
Block a user