19 #ifndef __itkFEMLinearSystemWrapperVNL_h
20 #define __itkFEMLinearSystemWrapperVNL_h
22 #include "vnl/vnl_sparse_matrix.h"
23 #include "vnl/vnl_vector.h"
24 #include <vnl/vnl_sparse_matrix_linear_system.h>
25 #include <vnl/algo/vnl_lsqr.h>
66 virtual void DestroyMatrix(
unsigned int matrixIndex) ITK_OVERRIDE;
72 virtual void DestroyVector(
unsigned int vectorIndex) ITK_OVERRIDE;
86 unsigned int matrixIndex)
const ITK_OVERRIDE
88 return ( *( ( *
m_Matrices )[matrixIndex] ) )(i, j);
91 unsigned int matrixIndex) ITK_OVERRIDE
93 ( *( ( *m_Matrices )[matrixIndex] ) )(i, j) = value;
96 unsigned int matrixIndex) ITK_OVERRIDE
98 ( *( ( *m_Matrices )[matrixIndex] ) )(i, j) += value;
101 unsigned int vectorIndex)
const ITK_OVERRIDE
103 return ( *( ( *
m_Vectors )[vectorIndex] ) )[i];
106 unsigned int vectorIndex) ITK_OVERRIDE
108 ( *( ( *m_Vectors )[vectorIndex] ) )(i) = value;
111 unsigned int vectorIndex) ITK_OVERRIDE
113 ( *( ( *m_Vectors )[vectorIndex] ) )(i) += value;
118 unsigned int solutionIndex) ITK_OVERRIDE
120 ( *( ( *m_Solutions )[solutionIndex] ) )(i) = value;
123 unsigned int solutionIndex) ITK_OVERRIDE
125 ( *( ( *m_Solutions )[solutionIndex] ) )(i) += value;
127 virtual void Solve(
void) ITK_OVERRIDE;
130 virtual
void ScaleMatrix(
Float scale,
unsigned int matrixIndex) ITK_OVERRIDE;
132 virtual
void SwapMatrices(
unsigned int matrixIndex1,
unsigned int matrixIndex2) ITK_OVERRIDE;
134 virtual
void SwapVectors(
unsigned int vectorIndex1,
unsigned int vectorIndex2) ITK_OVERRIDE;
136 virtual
void SwapSolutions(
unsigned int solutionIndex1,
unsigned int solutionIndex2) ITK_OVERRIDE;
138 virtual
void CopySolution2Vector(
unsigned solutionIndex,
unsigned int vectorIndex) ITK_OVERRIDE;
140 virtual
void CopyVector2Solution(
unsigned int vectorIndex,
unsigned int solutionIndex) ITK_OVERRIDE;
143 unsigned int rightMatrixIndex) ITK_OVERRIDE;
145 virtual
void MultiplyMatrixVector(
unsigned int resultVectorIndex,
unsigned int matrixIndex,
unsigned int vectorIndex) ITK_OVERRIDE;
virtual void CopyVector2Solution(unsigned int vectorIndex, unsigned int solutionIndex) ITK_OVERRIDE
virtual void Solve(void) ITK_OVERRIDE
virtual void SetVectorValue(unsigned int i, Float value, unsigned int vectorIndex) ITK_OVERRIDE
virtual void MultiplyMatrixVector(unsigned int resultVectorIndex, unsigned int matrixIndex, unsigned int vectorIndex) ITK_OVERRIDE
virtual void AddVectorValue(unsigned int i, Float value, unsigned int vectorIndex) ITK_OVERRIDE
LinearSystemWrapper SuperClass
virtual void InitializeSolution(unsigned int solutionIndex) ITK_OVERRIDE
virtual void MultiplyMatrixMatrix(unsigned int resultMatrixIndex, unsigned int leftMatrixIndex, unsigned int rightMatrixIndex) ITK_OVERRIDE
virtual void ScaleMatrix(Float scale, unsigned int matrixIndex) ITK_OVERRIDE
virtual void DestroyMatrix(unsigned int matrixIndex) ITK_OVERRIDE
virtual void SwapSolutions(unsigned int solutionIndex1, unsigned int solutionIndex2) ITK_OVERRIDE
std::vector< vnl_vector< Float > * > * m_Solutions
vnl_sparse_matrix< Float > MatrixRepresentation
Defines all functions required by Solver class to allocate, assemble and solve a linear system of equ...
virtual void AddSolutionValue(unsigned int i, Float value, unsigned int solutionIndex) ITK_OVERRIDE
virtual void InitializeVector(unsigned int vectorIndex) ITK_OVERRIDE
virtual Float GetVectorValue(unsigned int i, unsigned int vectorIndex) const ITK_OVERRIDE
virtual void SetMatrixValue(unsigned int i, unsigned int j, Float value, unsigned int matrixIndex) ITK_OVERRIDE
virtual void SetSolutionValue(unsigned int i, Float value, unsigned int solutionIndex) ITK_OVERRIDE
virtual bool IsMatrixInitialized(unsigned int matrixIndex) ITK_OVERRIDE
MatrixHolder * m_Matrices
virtual void SwapVectors(unsigned int vectorIndex1, unsigned int vectorIndex2) ITK_OVERRIDE
virtual void InitializeMatrix(unsigned int matrixIndex) ITK_OVERRIDE
virtual void SwapMatrices(unsigned int matrixIndex1, unsigned int matrixIndex2) ITK_OVERRIDE
virtual void AddMatrixValue(unsigned int i, unsigned int j, Float value, unsigned int matrixIndex) ITK_OVERRIDE
std::vector< vnl_vector< Float > * > * m_Vectors
virtual void DestroySolution(unsigned int solutionIndex) ITK_OVERRIDE
virtual bool IsSolutionInitialized(unsigned int solutionIndex) ITK_OVERRIDE
virtual void SetMaximumNonZeroValuesInMatrix(unsigned int, unsigned int)
std::vector< MatrixRepresentation * > MatrixHolder
virtual ~LinearSystemWrapperVNL()
virtual Float GetSolutionValue(unsigned int i, unsigned int solutionIndex) const ITK_OVERRIDE
virtual void DestroyVector(unsigned int vectorIndex) ITK_OVERRIDE
virtual bool IsVectorInitialized(unsigned int vectorIndex) ITK_OVERRIDE
virtual Float GetMatrixValue(unsigned int i, unsigned int j, unsigned int matrixIndex) const ITK_OVERRIDE
LinearSystemWrapper class that uses VNL numeric library functions to define a sparse linear system of...
virtual void CopySolution2Vector(unsigned solutionIndex, unsigned int vectorIndex) ITK_OVERRIDE
LinearSystemWrapper::Float Float