Spectra::SymShiftInvert< Scalar_, TypeA, TypeB, UploA, UploB, FlagsA, FlagsB, StorageIndexA, StorageIndexB > Class Template Reference

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.

#include <SymShiftInvert.h>

Public Types

using Scalar = Scalar_
 Element type of the matrix.
 

Public Member Functions

template<typename DerivedA , typename DerivedB >
 SymShiftInvert (const Eigen::EigenBase< DerivedA > &A, const Eigen::EigenBase< DerivedB > &B)
 Constructor to create the matrix operation object. More...
 
Index rows () const
 Return the number of rows of the underlying matrix.
 
Index cols () const
 Return the number of columns of the underlying matrix.
 
void set_shift (const Scalar &sigma)
 Set the real shift \(\sigma\).
 
void perform_op (const Scalar *x_in, Scalar *y_out) const
 Perform the shift-invert operation \(y=(A-\sigma B)^{-1}x\). More...
 

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.

Member Function Documentation

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

The documentation for this class was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono_thirdparty/spectra/Spectra/MatOp/SymShiftInvert.h