Skip to content

Commit

Permalink
Gaussian_elemination - change to remove warning (#10221)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
quant12345 authored Oct 10, 2023
1 parent 59fc0ce commit 0b44028
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arithmetic_analysis/gaussian_elimination.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def retroactive_resolution(
x: NDArray[float64] = np.zeros((rows, 1), dtype=float)
for row in reversed(range(rows)):
total = np.dot(coefficients[row, row + 1 :], x[row + 1 :])
x[row, 0] = (vector[row] - total) / coefficients[row, row]
x[row, 0] = (vector[row][0] - total[0]) / coefficients[row, row]

return x

Expand Down

0 comments on commit 0b44028

Please sign in to comment.