mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] Fix shallowReduce that return Undefined
This commit is contained in:
@@ -65,7 +65,9 @@ Expression BinomialCoefficient::shallowReduce(Context * context) {
|
||||
Expression c1 = childAtIndex(1);
|
||||
|
||||
if (SortedIsMatrix(c0, context) || SortedIsMatrix(c1, context)) {
|
||||
return Undefined::Builder();
|
||||
Expression result = Undefined::Builder();
|
||||
replaceWithInPlace(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (c0.type() == ExpressionNode::Type::Rational) {
|
||||
|
||||
@@ -62,7 +62,9 @@ Expression ConfidenceInterval::shallowReduce(ExpressionNode::ReductionContext re
|
||||
Expression c0 = childAtIndex(0);
|
||||
Expression c1 = childAtIndex(1);
|
||||
if (SortedIsMatrix(c0, reductionContext.context()) || SortedIsMatrix(c1, reductionContext.context())) {
|
||||
return Undefined::Builder();
|
||||
Expression result = Undefined::Builder();
|
||||
replaceWithInPlace(result);
|
||||
return result;
|
||||
}
|
||||
if (c0.type() == ExpressionNode::Type::Rational) {
|
||||
Rational r0 = static_cast<Rational&>(c0);
|
||||
|
||||
@@ -146,7 +146,9 @@ Expression Derivative::shallowReduce(Context * context) {
|
||||
|| SortedIsMatrix(childAtIndex(1), context)
|
||||
|| SortedIsMatrix(childAtIndex(2), context))
|
||||
{
|
||||
return Undefined::Builder();
|
||||
Expression result = Undefined::Builder();
|
||||
replaceWithInPlace(result);
|
||||
return result;
|
||||
}
|
||||
// TODO: to be implemented diff(+) -> +diff() etc
|
||||
return *this;
|
||||
|
||||
@@ -225,7 +225,9 @@ Expression Integral::shallowReduce(Context * context) {
|
||||
|| SortedIsMatrix(childAtIndex(2), context)
|
||||
|| SortedIsMatrix(childAtIndex(3), context))
|
||||
{
|
||||
return Undefined::Builder();
|
||||
Expression result = Undefined::Builder();
|
||||
replaceWithInPlace(result);
|
||||
return result;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user