]> www.ginac.de Git - ginac.git/commitdiff
Simplify overly wonky code in matrix::gauss_elimination().
authorRichard Kreckel <kreckel@ginac.de>
Thu, 29 May 2025 18:56:16 +0000 (20:56 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Thu, 29 May 2025 18:56:16 +0000 (20:56 +0200)
ginac/matrix.cpp

index 650c0c253945a708f7e817ae58bc102f615e3907..e12e9cbc3b41b1055a6aa1b3818b3ca32386f85f 100644 (file)
@@ -1288,9 +1288,7 @@ int matrix::gauss_elimination(const bool det)
                                        // yes, there is something to do in this row
                                        ex piv = this->m[r2*n+c0] / this->m[r0*n+c0];
                                        for (unsigned c=c0+1; c<n; ++c) {
-                                               this->m[r2*n+c] -= piv * this->m[r0*n+c];
-                                               if (!this->m[r2*n+c].info(info_flags::numeric))
-                                                       this->m[r2*n+c] = this->m[r2*n+c].normal();
+                                               this->m[r2*n+c] = (this->m[r2*n+c] - piv * this->m[r0*n+c]).normal();
                                        }
                                }
                                // fill up left hand side with zeros