Skip to content
mrcdr edited this page Oct 12, 2019 · 6 revisions

Detailed specs

Details of LambdaLanzcos class

Constructors

  1. LambdaLanczos<T>(function<void (const vector<T>& in, vector<T>& out)> mv_mul, int matrix_size)
  2. 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>.

Member variables

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.

real_t<T> eigenvalue_offset

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

int max_iteration

It controls the limit of Lanczos iteration count.

  • Default value : matrix_size

real_t<T> eps

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

std::function<void(vector<T>&)> init_vector

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.

(Not necessary to change) real_t<T> tridiag_eps_ratio

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

(Not necessary to change) int initial_vector_size

It controls the initial size of Lanczos vectors.

  • Default value : 200
Clone this wiki locally