LOCA::EigenvalueSort::AbstractStrategy Class Reference

Abstract interface for eigenvalue sorting strategies. More...

#include <LOCA_EigenvalueSort_Strategies.H>

Inheritance diagram for LOCA::EigenvalueSort::AbstractStrategy:

[legend]
List of all members.

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

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::RefCountPtr<LOCA::GlobalData>& global_data,
      const Teuchos::RefCountPtr<NOX::Parameter::List>& eigenParams);
   ...
 };

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 *  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::LargestMagnitude, LOCA::EigenvalueSort::SmallestMagnitude, LOCA::EigenvalueSort::LargestReal, LOCA::EigenvalueSort::SmallestReal, LOCA::EigenvalueSort::LargestImaginary, LOCA::EigenvalueSort::SmallestImaginary, and LOCA::EigenvalueSort::LargestRealInverseCayley.

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::LargestMagnitude, LOCA::EigenvalueSort::SmallestMagnitude, LOCA::EigenvalueSort::LargestReal, LOCA::EigenvalueSort::SmallestReal, LOCA::EigenvalueSort::LargestImaginary, LOCA::EigenvalueSort::SmallestImaginary, and LOCA::EigenvalueSort::LargestRealInverseCayley.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:40:44 2008 for NOX by doxygen 1.3.9.1