-
Notifications
You must be signed in to change notification settings - Fork 3
Home
LambdaLanczos<T>(function<void (const vector<T>& in, vector<T>& out)> mv_mul, int matrix_size)
LambdaLanczos<T>(function<void (const vector<T>& in, vector<T>& out)> mv_mul, int matrix_size, bool find_maximum)
The first one is equivalent to LambdaLanczos<T>(mv_mul, matrix_size, false)
, means to calculate the smallest eigenvalue.
The type T
should be double
, complex<double>
, float
, complex<float>
, long double
or complex<long double>
.
In the following description, real_t<T>
means the real counterpart of T
,
i.e. real_t<double>
is double
and real_t<complex<double>>
is double
.
It shifts the eigenvalues of the given matrix A, i.e.
the algorithm will calculate the eigenvalue of matrix (A+eigenvalue_offset
*E), here E
is the identity matrix. The result eigenvalue from run()
will take this shifting
into account, so you don't have to "reshift" the result with eigenvalue_offset
.
To know the reason why eigenvalue_offset
is needed and how to set it correctly, see
here.
- Default value : 0.0
It controls the limit of Lanczos iteration count.
- Default value : matrix_size
It is the convergence threshold of Lanczos iteration.
"eps
= 1e-12" means the eigenvalue will be calculated with 12 digits of precision.
-
Default value : system-dependent; On usual systems,
type (including complex one) size (system-dep.) eps
float 4 bytes 1e-4 double 8 bytes 1e-12 long double 16 bytes 1e-19
It is the function used to initialize the first Lanczos vector. After this function called, the initial Lanczos vector will be normalized.
- Default value : a function to initialize a vector randomly in the range of [-1, 1]. For a complex vector, both real and imaginary part of each element will be initialized in the range.
It controls the the convergence threshold of the "bisection routine" in the Lanczos algorithm, which finds the eigenvalue of an approximated tridiagonal matrix.
- Default value : 1e-1
It controls the initial size of Lanczos vectors.
- Default value : 200