ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
SparseLUSolverTraits< T > Class Template Reference

#include <SparseLUSolverTraits.h>

Detailed Description

template<typename T = double>
class SparseLUSolverTraits< T >

Generic interface for sparse LU solver backed by Eigen::SparseLU.

This generic interface (common to several sparse solvers), allow to interchange solver solutions when dealing with sparse linear systems. See itk::ParameterizationQuadEdgeMeshFilter for reference.

See also
VNLSparseLUSolverTraits
VNLIterativeSparseSolverTraits

Definition at line 38 of file SparseLUSolverTraits.h.

Public Types

using MatrixType = Eigen::SparseMatrix<ValueType>
 
using SolverType = Eigen::SparseLU<MatrixType>
 
using ValueType = T
 
using VectorType = Eigen::Matrix<ValueType, Eigen::Dynamic, 1>
 

Static Public Member Functions

static void AddToMatrix (MatrixType &iA, const unsigned int &iR, const unsigned int &iC, const ValueType &iV)
 
static void FillMatrix (MatrixType &iA, const unsigned int &iR, const unsigned int &iC, const ValueType &iV)
 
static MatrixType InitializeSparseMatrix (const unsigned int &iN)
 
static MatrixType InitializeSparseMatrix (const unsigned int &iRow, const unsigned int &iCol)
 
static VectorType InitializeVector (const unsigned int &iN)
 
static bool IsDirectSolver ()
 
static void MatVecMult (const MatrixType &iA, const VectorType &iB, VectorType &oX)
 
static bool Solve (const MatrixType &iA, const VectorType &iB, VectorType &oX)
 
static bool Solve (const MatrixType &iA, const VectorType &iBx, const VectorType &iBy, const VectorType &iBz, VectorType &oX, VectorType &oY, VectorType &oZ)
 
static bool Solve (const MatrixType &iA, const VectorType &iBx, const VectorType &iBy, VectorType &oX, VectorType &oY)
 
static void Solve (SolverType &solver, const VectorType &iB, VectorType &oX)
 
static void Solve (SolverType &solver, const VectorType &iBx, const VectorType &iBy, const VectorType &iBz, VectorType &oX, VectorType &oY, VectorType &oZ)
 
static void Solve (SolverType &solver, const VectorType &iBx, const VectorType &iBy, VectorType &oX, VectorType &oY)
 

Member Typedef Documentation

◆ MatrixType

template<typename T = double>
using SparseLUSolverTraits< T >::MatrixType = Eigen::SparseMatrix<ValueType>

Definition at line 42 of file SparseLUSolverTraits.h.

◆ SolverType

template<typename T = double>
using SparseLUSolverTraits< T >::SolverType = Eigen::SparseLU<MatrixType>

Definition at line 44 of file SparseLUSolverTraits.h.

◆ ValueType

template<typename T = double>
using SparseLUSolverTraits< T >::ValueType = T

Definition at line 41 of file SparseLUSolverTraits.h.

◆ VectorType

template<typename T = double>
using SparseLUSolverTraits< T >::VectorType = Eigen::Matrix<ValueType, Eigen::Dynamic, 1>

Definition at line 43 of file SparseLUSolverTraits.h.

Member Function Documentation

◆ AddToMatrix()

template<typename T = double>
static void SparseLUSolverTraits< T >::AddToMatrix ( MatrixType & iA,
const unsigned int & iR,
const unsigned int & iC,
const ValueType & iV )
inlinestatic

iA[iR][iC] += iV

Definition at line 82 of file SparseLUSolverTraits.h.

◆ FillMatrix()

template<typename T = double>
static void SparseLUSolverTraits< T >::FillMatrix ( MatrixType & iA,
const unsigned int & iR,
const unsigned int & iC,
const ValueType & iV )
inlinestatic

iA[iR][iC] = iV

Definition at line 75 of file SparseLUSolverTraits.h.

◆ InitializeSparseMatrix() [1/2]

template<typename T = double>
static MatrixType SparseLUSolverTraits< T >::InitializeSparseMatrix ( const unsigned int & iN)
inlinestatic

initialize a square sparse matrix of size iN x iN

Definition at line 54 of file SparseLUSolverTraits.h.

◆ InitializeSparseMatrix() [2/2]

template<typename T = double>
static MatrixType SparseLUSolverTraits< T >::InitializeSparseMatrix ( const unsigned int & iRow,
const unsigned int & iCol )
inlinestatic

initialize a sparse matrix of size iRow x iCol

Definition at line 61 of file SparseLUSolverTraits.h.

◆ InitializeVector()

template<typename T = double>
static VectorType SparseLUSolverTraits< T >::InitializeVector ( const unsigned int & iN)
inlinestatic

initialize a vector of size iN

Definition at line 68 of file SparseLUSolverTraits.h.

◆ IsDirectSolver()

template<typename T = double>
static bool SparseLUSolverTraits< T >::IsDirectSolver ( )
inlinestatic

Definition at line 47 of file SparseLUSolverTraits.h.

◆ MatVecMult()

template<typename T = double>
static void SparseLUSolverTraits< T >::MatVecMult ( const MatrixType & iA,
const VectorType & iB,
VectorType & oX )
inlinestatic

oX = iA * iB

Definition at line 89 of file SparseLUSolverTraits.h.

◆ Solve() [1/6]

template<typename T = double>
static bool SparseLUSolverTraits< T >::Solve ( const MatrixType & iA,
const VectorType & iB,
VectorType & oX )
inlinestatic

Solve the linear system \( iA \cdot oX = iB \).

Definition at line 96 of file SparseLUSolverTraits.h.

Referenced by Solve(), and Solve().

◆ Solve() [2/6]

template<typename T = double>
static bool SparseLUSolverTraits< T >::Solve ( const MatrixType & iA,
const VectorType & iBx,
const VectorType & iBy,
const VectorType & iBz,
VectorType & oX,
VectorType & oY,
VectorType & oZ )
inlinestatic

Solve the linear systems: \( iA \cdot oX = iBx \), \( iA \cdot oY = iBy \), \( iA \cdot oZ = iBz \).

Definition at line 108 of file SparseLUSolverTraits.h.

References Solve().

◆ Solve() [3/6]

template<typename T = double>
static bool SparseLUSolverTraits< T >::Solve ( const MatrixType & iA,
const VectorType & iBx,
const VectorType & iBy,
VectorType & oX,
VectorType & oY )
inlinestatic

Solve the linear systems: \( iA \cdot oX = iBx \), \( iA \cdot oY = iBy \).

Definition at line 124 of file SparseLUSolverTraits.h.

References Solve().

◆ Solve() [4/6]

template<typename T = double>
static void SparseLUSolverTraits< T >::Solve ( SolverType & solver,
const VectorType & iB,
VectorType & oX )
inlinestatic

Solve the linear system \( iA \cdot oX = iB \) reusing the factored matrix.

Definition at line 134 of file SparseLUSolverTraits.h.

◆ Solve() [5/6]

template<typename T = double>
static void SparseLUSolverTraits< T >::Solve ( SolverType & solver,
const VectorType & iBx,
const VectorType & iBy,
const VectorType & iBz,
VectorType & oX,
VectorType & oY,
VectorType & oZ )
inlinestatic

Solve the linear systems: \( iA \cdot oX = iBx \), \( iA \cdot oY = iBy \), \( iA \cdot oZ = iBz \) reusing the factored matrix.

Definition at line 142 of file SparseLUSolverTraits.h.

◆ Solve() [6/6]

template<typename T = double>
static void SparseLUSolverTraits< T >::Solve ( SolverType & solver,
const VectorType & iBx,
const VectorType & iBy,
VectorType & oX,
VectorType & oY )
inlinestatic

Solve the linear systems: \( iA \cdot oX = iBx \), \( iA \cdot oY = iBy \) reusing the factored matrix.

Definition at line 158 of file SparseLUSolverTraits.h.


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