Spectra  1.0.1
Header-only C++ Library for Large Scale Eigenvalue Problems
Spectra::SymShiftInvert< Scalar_, TypeA, TypeB, UploA, UploB, FlagsA, FlagsB, StorageIndexA, StorageIndexB > Class Template Reference

#include <Spectra/MatOp/SymShiftInvert.h>

Public Types

using Scalar = Scalar_
 

Public Member Functions

template<typename DerivedA , typename DerivedB >
 SymShiftInvert (const Eigen::EigenBase< DerivedA > &A, const Eigen::EigenBase< DerivedB > &B)
 
Index rows () const
 
Index cols () const
 
void set_shift (const Scalar &sigma)
 
void perform_op (const Scalar *x_in, Scalar *y_out) const
 

Detailed Description

template<typename Scalar_, typename TypeA = Eigen::Sparse, typename TypeB = Eigen::Sparse, int UploA = Eigen::Lower, int UploB = Eigen::Lower, int FlagsA = Eigen::ColMajor, int FlagsB = Eigen::ColMajor, typename StorageIndexA = int, typename StorageIndexB = int>
class Spectra::SymShiftInvert< Scalar_, TypeA, TypeB, UploA, UploB, FlagsA, FlagsB, StorageIndexA, StorageIndexB >

This class defines matrix operations required by the generalized eigen solver in the shift-and-invert mode. Given two symmetric matrices \(A\) and \(B\), it solves the linear equation \(y=(A-\sigma B)^{-1}x\), where \(\sigma\) is a real shift. Each of \(A\) and \(B\) can be a dense or sparse matrix.

This class is intended to be used with the SymGEigsShiftSolver generalized eigen solver.

Template Parameters
Scalar_The element type of the matrices. Currently supported types are float, double, and long double.
TypeAThe type of the \(A\) matrix, indicating whether \(A\) is dense or sparse. Possible values are Eigen::Dense and Eigen::Sparse.
TypeBThe type of the \(B\) matrix, indicating whether \(B\) is dense or sparse. Possible values are Eigen::Dense and Eigen::Sparse.
UploAWhether the lower or upper triangular part of \(A\) should be used. Possible values are Eigen::Lower and Eigen::Upper.
UploBWhether the lower or upper triangular part of \(B\) should be used. Possible values are Eigen::Lower and Eigen::Upper.
FlagsAAdditional flags for the matrix class of \(A\). Possible values are Eigen::ColMajor and Eigen::RowMajor.
FlagsBAdditional flags for the matrix class of \(B\). Possible values are Eigen::ColMajor and Eigen::RowMajor.
StorageIndexAThe storage index type of the \(A\) matrix, only used when \(A\) is a sparse matrix.
StorageIndexBThe storage index type of the \(B\) matrix, only used when \(B\) is a sparse matrix.

Definition at line 127 of file SymShiftInvert.h.

Member Typedef Documentation

◆ Scalar

template<typename Scalar_ , typename TypeA = Eigen::Sparse, typename TypeB = Eigen::Sparse, int UploA = Eigen::Lower, int UploB = Eigen::Lower, int FlagsA = Eigen::ColMajor, int FlagsB = Eigen::ColMajor, typename StorageIndexA = int, typename StorageIndexB = int>
using Spectra::SymShiftInvert< Scalar_, TypeA, TypeB, UploA, UploB, FlagsA, FlagsB, StorageIndexA, StorageIndexB >::Scalar = Scalar_

Element type of the matrix.

Definition at line 133 of file SymShiftInvert.h.

Constructor & Destructor Documentation

◆ SymShiftInvert()

template<typename Scalar_ , typename TypeA = Eigen::Sparse, typename TypeB = Eigen::Sparse, int UploA = Eigen::Lower, int UploB = Eigen::Lower, int FlagsA = Eigen::ColMajor, int FlagsB = Eigen::ColMajor, typename StorageIndexA = int, typename StorageIndexB = int>
template<typename DerivedA , typename DerivedB >
Spectra::SymShiftInvert< Scalar_, TypeA, TypeB, UploA, UploB, FlagsA, FlagsB, StorageIndexA, StorageIndexB >::SymShiftInvert ( const Eigen::EigenBase< DerivedA > &  A,
const Eigen::EigenBase< DerivedB > &  B 
)
inline

Constructor to create the matrix operation object.

Parameters
AA dense or sparse matrix object, whose type can be Eigen::Matrix<...>, Eigen::SparseMatrix<...>, Eigen::Map<Eigen::Matrix<...>>, Eigen::Map<Eigen::SparseMatrix<...>>, Eigen::Ref<Eigen::Matrix<...>>, Eigen::Ref<Eigen::SparseMatrix<...>>, etc.
BA dense or sparse matrix object.

Definition at line 191 of file SymShiftInvert.h.

Member Function Documentation

◆ rows()

template<typename Scalar_ , typename TypeA = Eigen::Sparse, typename TypeB = Eigen::Sparse, int UploA = Eigen::Lower, int UploB = Eigen::Lower, int FlagsA = Eigen::ColMajor, int FlagsB = Eigen::ColMajor, typename StorageIndexA = int, typename StorageIndexB = int>
Index Spectra::SymShiftInvert< Scalar_, TypeA, TypeB, UploA, UploB, FlagsA, FlagsB, StorageIndexA, StorageIndexB >::rows ( ) const
inline

Return the number of rows of the underlying matrix.

Definition at line 209 of file SymShiftInvert.h.

◆ cols()

template<typename Scalar_ , typename TypeA = Eigen::Sparse, typename TypeB = Eigen::Sparse, int UploA = Eigen::Lower, int UploB = Eigen::Lower, int FlagsA = Eigen::ColMajor, int FlagsB = Eigen::ColMajor, typename StorageIndexA = int, typename StorageIndexB = int>
Index Spectra::SymShiftInvert< Scalar_, TypeA, TypeB, UploA, UploB, FlagsA, FlagsB, StorageIndexA, StorageIndexB >::cols ( ) const
inline

Return the number of columns of the underlying matrix.

Definition at line 213 of file SymShiftInvert.h.

◆ set_shift()

template<typename Scalar_ , typename TypeA = Eigen::Sparse, typename TypeB = Eigen::Sparse, int UploA = Eigen::Lower, int UploB = Eigen::Lower, int FlagsA = Eigen::ColMajor, int FlagsB = Eigen::ColMajor, typename StorageIndexA = int, typename StorageIndexB = int>
void Spectra::SymShiftInvert< Scalar_, TypeA, TypeB, UploA, UploB, FlagsA, FlagsB, StorageIndexA, StorageIndexB >::set_shift ( const Scalar sigma)
inline

Set the real shift \(\sigma\).

Definition at line 218 of file SymShiftInvert.h.

◆ perform_op()

template<typename Scalar_ , typename TypeA = Eigen::Sparse, typename TypeB = Eigen::Sparse, int UploA = Eigen::Lower, int UploB = Eigen::Lower, int FlagsA = Eigen::ColMajor, int FlagsB = Eigen::ColMajor, typename StorageIndexA = int, typename StorageIndexB = int>
void Spectra::SymShiftInvert< Scalar_, TypeA, TypeB, UploA, UploB, FlagsA, FlagsB, StorageIndexA, StorageIndexB >::perform_op ( const Scalar x_in,
Scalar y_out 
) const
inline

Perform the shift-invert operation \(y=(A-\sigma B)^{-1}x\).

Parameters
x_inPointer to the \(x\) vector.
y_outPointer to the \(y\) vector.

Definition at line 235 of file SymShiftInvert.h.


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