File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 33
44def lanczos (a : np .ndarray ) -> tuple [list [float ], list [float ]]:
55 """
6- Implements the Lanczos algorithm for a symmetric matrix.
6+ Implements the Lanczos algorithm for a symmetric matrix.
77
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).
1212
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+ """
2020 n = a .shape [0 ]
2121 v = np .zeros ((n , n ))
2222 rng = np .random .default_rng ()
You can’t perform that action at this time.
0 commit comments