ITK  6.0.0
Insight Toolkit
Public Types | Static Public Member Functions | List of all members
VNLSparseLUSolverTraits< T > Class Template Reference

#include <VNLSparseLUSolverTraits.h>

Detailed Description

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

Generic interface for sparse LU solver.

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

It internally uses the VNL library to represent and deal with vectors (vnl_vector) and sparse matrices (vnl_sparse_matrix). The solver by itself is made of a sparse LU decomposition followed by solving upper triangular system. see vnl_sparse_lu for more details on the method used.

See also
VNLIterativeSparseSolverTraits:w

Definition at line 42 of file VNLSparseLUSolverTraits.h.

Public Types

using MatrixType = vnl_sparse_matrix< ValueType >
 
using SolverType = vnl_sparse_lu
 
using ValueType = T
 
using VectorType = vnl_vector< ValueType >
 

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 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 VNLSparseLUSolverTraits< T >::MatrixType = vnl_sparse_matrix<ValueType>

Definition at line 46 of file VNLSparseLUSolverTraits.h.

◆ SolverType

template<typename T = double>
using VNLSparseLUSolverTraits< T >::SolverType = vnl_sparse_lu

Definition at line 48 of file VNLSparseLUSolverTraits.h.

◆ ValueType

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

Definition at line 45 of file VNLSparseLUSolverTraits.h.

◆ VectorType

template<typename T = double>
using VNLSparseLUSolverTraits< T >::VectorType = vnl_vector<ValueType>

Definition at line 47 of file VNLSparseLUSolverTraits.h.

Member Function Documentation

◆ AddToMatrix()

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

iA[iR][iC] += iV

Definition at line 87 of file VNLSparseLUSolverTraits.h.

◆ FillMatrix()

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

iA[iR][iC] = iV

Definition at line 80 of file VNLSparseLUSolverTraits.h.

◆ InitializeSparseMatrix() [1/2]

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

initialize a square sparse matrix of size iN x iN

Definition at line 59 of file VNLSparseLUSolverTraits.h.

◆ InitializeSparseMatrix() [2/2]

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

initialize a sparse matrix of size iRow x iCol

Definition at line 66 of file VNLSparseLUSolverTraits.h.

◆ InitializeVector()

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

initialize a vector of size iN

Definition at line 73 of file VNLSparseLUSolverTraits.h.

◆ IsDirectSolver()

template<typename T = double>
static bool VNLSparseLUSolverTraits< T >::IsDirectSolver ( )
inlinestatic
Returns
false (it is not a direct solver, it is an iterative solver)

Definition at line 52 of file VNLSparseLUSolverTraits.h.

◆ Solve() [1/6]

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

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

Definition at line 94 of file VNLSparseLUSolverTraits.h.

References VNLSparseLUSolverTraits< T >::Solve().

Referenced by VNLSparseLUSolverTraits< T >::Solve().

◆ Solve() [2/6]

template<typename T = double>
static bool VNLSparseLUSolverTraits< 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 105 of file VNLSparseLUSolverTraits.h.

References VNLSparseLUSolverTraits< T >::Solve().

◆ Solve() [3/6]

template<typename T = double>
static bool VNLSparseLUSolverTraits< 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 121 of file VNLSparseLUSolverTraits.h.

References VNLSparseLUSolverTraits< T >::Solve().

◆ Solve() [4/6]

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

Solve the linear system \( iA \cdot oX = iB \) factoring the internal matrix if needed.

Definition at line 131 of file VNLSparseLUSolverTraits.h.

◆ Solve() [5/6]

template<typename T = double>
static void VNLSparseLUSolverTraits< 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 \) factoring the internal matrix if needed.

Definition at line 139 of file VNLSparseLUSolverTraits.h.

◆ Solve() [6/6]

template<typename T = double>
static void VNLSparseLUSolverTraits< 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 \) factoring the internal matrix if needed.

Definition at line 155 of file VNLSparseLUSolverTraits.h.


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