NOX  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
LOCA::EigenvalueSort::AbstractStrategy Class Referenceabstract

Abstract interface for eigenvalue sorting strategies. More...

#include <LOCA_EigenvalueSort_Strategies.H>

Inheritance diagram for LOCA::EigenvalueSort::AbstractStrategy:
Inheritance graph
[legend]

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...
 

Detailed Description

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:

class Derived : public AbstractStrategy {
public:
Derived(
const Teuchos::RCP<LOCA::GlobalData>& global_data,
...
};

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.

Member Function Documentation

virtual NOX::Abstract::Group::ReturnType LOCA::EigenvalueSort::AbstractStrategy::sort ( int  n,
double *  evals,
std::vector< int > *  perm = NULL 
) const
pure virtual

Sort real eigenvalues optionally returning a permutation vector.

Parameters
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).
Returns
Returns the status of the sorting routine

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().

virtual NOX::Abstract::Group::ReturnType LOCA::EigenvalueSort::AbstractStrategy::sort ( int  n,
double *  r_evals,
double *  i_evals = NULL,
std::vector< int > *  perm = NULL 
) const
pure virtual

Sort complex eigenvalues optionally returning a permutation vector.

Parameters
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).
Returns
Returns the status of the sorting routine

Implemented in LOCA::EigenvalueSort::LargestRealInverseCayley, LOCA::EigenvalueSort::SmallestImaginary, LOCA::EigenvalueSort::LargestImaginary, LOCA::EigenvalueSort::SmallestReal, LOCA::EigenvalueSort::LargestReal, LOCA::EigenvalueSort::SmallestMagnitude, and LOCA::EigenvalueSort::LargestMagnitude.


The documentation for this class was generated from the following file: