getSymmetricSortRule

C++ Function Reference

1 Signature

Spectra::SortRule BigDataStatMeth::getSymmetricSortRule(const std::string &which)

2 Description

Convert ‘which’ string to Spectra SortRule for symmetric matrices.

3 Parameters

  • which (const std::string &): String indicating which eigenvalues to compute

4 Returns

Corresponding Spectra SortRule for symmetric eigenproblems

5 Details

whichString indicating which eigenvalues to compute Corresponding Spectra SortRule for symmetric eigenproblems

6 Caller Graph

Function dependencies

7 Source Code

File: inst/include/hdf5Algebra/matrixEigenDecomposition.hppLines 40-47

inline Spectra::SortRule getSymmetricSortRule(const std::string& which) {
        if (which == "LA") return Spectra::SortRule::LargestAlge;
        if (which == "SA") return Spectra::SortRule::SmallestAlge;
        if (which == "LM") return Spectra::SortRule::LargestMagn;
        if (which == "SM") return Spectra::SortRule::SmallestMagn;
        // Default to largest magnitude for symmetric matrices
        return Spectra::SortRule::LargestMagn;
    }

8 Usage Example

#include "BigDataStatMeth.hpp"

// Example usage
auto result = getSymmetricSortRule(...);