Gaussian_elemination - change to remove warning (#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 ad217c6616.

* 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
This commit is contained in:
Kamil 2023-10-10 19:24:51 +05:00 committed by GitHub
parent 59fc0cefef
commit 0b440285e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ def retroactive_resolution(
x: NDArray[float64] = np.zeros((rows, 1), dtype=float) x: NDArray[float64] = np.zeros((rows, 1), dtype=float)
for row in reversed(range(rows)): for row in reversed(range(rows)):
total = np.dot(coefficients[row, row + 1 :], x[row + 1 :]) 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 return x