修复Linuxx下的已知错误
This commit is contained in:
1 parent
d032473687
commit
83e0f4b1dc
1989 files changed
+97764
-101127
No files matched your search
+3
-3
@@ -229,15 +229,15 @@ class Functions
|
||||
* @return Matrix
|
||||
* @throws Exception
|
||||
**/
|
||||
public static function inverse(Matrix $matrix, string $type = 'inverse')
|
||||
public static function inverse(Matrix $matrix)
|
||||
{
|
||||
if (!$matrix->isSquare()) {
|
||||
throw new Exception(ucfirst($type) . ' can only be calculated for a square matrix');
|
||||
throw new Exception('Inverse can only be calculated for a square matrix');
|
||||
}
|
||||
|
||||
$determinant = self::getDeterminant($matrix);
|
||||
if ($determinant == 0.0) {
|
||||
throw new Div0Exception(ucfirst($type) . ' can only be calculated for a matrix with a non-zero determinant');
|
||||
throw new Exception('Inverse can only be calculated for a matrix with a non-zero determinant');
|
||||
}
|
||||
|
||||
if ($matrix->rows == 1) {
|
||||
|
||||
Reference in new issue
Block a user