|
14 | 14 |
|
15 | 15 | def determinant_recursive(matrix: NDArray[float64]) -> float: |
16 | 16 | """ |
17 | | - Calculate the determinant of a square matrix |
| 17 | + Calculate the determinant of a square matrix |
18 | 18 | using recursive cofactor expansion. |
19 | | - This method is suitable for |
| 19 | + This method is suitable for |
20 | 20 | small matrices but becomes inefficient for large matrices. |
21 | 21 | Parameters: |
22 | 22 | matrix (NDArray[float64]): A square matrix |
@@ -62,7 +62,7 @@ def determinant_recursive(matrix: NDArray[float64]) -> float: |
62 | 62 | def determinant_lu(matrix: NDArray[float64]) -> float: |
63 | 63 | """ |
64 | 64 | Calculate the determinant using LU decomposition. |
65 | | - This method is more efficient for larger matrices |
| 65 | + This method is more efficient for larger matrices |
66 | 66 | than recursive expansion. |
67 | 67 | Parameters: |
68 | 68 | matrix (NDArray[float64]): A square matrix |
@@ -119,9 +119,9 @@ def determinant_lu(matrix: NDArray[float64]) -> float: |
119 | 119 |
|
120 | 120 | def determinant(matrix: NDArray[float64]) -> float: |
121 | 121 | """ |
122 | | - Calculate the determinant of a square matrix using |
| 122 | + Calculate the determinant of a square matrix using |
123 | 123 | the most appropriate method. |
124 | | - Uses recursive expansion for small matrices (≤3x3) |
| 124 | + Uses recursive expansion for small matrices (≤3x3) |
125 | 125 | and LU decomposition for larger ones. |
126 | 126 | Parameters: |
127 | 127 | matrix (NDArray[float64]): A square matrix |
|
0 commit comments