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:
Maxim Smolskiy
2024-12-30 00:35:34 +03:00
committed by GitHub
parent 3622e940c9
commit 94b3777936
6 changed files with 54 additions and 34 deletions

View File

@ -6,17 +6,18 @@ def solve_linear_system(matrix: np.ndarray) -> np.ndarray:
Solve a linear system of equations using Gaussian elimination with partial pivoting
Args:
- matrix: Coefficient matrix with the last column representing the constants.
- `matrix`: Coefficient matrix with the last column representing the constants.
Returns:
- Solution vector.
- Solution vector.
Raises:
- ValueError: If the matrix is not correct (i.e., singular).
- ``ValueError``: If the matrix is not correct (i.e., singular).
https://courses.engr.illinois.edu/cs357/su2013/lect.htm Lecture 7
Example:
>>> A = np.array([[2, 1, -1], [-3, -1, 2], [-2, 1, 2]], dtype=float)
>>> B = np.array([8, -11, -3], dtype=float)
>>> solution = solve_linear_system(np.column_stack((A, B)))