#include <AnasaziSolverUtils.hpp>
Public Types | |
typedef Teuchos::ScalarTraits < ScalarType >::magnitudeType | MagnitudeType |
typedef Teuchos::ScalarTraits < ScalarType > | SCT |
Public Member Functions | |
Constructor/Destructor | |
SolverUtils () | |
Constructor. | |
virtual | ~SolverUtils () |
Destructor. | |
Static Public Member Functions | |
Sorting Methods | |
static void | permuteVectors (const int n, const std::vector< int > &perm, MV &Q, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > *resids=0) |
Permute the vectors in a multivector according to the permutation vector perm , and optionally the residual vector resids . | |
static void | permuteVectors (const std::vector< int > &perm, Teuchos::SerialDenseMatrix< int, ScalarType > &Q) |
Permute the columns of a Teuchos::SerialDenseMatrix according to the permutation vector perm . | |
Basis update methods | |
static void | applyHouse (int k, MV &V, const Teuchos::SerialDenseMatrix< int, ScalarType > &H, const std::vector< ScalarType > &tau, Teuchos::RCP< MV > workMV=Teuchos::null) |
Apply a sequence of Householder reflectors (from GEQRF ) to a multivector, using minimal workspace. | |
Eigensolver Projection Methods | |
static int | directSolver (int size, const Teuchos::SerialDenseMatrix< int, ScalarType > &KK, Teuchos::RCP< const Teuchos::SerialDenseMatrix< int, ScalarType > > MM, Teuchos::SerialDenseMatrix< int, ScalarType > &EV, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &theta, int &nev, int esType=0) |
Routine for computing the first NEV generalized eigenpairs of the Hermitian pencil (KK, MM) . | |
Sanity Checking Methods | |
static Teuchos::ScalarTraits < ScalarType >::magnitudeType | errorEquality (const MV &X, const MV &MX, Teuchos::RCP< const OP > M=Teuchos::null) |
Return the maximum coefficient of the matrix ![]() MX . |
This class provides concrete, templated implementations of utilities necessary for the solvers. These utilities include sorting, orthogonalization, projecting/solving local eigensystems, and sanity checking. These are internal utilties, so the user should not alter this class.
Definition at line 61 of file AnasaziSolverUtils.hpp.
typedef Teuchos::ScalarTraits<ScalarType>::magnitudeType Anasazi::SolverUtils< ScalarType, MV, OP >::MagnitudeType |
Definition at line 64 of file AnasaziSolverUtils.hpp.
typedef Teuchos::ScalarTraits<ScalarType> Anasazi::SolverUtils< ScalarType, MV, OP >::SCT |
Definition at line 65 of file AnasaziSolverUtils.hpp.
Anasazi::SolverUtils< ScalarType, MV, OP >::SolverUtils | ( | ) | [inline] |
virtual Anasazi::SolverUtils< ScalarType, MV, OP >::~SolverUtils | ( | ) | [inline, virtual] |
void Anasazi::SolverUtils< ScalarType, MV, OP >::applyHouse | ( | int | k, | |
MV & | V, | |||
const Teuchos::SerialDenseMatrix< int, ScalarType > & | H, | |||
const std::vector< ScalarType > & | tau, | |||
Teuchos::RCP< MV > | workMV = Teuchos::null | |||
) | [inline, static] |
Apply a sequence of Householder reflectors (from GEQRF
) to a multivector, using minimal workspace.
k | [in] the number of Householder reflectors composing the product | |
V | [in/out] the multivector to be modified, with ![]() | |
H | [in] a ![]() GEQRF (see below) | |
tau | [in] the ![]() GEQRF | |
workMV | [work] (optional) a multivector used for workspace. it need contain only a single vector; it if contains more, only the first vector will be modified. |
Each (
) has the form
where is a scalar and
is a vector with
and
;
is stored below
H(i,i)
and in
tau[i-1]
. (Note: zero-based indexing used for data structures H
and tau
, while one-based indexing used for mathematic object ).
If the multivector is and we apply
Householder reflectors, the total cost of the method is
flops. For
, this becomes
, the same as for a matrix-matrix multiplication by the accumulated Householder reflectors.
Definition at line 287 of file AnasaziSolverUtils.hpp.
int Anasazi::SolverUtils< ScalarType, MV, OP >::directSolver | ( | int | size, | |
const Teuchos::SerialDenseMatrix< int, ScalarType > & | KK, | |||
Teuchos::RCP< const Teuchos::SerialDenseMatrix< int, ScalarType > > | MM, | |||
Teuchos::SerialDenseMatrix< int, ScalarType > & | EV, | |||
std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > & | theta, | |||
int & | nev, | |||
int | esType = 0 | |||
) | [inline, static] |
Routine for computing the first NEV generalized eigenpairs of the Hermitian pencil (KK, MM)
.
size | [in] Dimension of the eigenproblem (KK, MM) | |
KK | [in] Hermitian "stiffness" matrix | |
MM | [in] Hermitian positive-definite "mass" matrix | |
EV | [in] Dense matrix to store the nev eigenvectors | |
theta | [in] Array to store the eigenvalues (Size = nev ) | |
nev | [in/out] Number of the smallest eigenvalues requested (in) / computed (out) | |
esType | [in] Flag to select the algorithm
|
info
on the status of the computation Return the integer info on the status of the computation Definition at line 356 of file AnasaziSolverUtils.hpp.
Teuchos::ScalarTraits< ScalarType >::magnitudeType Anasazi::SolverUtils< ScalarType, MV, OP >::errorEquality | ( | const MV & | X, | |
const MV & | MX, | |||
Teuchos::RCP< const OP > | M = Teuchos::null | |||
) | [inline, static] |
Return the maximum coefficient of the matrix scaled by the maximum coefficient of
MX
.
M
is not specified, the identity is used. Definition at line 635 of file AnasaziSolverUtils.hpp.
void Anasazi::SolverUtils< ScalarType, MV, OP >::permuteVectors | ( | const std::vector< int > & | perm, | |
Teuchos::SerialDenseMatrix< int, ScalarType > & | Q | |||
) | [inline, static] |
Permute the columns of a Teuchos::SerialDenseMatrix according to the permutation vector perm
.
Definition at line 259 of file AnasaziSolverUtils.hpp.
void Anasazi::SolverUtils< ScalarType, MV, OP >::permuteVectors | ( | const int | n, | |
const std::vector< int > & | perm, | |||
MV & | Q, | |||
std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > * | resids = 0 | |||
) | [inline, static] |
Permute the vectors in a multivector according to the permutation vector perm
, and optionally the residual vector resids
.
Definition at line 195 of file AnasaziSolverUtils.hpp.