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>
27 #include "ITKFEMExport.h"
63 virtual void InitializeMatrix(
unsigned int matrixIndex) ITK_OVERRIDE;
65 virtual bool IsMatrixInitialized(
unsigned int matrixIndex) ITK_OVERRIDE;
67 virtual void DestroyMatrix(
unsigned int matrixIndex) ITK_OVERRIDE;
69 virtual void InitializeVector(
unsigned int vectorIndex) ITK_OVERRIDE;
71 virtual bool IsVectorInitialized(
unsigned int vectorIndex) ITK_OVERRIDE;
73 virtual void DestroyVector(
unsigned int vectorIndex) ITK_OVERRIDE;
75 virtual void InitializeSolution(
unsigned int solutionIndex) ITK_OVERRIDE;
77 virtual bool IsSolutionInitialized(
unsigned int solutionIndex) ITK_OVERRIDE;
79 virtual void DestroySolution(
unsigned int solutionIndex) ITK_OVERRIDE;
87 unsigned int matrixIndex)
const ITK_OVERRIDE
89 return ( *( ( *m_Matrices )[matrixIndex] ) )(i, j);
92 unsigned int matrixIndex) ITK_OVERRIDE
94 ( *( ( *m_Matrices )[matrixIndex] ) )(i, j) = value;
97 unsigned int matrixIndex) ITK_OVERRIDE
99 ( *( ( *m_Matrices )[matrixIndex] ) )(i, j) += value;
102 unsigned int vectorIndex)
const ITK_OVERRIDE
104 return ( *( ( *m_Vectors )[vectorIndex] ) )[i];
107 unsigned int vectorIndex) ITK_OVERRIDE
109 ( *( ( *m_Vectors )[vectorIndex] ) )(i) = value;
112 unsigned int vectorIndex) ITK_OVERRIDE
114 ( *( ( *m_Vectors )[vectorIndex] ) )(i) += value;
116 virtual Float GetSolutionValue(
unsigned int i,
unsigned int solutionIndex)
const ITK_OVERRIDE;
119 unsigned int solutionIndex) ITK_OVERRIDE
121 ( *( ( *m_Solutions )[solutionIndex] ) )(i) = value;
124 unsigned int solutionIndex) ITK_OVERRIDE
126 ( *( ( *m_Solutions )[solutionIndex] ) )(i) += value;
128 virtual void Solve(
void) ITK_OVERRIDE;
131 virtual
void ScaleMatrix(Float scale,
unsigned int matrixIndex) ITK_OVERRIDE;
133 virtual
void SwapMatrices(
unsigned int matrixIndex1,
unsigned int matrixIndex2) ITK_OVERRIDE;
135 virtual
void SwapVectors(
unsigned int vectorIndex1,
unsigned int vectorIndex2) ITK_OVERRIDE;
137 virtual
void SwapSolutions(
unsigned int solutionIndex1,
unsigned int solutionIndex2) ITK_OVERRIDE;
139 virtual
void CopySolution2Vector(
unsigned solutionIndex,
unsigned int vectorIndex) ITK_OVERRIDE;
141 virtual
void CopyVector2Solution(
unsigned int vectorIndex,
unsigned int solutionIndex) ITK_OVERRIDE;
143 virtual
void MultiplyMatrixMatrix(
unsigned int resultMatrixIndex,
unsigned int leftMatrixIndex,
144 unsigned int rightMatrixIndex) ITK_OVERRIDE;
146 virtual
void MultiplyMatrixVector(
unsigned int resultVectorIndex,
unsigned int matrixIndex,
unsigned int vectorIndex) ITK_OVERRIDE;
155 std::vector<vnl_vector<
Float> *> *m_Vectors;
158 std::vector<vnl_vector<
Float> *> *m_Solutions;
virtual void SetVectorValue(unsigned int i, Float value, unsigned int vectorIndex) override
LinearSystemWrapper SuperClass
virtual void SetSolutionValue(unsigned int i, Float value, unsigned int solutionIndex) override
vnl_sparse_matrix< Float > MatrixRepresentation
Defines all functions required by Solver class to allocate, assemble and solve a linear system of equ...
virtual Float GetMatrixValue(unsigned int i, unsigned int j, unsigned int matrixIndex) const override
virtual void AddSolutionValue(unsigned int i, Float value, unsigned int solutionIndex) override
virtual void SetMatrixValue(unsigned int i, unsigned int j, Float value, unsigned int matrixIndex) override
virtual void AddMatrixValue(unsigned int i, unsigned int j, Float value, unsigned int matrixIndex) override
virtual Float GetVectorValue(unsigned int i, unsigned int vectorIndex) const override
virtual void SetMaximumNonZeroValuesInMatrix(unsigned int, unsigned int)
virtual void AddVectorValue(unsigned int i, Float value, unsigned int vectorIndex) override
std::vector< MatrixRepresentation * > MatrixHolder
LinearSystemWrapper class that uses VNL numeric library functions to define a sparse linear system of...
LinearSystemWrapper::Float Float