mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 10:31:29 +08:00
Fix sphinx/build_docs warnings for linear_algebra (#12483)
* Fix sphinx/build_docs warnings for linear_algebra/ * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
"""
|
||||
Gaussian elimination method for solving a system of linear equations.
|
||||
Gaussian elimination - https://en.wikipedia.org/wiki/Gaussian_elimination
|
||||
| Gaussian elimination method for solving a system of linear equations.
|
||||
| Gaussian elimination - https://en.wikipedia.org/wiki/Gaussian_elimination
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
@ -13,12 +13,17 @@ def retroactive_resolution(
|
||||
) -> NDArray[float64]:
|
||||
"""
|
||||
This function performs a retroactive linear system resolution
|
||||
for triangular matrix
|
||||
for triangular matrix
|
||||
|
||||
Examples:
|
||||
2x1 + 2x2 - 1x3 = 5 2x1 + 2x2 = -1
|
||||
0x1 - 2x2 - 1x3 = -7 0x1 - 2x2 = -1
|
||||
0x1 + 0x2 + 5x3 = 15
|
||||
1.
|
||||
* 2x1 + 2x2 - 1x3 = 5
|
||||
* 0x1 - 2x2 - 1x3 = -7
|
||||
* 0x1 + 0x2 + 5x3 = 15
|
||||
2.
|
||||
* 2x1 + 2x2 = -1
|
||||
* 0x1 - 2x2 = -1
|
||||
|
||||
>>> gaussian_elimination([[2, 2, -1], [0, -2, -1], [0, 0, 5]], [[5], [-7], [15]])
|
||||
array([[2.],
|
||||
[2.],
|
||||
@ -45,9 +50,14 @@ def gaussian_elimination(
|
||||
This function performs Gaussian elimination method
|
||||
|
||||
Examples:
|
||||
1x1 - 4x2 - 2x3 = -2 1x1 + 2x2 = 5
|
||||
5x1 + 2x2 - 2x3 = -3 5x1 + 2x2 = 5
|
||||
1x1 - 1x2 + 0x3 = 4
|
||||
1.
|
||||
* 1x1 - 4x2 - 2x3 = -2
|
||||
* 5x1 + 2x2 - 2x3 = -3
|
||||
* 1x1 - 1x2 + 0x3 = 4
|
||||
2.
|
||||
* 1x1 + 2x2 = 5
|
||||
* 5x1 + 2x2 = 5
|
||||
|
||||
>>> gaussian_elimination([[1, -4, -2], [5, 2, -2], [1, -1, 0]], [[-2], [-3], [4]])
|
||||
array([[ 2.3 ],
|
||||
[-1.7 ],
|
||||
|
Reference in New Issue
Block a user