Class xlifepp::SortManager#

template<class MagnitudeType>
class SortManager#

Inheritence diagram for xlifepp::SortManager:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="xlifepp::BasicSort< MagnitudeType >" tooltip="xlifepp::BasicSort< MagnitudeType >"] "1" [label="xlifepp::SortManager< MagnitudeType >" tooltip="xlifepp::SortManager< MagnitudeType >" fillcolor="#BFBFBF"] "2" -> "1" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::SortManager:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "1" [label="xlifepp::SortManager< MagnitudeType >" tooltip="xlifepp::SortManager< MagnitudeType >" fillcolor="#BFBFBF"] }

xlifepp’s templated pure virtual class for managing the sorting of approximate eigenvalues computed by the eigensolver.

A concrete implementation of this class is necessary.

Subclassed by xlifepp::BasicSort< MagnitudeType >

Public Functions

inline SortManager()#

Default constructor.

inline SortManager(Parameters &pl)#

Constructor accepting a Parameters. This is the default mode for instantiating a SortManager.

inline virtual ~SortManager()#

Destructor.

virtual void sort(std::vector<MagnitudeType> &evals, SmartPtr<std::vector<int>> perm = _smPtrNull, int n = -1) const = 0#

Sort real eigenvalues, optionally returning the permutation vector.

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.

virtual void sort(std::vector<MagnitudeType> &rEvals, std::vector<MagnitudeType> &iEvals, SmartPtr<std::vector<int>> perm = _smPtrNull, int n = -1) const = 0#

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:
  • rEvals – [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.
  • iEvals – [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 iEvals.
  • n – [in] Number of values in rEvals, iEvals to be sorted. If n == -1, all values will be sorted.