NOX
Development
|
Abstract interface for eigenvalue sorting strategies. More...
#include <LOCA_EigenvalueSort_Strategies.H>
Public Member Functions | |
AbstractStrategy () | |
Constructor. | |
virtual | ~AbstractStrategy () |
Destructor. | |
virtual NOX::Abstract::Group::ReturnType | sort (int n, double *evals, std::vector< int > *perm=NULL) const =0 |
Sort real eigenvalues optionally returning a permutation vector. More... | |
virtual NOX::Abstract::Group::ReturnType | sort (int n, double *r_evals, double *i_evals=NULL, std::vector< int > *perm=NULL) const =0 |
Sort complex eigenvalues optionally returning a permutation vector. More... | |
Abstract interface for eigenvalue sorting strategies.
AbstractStrategy defines an abstract interface for sorting eigenvalues. It is used by LOCA::Eigensolver strategies to ensure the desired eigenvalues are printed/saved.
The interface defines two pure virtual methods, sort(), to sort the eigenvalues, optionally returning a permutation vector determining how th eigenvalues were sorted. There is one version for real-only eigenvalues and one version for complex. Derived classes should implement these methods for a particular sorting strategy. Constructors for derived classes should be of the form:
where global_data
is the LOCA global data object and eigenParams
is the eigensolver parameter list (see LOCA::Eigensolver::AbstractStrategy). In addition to any parameters for the chosen sorting method, this list should contain the parameter "Sorting Order" giving the name of the sorting strategy.
This class and its children follow the Strategy pattern as defined in Erich Gamma, et al. "Design Patterns: Elements of Reusable Object-Oriented Software." Addison Wesley, Boston, MA, 1995.
|
pure virtual |
Sort real eigenvalues optionally returning a permutation vector.
n | [in] Number of eigenvalues |
evals | [in/out] Array of length n containing the eigenvalues to be sorted. |
perm | [out] Vector of length n to store the permutation (optional). |
Implemented in LOCA::EigenvalueSort::LargestRealInverseCayley, LOCA::EigenvalueSort::SmallestImaginary, LOCA::EigenvalueSort::LargestImaginary, LOCA::EigenvalueSort::SmallestReal, LOCA::EigenvalueSort::LargestReal, LOCA::EigenvalueSort::SmallestMagnitude, and LOCA::EigenvalueSort::LargestMagnitude.
Referenced by LOCA::Eigensolver::DGGEVStrategy::computeEigenvalues().
|
pure virtual |
Sort complex eigenvalues optionally returning a permutation vector.
n | [in] Number of eigenvalues |
r_evals | [in/out] Array of length n containing the real part of the eigenvalues to be sorted. |
i_evals | [in/out] Array of length n containing the imaginary part of the eigenvalues to be sorted. |
perm | [out] Vector of length n to store the permutation (optional). |
Implemented in LOCA::EigenvalueSort::LargestRealInverseCayley, LOCA::EigenvalueSort::SmallestImaginary, LOCA::EigenvalueSort::LargestImaginary, LOCA::EigenvalueSort::SmallestReal, LOCA::EigenvalueSort::LargestReal, LOCA::EigenvalueSort::SmallestMagnitude, and LOCA::EigenvalueSort::LargestMagnitude.