File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 3
3
4
4
def lanczos (a : np .ndarray ) -> tuple [list [float ], list [float ]]:
5
5
"""
6
- Implements the Lanczos algorithm for a symmetric matrix.
6
+ Implements the Lanczos algorithm for a symmetric matrix.
7
7
8
- Parameters:
9
- -----------
10
- matrix : numpy.ndarray
11
- Symmetric matrix of size (n, n).
8
+ Parameters:
9
+ -----------
10
+ matrix : numpy.ndarray
11
+ Symmetric matrix of size (n, n).
12
12
13
- Returns:
14
- --------
15
- alpha : [float]
16
- List of diagonal elements of the resulting tridiagonal matrix.
17
- beta : [float]
18
- List of off-diagonal elements of the resulting tridiagonal matrix.
19
- """
13
+ Returns:
14
+ --------
15
+ alpha : [float]
16
+ List of diagonal elements of the resulting tridiagonal matrix.
17
+ beta : [float]
18
+ List of off-diagonal elements of the resulting tridiagonal matrix.
19
+ """
20
20
n = a .shape [0 ]
21
21
v = np .zeros ((n , n ))
22
22
rng = np .random .default_rng ()
You can’t perform that action at this time.
0 commit comments