Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex > Class Template Reference

#include <SparseSymShiftSolve.h>

Public Types

using Scalar = Scalar_
 

Public Member Functions

Index cols () const
 
void perform_op (const Scalar *x_in, Scalar *y_out) const
 
Index rows () const
 
void set_shift (const Scalar &sigma)
 
template<typename Derived >
 SparseSymShiftSolve (const Eigen::SparseMatrixBase< Derived > &mat)
 

Private Types

using ConstGenericSparseMatrix = const Eigen::Ref< const SparseMatrix >
 
using Index = Eigen::Index
 
using MapConstVec = Eigen::Map< const Vector >
 
using MapVec = Eigen::Map< Vector >
 
using SparseMatrix = Eigen::SparseMatrix< Scalar, Flags, StorageIndex >
 
using Vector = Eigen::Matrix< Scalar, Eigen::Dynamic, 1 >
 

Private Attributes

ConstGenericSparseMatrix m_mat
 
const Index m_n
 
Eigen::SparseLU< SparseMatrixm_solver
 

Detailed Description

template<typename Scalar_, int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
class Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >

This class defines the shift-solve operation on a sparse real symmetric matrix $A$, i.e., calculating $y=(A-\sigma I)^{-1}x$ for any real $\sigma$ and vector $x$. It is mainly used in the SymEigsShiftSolver eigen solver.

Template Parameters
Scalar_The element type of the matrix, for example, float, double, and long double.
UploEither Eigen::Lower or Eigen::Upper, indicating which triangular part of the matrix is used.
FlagsEither Eigen::ColMajor or Eigen::RowMajor, indicating the storage format of the input matrix.
StorageIndexThe type of the indices for the sparse matrix.

Definition at line 33 of file SparseSymShiftSolve.h.

Member Typedef Documentation

◆ ConstGenericSparseMatrix

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
using Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::ConstGenericSparseMatrix = const Eigen::Ref<const SparseMatrix>
private

Definition at line 47 of file SparseSymShiftSolve.h.

◆ Index

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
using Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::Index = Eigen::Index
private

Definition at line 42 of file SparseSymShiftSolve.h.

◆ MapConstVec

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
using Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::MapConstVec = Eigen::Map<const Vector>
private

Definition at line 44 of file SparseSymShiftSolve.h.

◆ MapVec

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
using Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::MapVec = Eigen::Map<Vector>
private

Definition at line 45 of file SparseSymShiftSolve.h.

◆ Scalar

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
using Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::Scalar = Scalar_

Element type of the matrix.

Definition at line 39 of file SparseSymShiftSolve.h.

◆ SparseMatrix

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
using Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::SparseMatrix = Eigen::SparseMatrix<Scalar, Flags, StorageIndex>
private

Definition at line 46 of file SparseSymShiftSolve.h.

◆ Vector

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
using Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::Vector = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
private

Definition at line 43 of file SparseSymShiftSolve.h.

Constructor & Destructor Documentation

◆ SparseSymShiftSolve()

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
template<typename Derived >
Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::SparseSymShiftSolve ( const Eigen::SparseMatrixBase< Derived > &  mat)
inline

Constructor to create the matrix operation object.

Parameters
matAn Eigen sparse matrix object, whose type can be Eigen::SparseMatrix<Scalar, ...> or its mapped version Eigen::Map<Eigen::SparseMatrix<Scalar, ...> >.

Definition at line 62 of file SparseSymShiftSolve.h.

Member Function Documentation

◆ cols()

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
Index Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::cols ( ) const
inline

Return the number of columns of the underlying matrix.

Definition at line 80 of file SparseSymShiftSolve.h.

◆ perform_op()

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
void Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::perform_op ( const Scalar x_in,
Scalar y_out 
) const
inline

Perform the shift-solve operation $y=(A-\sigma I)^{-1}x$.

Parameters
x_inPointer to the $x$ vector.
y_outPointer to the $y$ vector.

Definition at line 104 of file SparseSymShiftSolve.h.

◆ rows()

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
Index Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::rows ( ) const
inline

Return the number of rows of the underlying matrix.

Definition at line 76 of file SparseSymShiftSolve.h.

◆ set_shift()

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
void Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::set_shift ( const Scalar sigma)
inline

Set the real shift $\sigma$.

Definition at line 85 of file SparseSymShiftSolve.h.

Member Data Documentation

◆ m_mat

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
ConstGenericSparseMatrix Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::m_mat
private

Definition at line 49 of file SparseSymShiftSolve.h.

◆ m_n

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
const Index Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::m_n
private

Definition at line 50 of file SparseSymShiftSolve.h.

◆ m_solver

template<typename Scalar_ , int Uplo = Eigen::Lower, int Flags = Eigen::ColMajor, typename StorageIndex = int>
Eigen::SparseLU<SparseMatrix> Spectra::SparseSymShiftSolve< Scalar_, Uplo, Flags, StorageIndex >::m_solver
private

Definition at line 51 of file SparseSymShiftSolve.h.


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


gtsam
Author(s):
autogenerated on Fri Apr 4 2025 03:15:43