sfepy.linalg.eigen module

sfepy.linalg.eigen.arpack_eigs(mtx, nev=1, which=’SM’)[source]

Calculate several eigenvalues and corresponding eigenvectors of a matrix using ARPACK from SciPy. The eigenvalues are sorted in ascending order.

sfepy.linalg.eigen.cg_eigs(mtx, rhs=None, precond=None, i_max=None, eps_r=1e-10, shift=None, select_indices=None, verbose=False, report_step=10)[source]

Make several iterations of the conjugate gradients and estimate so the eigenvalues of a (sparse SPD) matrix (Lanczos algorithm).

Parameters:
mtx : spmatrix or array

The sparse matrix A.

precond : spmatrix or array, optional

The preconditioner matrix. Any object that can be multiplied by vector can be passed.

i_max : int

The maximum number of the Lanczos algorithm iterations.

eps_r : float

The relative stopping tolerance.

shift : float, optional

Eigenvalue shift for non-SPD matrices. If negative, the shift is computed as |shift| ||A||_{\infty}.

select_indices : (min, max), optional

If given, computed only the eigenvalues with indices min <= i <= max.

verbose : bool

Verbosity control.

report_step : int

If verbose is True, report in every report_step-th step.

Returns:
vec : array

The approximate solution to the linear system.

n_it : int

The number of CG iterations used.

norm_rs : array

Convergence history of residual norms.

eigs : array

The approximate eigenvalues sorted in ascending order.

sfepy.linalg.eigen.sym_tri_eigen(diags, select_indices=None)[source]

Compute eigenvalues of a symmetric tridiagonal matrix using scipy.linalg.eigvals_banded().