mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
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:
parent
59fc0cefef
commit
0b440285e8
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user