mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
d2afa4cc8b
commit
7977b61135
|
@ -3,20 +3,20 @@ import numpy as np
|
|||
|
||||
def lanczos(a: np.ndarray) -> tuple[list[float], list[float]]:
|
||||
"""
|
||||
Implements the Lanczos algorithm for a symmetric matrix.
|
||||
Implements the Lanczos algorithm for a symmetric matrix.
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
matrix : numpy.ndarray
|
||||
Symmetric matrix of size (n, n).
|
||||
Parameters:
|
||||
-----------
|
||||
matrix : numpy.ndarray
|
||||
Symmetric matrix of size (n, n).
|
||||
|
||||
Returns:
|
||||
--------
|
||||
alpha : [float]
|
||||
List of diagonal elements of the resulting tridiagonal matrix.
|
||||
beta : [float]
|
||||
List of off-diagonal elements of the resulting tridiagonal matrix.
|
||||
"""
|
||||
Returns:
|
||||
--------
|
||||
alpha : [float]
|
||||
List of diagonal elements of the resulting tridiagonal matrix.
|
||||
beta : [float]
|
||||
List of off-diagonal elements of the resulting tridiagonal matrix.
|
||||
"""
|
||||
n = a.shape[0]
|
||||
v = np.zeros((n, n))
|
||||
rng = np.random.default_rng()
|
||||
|
|
Loading…
Reference in New Issue
Block a user