libgenua
Basic Geometry, Numerical Algorithms and Interfaces
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
BenziSparseInverse< FloatType, M > Class Template Reference

Detailed Description

template<typename FloatType, int M>
class BenziSparseInverse< FloatType, M >

Approximate sparse inverse for nonsymmetric problems.

Generates a sparse approximate inverse of A according to

\[ W^T A Z = D, \quad A^{-1} = Z D^{-1} W^T = \sum_i \frac{z_i w_i^T}{p_i} \]

M. Benzi, M. Tuma: A Sparse Approximate Inverse Preconditioner for nonsymmetric Linear Systems. SIAM J.Sci.Comput. 19(3):968-994, May 1998

M. Bollhöfer, Y. Saad: A Factored Approximate Inverse Preconditioner with Pivoting. SIAM J.Matrix Anal. Appl. 23(3):692–705, January 2002

#include <benzispai.h>

Public Member Functions

 BenziSparseInverse ()
 empty construction
 
const BlockMatrixzfactor () const
 access factor Z
 
const BlockMatrixwtfactor () const
 access factor W^T, i.e. W stored by columns
 
const Blockinvp (uint k) const
 access inverse diagonal block p_i^{-1}
 
bool staticFactor (const BlockMatrix &A)
 create approximate factorization for A
 
bool dynamicFactor (const BlockMatrix &A, double relDropTolerance)
 compute inverse factorization using dynamic drop-tolerance biconjugation
 
template<typename BType , typename XType >
void solve (const DVector< BType > &b, DVector< XType > &x) const
 solve for single right-hand side
 

Private Member Functions

void zwsparsity (const BlockMatrix &a)
 determine static sparsity pattern for Z and W
 
void initIdentity (BlockMatrix &z) const
 initialize block matrix z as identity matrix
 
void staticUpdate (const BlockMatrix &A, BlockMatrix &Z, uint i, uint j)
 Update a row of z in the inner loop. More...
 
bool saadHeadUpdate (size_t i, const BlockMatrix &A, ColumnArray &Z, ColumnArray &W, double dropTol)
 update column i+1 once column i is up-to-date, finally, invert diagonal
 
void saadTailUpdate (size_t i, const BlockMatrix &A, ColumnArray &Z, ColumnArray &W, double dropTol) const
 update columns i+2 to end once i is up-to-date
 
void saadUpdate (size_t i, size_t j, const BlockMatrix &A, ColumnArray &Z, ColumnArray &W, double dropTol) const
 Saad/Benzi biconjugation column update.
 
void transfer (size_t nbr, const ColumnArray &Z, const ColumnArray &W)
 compress and transfer blocks from work columns
 

Static Private Member Functions

static force_inline void mmadd (const Block &a, const Block &b, Block &c) attr_always_inline
 forwarding of block operation
 
static force_inline void mmsub (const Block &a, const Block &b, Block &c) attr_always_inline
 forwarding of block operation
 
static force_inline bool mminv (const Block &a, Block &ai) attr_always_inline
 forwarding of block operation
 
static force_inline void mmtranspose (Block &at) attr_always_inline
 forwarding of block operation
 

Private Attributes

BlockMatrix m_wt
 left factor W^t
 
BlockMatrix m_z
 right factor, Z
 
BlockArray m_invp
 inverse of the diagonal 1/p_i
 

Member Function Documentation

template<typename FloatType , int M>
void BenziSparseInverse< FloatType, M >::staticUpdate ( const BlockMatrix A,
BlockMatrix Z,
uint  i,
uint  j 
)
inlineprivate

Update a row of z in the inner loop.

p_j = A(i) * Z(j) z_j -= p_j * p_i^-1 * z_i


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