Skip to content

Commit 04b99d9

Browse files
quant12345sedatguzelsemme
authored andcommitted
Gaussian_elemination - change to remove warning (TheAlgorithms#10221)
* Replacing the generator with numpy vector operations from lu_decomposition. * Revert "Replacing the generator with numpy vector operations from lu_decomposition." This reverts commit ad217c6. * Removes the warning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation
1 parent efc37fd commit 04b99d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: arithmetic_analysis/gaussian_elimination.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def retroactive_resolution(
3434
x: NDArray[float64] = np.zeros((rows, 1), dtype=float)
3535
for row in reversed(range(rows)):
3636
total = np.dot(coefficients[row, row + 1 :], x[row + 1 :])
37-
x[row, 0] = (vector[row] - total) / coefficients[row, row]
37+
x[row, 0] = (vector[row][0] - total[0]) / coefficients[row, row]
3838

3939
return x
4040

0 commit comments

Comments
 (0)