mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[poincare/matrix_inverse] Remove duplicate check if matrix is square
Also done in Matrix::createInverse
This commit is contained in:
@@ -51,14 +51,10 @@ Expression MatrixInverse::shallowReduce(ExpressionNode::ReductionContext reducti
|
||||
}
|
||||
Expression c = childAtIndex(0);
|
||||
if (c.type() == ExpressionNode::Type::Matrix) {
|
||||
Matrix matrixChild = static_cast<Matrix&>(c);
|
||||
if (matrixChild.numberOfRows() != matrixChild.numberOfColumns()) {
|
||||
return replaceWithUndefinedInPlace();
|
||||
}
|
||||
/* Power(matrix, -n) creates a matrixInverse, so the simplification must be
|
||||
* done here and not in power. */
|
||||
bool couldComputeInverse = false;
|
||||
Expression result = matrixChild.createInverse(reductionContext, &couldComputeInverse);
|
||||
Expression result = static_cast<Matrix&>(c).createInverse(reductionContext, &couldComputeInverse);
|
||||
if (couldComputeInverse) {
|
||||
replaceWithInPlace(result);
|
||||
return result.shallowReduce(reductionContext);
|
||||
|
||||
Reference in New Issue
Block a user