Eigen-unsupported  5.0.1-dev+7c7d8473
 
Loading...
Searching...
No Matches
Eigen::SparseInverse< Scalar > Class Template Reference

#include <unsupported/Eigen/src/SparseExtra/SparseInverse.h>

Detailed Description

template<typename Scalar>
class Eigen::SparseInverse< Scalar >

calculate sparse subset of inverse of sparse matrix

This class returns a sparse subset of the inverse of the input matrix. The nonzeros correspond to the nonzeros of the input, plus any additional elements required due to fill-in of the internal LU factorization. This is is minimized via a applying a fill-reducing permutation as part of the LU factorization.

If there are specific entries of the input matrix which you need inverse values for, which are zero for the input, you need to insert entries into the input sparse matrix for them to be calculated.

Due to the sensitive nature of matrix inversion, particularly on large matrices which are made possible via sparsity, high accuracy dot products based on Kahan summation are used to reduce numerical error. If you still encounter numerical errors you may with to equilibrate your matrix before calculating the inverse, as well as making sure it is actually full rank.

Public Member Functions

SparseInversecompute (const SparseMatrix< Scalar > &A)
 Calculate the sparse inverse from a given sparse input.
 
const MatrixTypeinverse () const
 return the already-calculated sparse inverse, or a 0x0 matrix if it could not be computed
 
 SparseInverse (const SparseLU< MatrixType > &slu)
 This Constructor is for if you already have a factored SparseLU and would like to use it to calculate a sparse inverse.
 

Static Public Member Functions

static MatrixType computeInverse (const RowMatrixType &Upper, const Matrix< Scalar, Dynamic, 1 > &inverseDiagonal, const MatrixType &Lower)
 Internal function to calculate the inverse from strictly upper, diagonal and strictly lower components.
 
static MatrixType computeInverse (const SparseLU< MatrixType > &slu)
 Internal function to calculate the sparse inverse in a functional way.
 

Constructor & Destructor Documentation

◆ SparseInverse()

template<typename Scalar>
Eigen::SparseInverse< Scalar >::SparseInverse ( const SparseLU< MatrixType > & slu)
inline

This Constructor is for if you already have a factored SparseLU and would like to use it to calculate a sparse inverse.

Just call this constructor with your already factored SparseLU class and you can directly call the .inverse() method to get the result.

Member Function Documentation

◆ computeInverse()

template<typename Scalar>
static MatrixType Eigen::SparseInverse< Scalar >::computeInverse ( const SparseLU< MatrixType > & slu)
inlinestatic

Internal function to calculate the sparse inverse in a functional way.

Returns
A sparse inverse representation, or, if the decomposition didn't complete, a 0x0 matrix.

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