Anasazi::BasicSort< MagnitudeType > Class Template Reference

An implementation of the Anasazi::SortManager that performs a collection of common sorting techniques. More...

#include <AnasaziBasicSort.hpp>

Inheritance diagram for Anasazi::BasicSort< MagnitudeType >:

Inheritance graph
[legend]
Collaboration diagram for Anasazi::BasicSort< MagnitudeType >:

Collaboration graph
[legend]

List of all members.

Classes

struct  compAlg
struct  compMag
struct  compMag2
struct  sel1st
struct  sel2nd

Public Member Functions

 BasicSort (Teuchos::ParameterList &pl)
 Parameter list driven constructor.
 BasicSort (const std::string &which="LM")
 String driven constructor.
virtual ~BasicSort ()
 Destructor.
void setSortType (const std::string &which)
 Set sort type.
void sort (std::vector< MagnitudeType > &evals, Teuchos::RCP< std::vector< int > > perm=Teuchos::null, int n=-1) const
 Sort real eigenvalues, optionally returning the permutation vector.
void sort (std::vector< MagnitudeType > &r_evals, std::vector< MagnitudeType > &i_evals, Teuchos::RCP< std::vector< int > > perm=Teuchos::null, int n=-1) const
 Sort complex eigenvalues, optionally returning the permutation vector.

Protected Types

enum  SType {
  LM, SM, LR, SR,
  LI, SI
}

Protected Attributes

SType which_


Detailed Description

template<class MagnitudeType>
class Anasazi::BasicSort< MagnitudeType >

An implementation of the Anasazi::SortManager that performs a collection of common sorting techniques.

Author:
Chris Baker, Ulrich Hetmaniuk, Rich Lehoucq, and Heidi Thornquist

Definition at line 52 of file AnasaziBasicSort.hpp.


Member Enumeration Documentation

template<class MagnitudeType >
enum Anasazi::BasicSort::SType [protected]

Enumerator:
LM 
SM 
LR 
SR 
LI 
SI 

Definition at line 126 of file AnasaziBasicSort.hpp.


Constructor & Destructor Documentation

template<class MagnitudeType >
Anasazi::BasicSort< MagnitudeType >::BasicSort ( Teuchos::ParameterList pl  )  [inline]

Parameter list driven constructor.

This constructor accepts a paramter list with the following options:

  • "Sort Strategy" - a string specifying the desired sorting strategy. See setSortType() for valid options.

Definition at line 179 of file AnasaziBasicSort.hpp.

template<class MagnitudeType >
Anasazi::BasicSort< MagnitudeType >::BasicSort ( const std::string &  which = "LM"  )  [inline]

String driven constructor.

Directly pass the string specifying sort strategy. See setSortType() for valid options.

Definition at line 187 of file AnasaziBasicSort.hpp.

template<class MagnitudeType >
Anasazi::BasicSort< MagnitudeType >::~BasicSort (  )  [inline, virtual]

Destructor.

Definition at line 193 of file AnasaziBasicSort.hpp.


Member Function Documentation

template<class MagnitudeType >
void Anasazi::BasicSort< MagnitudeType >::setSortType ( const std::string &  which  )  [inline]

Set sort type.

Parameters:
which [in] The eigenvalues of interest for this eigenproblem.
  • "LM" - Largest Magnitude [ default ]
  • "SM" - Smallest Magnitude
  • "LR" - Largest Real
  • "SR" - Smallest Real
  • "LI" - Largest Imaginary
  • "SI" - Smallest Imaginary

Definition at line 197 of file AnasaziBasicSort.hpp.

template<class MagnitudeType >
void Anasazi::BasicSort< MagnitudeType >::sort ( std::vector< MagnitudeType > &  r_evals,
std::vector< MagnitudeType > &  i_evals,
Teuchos::RCP< std::vector< int > >  perm = Teuchos::null,
int  n = -1 
) const [inline, virtual]

Sort complex eigenvalues, optionally returning the permutation vector.

This routine takes two vectors, one for each part of a complex eigenvalue. This is helpful for solving real, non-symmetric eigenvalue problems.

Parameters:
r_evals [in/out] Vector of length at least n containing the real part of the eigenvalues to be sorted.
On output, the first n eigenvalues will be sorted. The rest will be unchanged.
i_evals [in/out] Vector of length at least n containing the imaginary part of the eigenvalues to be sorted.
On output, the first n eigenvalues will be sorted. The rest will be unchanged.
perm [out] Vector of length at least n to store the permutation index (optional).
If specified, on output the first n eigenvalues will contain the permutation indices, in the range [0,n-1], such that r_evals_out[i] = r_evals_in[perm[i]] and similarly for i_evals.
n [in] Number of values in r_evals, i_evals to be sorted. If n == -1, all values will be sorted, as decided by the minimum of the length of r_evals and the length of i_evals.

Implements Anasazi::SortManager< MagnitudeType >.

Definition at line 316 of file AnasaziBasicSort.hpp.

template<class MagnitudeType >
void Anasazi::BasicSort< MagnitudeType >::sort ( std::vector< MagnitudeType > &  evals,
Teuchos::RCP< std::vector< int > >  perm = Teuchos::null,
int  n = -1 
) const [inline, virtual]

Sort real eigenvalues, optionally returning the permutation vector.

Note:
This method is not valid when the sort manager is configured for "LI" or "SI" sorting (i.e., sorting by the imaginary components). Calling this method in that scenario will result in a SortManagerError exception.
Parameters:
evals [in/out] Vector of length at least n containing the eigenvalues to be sorted.
On output, the first n eigenvalues will be sorted. The rest will be unchanged.
perm [out] Vector of length at least n to store the permutation index (optional).
If specified, on output the first n eigenvalues will contain the permutation indices, in the range [0,n-1], such that evals_out[i] = evals_in[perm[i]]
n [in] Number of values in evals to be sorted. If n == -1, all values will be sorted.

Implements Anasazi::SortManager< MagnitudeType >.

Definition at line 226 of file AnasaziBasicSort.hpp.


Member Data Documentation

template<class MagnitudeType >
SType Anasazi::BasicSort< MagnitudeType >::which_ [protected]

Definition at line 131 of file AnasaziBasicSort.hpp.


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

Generated on Thu Dec 17 11:02:22 2009 for Anasazi by  doxygen 1.5.9