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

#include <VNLIterativeSparseSolverTraits.h>

Detailed Description

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

Generic interface for iterative sparse linear solver.

This generic interface (common to several sparse solvers), allow to interchange solver solutions when dealing with sparse linear system. 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 an iterative one see vnl_sparse_matrix_linear_system for more details on the method used.

See also
VNLSparseLUSolverTraits

Definition at line 43 of file VNLIterativeSparseSolverTraits.h.

Public Types

using MatrixType = vnl_sparse_matrix< ValueType >
 
using SolverType = vnl_lsqr
 
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, const long &iNbIter, 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)
 

Member Typedef Documentation

◆ MatrixType

template<typename T = double>
using VNLIterativeSparseSolverTraits< T >::MatrixType = vnl_sparse_matrix<ValueType>

Definition at line 47 of file VNLIterativeSparseSolverTraits.h.

◆ SolverType

template<typename T = double>
using VNLIterativeSparseSolverTraits< T >::SolverType = vnl_lsqr

Definition at line 49 of file VNLIterativeSparseSolverTraits.h.

◆ ValueType

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

Definition at line 46 of file VNLIterativeSparseSolverTraits.h.

◆ VectorType

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

Definition at line 48 of file VNLIterativeSparseSolverTraits.h.

Member Function Documentation

◆ AddToMatrix()

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

iA[iR][iC] += iV

Definition at line 88 of file VNLIterativeSparseSolverTraits.h.

◆ FillMatrix()

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

iA[iR][iC] = iV

Definition at line 81 of file VNLIterativeSparseSolverTraits.h.

◆ InitializeSparseMatrix() [1/2]

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

initialize a square sparse matrix of size iN x iN

Definition at line 60 of file VNLIterativeSparseSolverTraits.h.

◆ InitializeSparseMatrix() [2/2]

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

initialize a sparse matrix of size iRow x iCol

Definition at line 67 of file VNLIterativeSparseSolverTraits.h.

◆ InitializeVector()

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

initialize a vector of size iN

Definition at line 74 of file VNLIterativeSparseSolverTraits.h.

◆ IsDirectSolver()

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

Definition at line 53 of file VNLIterativeSparseSolverTraits.h.

◆ Solve() [1/4]

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

Solve the linear systems: \( iA \cdot oX = iBx \) in N iterations.

Definition at line 134 of file VNLIterativeSparseSolverTraits.h.

◆ Solve() [2/4]

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

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

Definition at line 95 of file VNLIterativeSparseSolverTraits.h.

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

◆ Solve() [3/4]

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

References VNLIterativeSparseSolverTraits< T >::Solve().

◆ Solve() [4/4]

template<typename T = double>
static bool VNLIterativeSparseSolverTraits< 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 VNLIterativeSparseSolverTraits.h.

References VNLIterativeSparseSolverTraits< T >::Solve().


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