15 parcel::krylov::power
15.1 power (class)
Description Power method. Computes the eigenpair of largest absolute value of ( when set_precon_spectrum(true) is set).
Synopsis
template< class Tspmv = parcel_double, class Tprecon = parcel_double,
class Taxpy = parcel_double, class Tdot = parcel_double >
class power : public eigen_param;Notes There are no class-specific member functions. Of the member functions common to the eigenvalue solvers, only set_precon_spectrum() is used. set_tolerance() applies to the relative change of the eigenvalue, and set_max_iteration() to the number of iterations. The convergence check and breakdowns are described in Convergence by Solver.
15.2 solver()
Description Computes the eigenvalue of largest absolute value and its eigenvector.
Synopsis
template< class Tmat, class Teigen_val, class Teigen_vec, class Tvec = parcel_double,
class Tprecon_mat = parcel_double, class Tprecon_vec = parcel_double >
void solver(parcel::matrix<Tmat> &Mat,
parcel::vector<Teigen_val> &EigenValue, parcel::vector<Teigen_vec> &EigenVec);Arguments
| Name | In/Out | Type | Description | Default |
|---|---|---|---|---|
Mat |
In | parcel::matrix<Tmat> & |
Coefficient matrix | none |
EigenValue |
Out | parcel::vector<Teigen_val> & |
Eigenvalue. At least one element (all elements receive the same value) | none |
EigenVec |
Out | parcel::vector<Teigen_vec> & |
Eigenvector (the locally owned rows). Its number of elements is the number of locally owned rows | none |
Requirements Satisfy the common requirements (an in-order queue, a registered matrix, and the queues and lengths of the vectors). The eigenvalue of largest absolute value is real and separated in absolute value from the eigenvalue of second largest absolute value (not checked; the method does not converge for a complex conjugate pair).
Return Value None.
MPI Collective. All ranks must call it with the same settings.
Notes The initial vector is generated internally from the global row indices, so the input value of EigenVec is not used. The first row of each rank is obtained with MPI_Exscan, so the initial vector does not depend on the row partitioning.
Example
parcel::krylov::power<> pw;
pw.solver(A, lam, v); // lam and v are parcel::vector<>