mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[poincare] Enable interrupting some methods in Simplify that are called
recursively Change-Id: I5b8c0de51617a3a36b3c8bc673de66dc60e74483
This commit is contained in:
@@ -168,9 +168,15 @@ bool Expression::IsMatrix(const Expression * e) {
|
||||
int Expression::SimplificationOrder(const Expression * e1, const Expression * e2) {
|
||||
if (e1->type() > e2->type()) {
|
||||
return -(e2->simplificationOrderGreaterType(e1));
|
||||
if (shouldStopProcessing()) {
|
||||
return 1;
|
||||
}
|
||||
} else if (e1->type() == e2->type()) {
|
||||
return e1->simplificationOrderSameType(e2);
|
||||
} else {
|
||||
if (shouldStopProcessing()) {
|
||||
return -1;
|
||||
}
|
||||
return e1->simplificationOrderGreaterType(e2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ Expression * Power::clone() const {
|
||||
}
|
||||
|
||||
Expression::Sign Power::sign() const {
|
||||
if (shouldStopProcessing()) {
|
||||
return Sign::Unknown;
|
||||
}
|
||||
if (operand(0)->sign() == Sign::Positive && operand(1)->sign() != Sign::Unknown) {
|
||||
return Sign::Positive;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user