19 #ifndef itkFEMLinearSystemWrapperDenseVNL_h
20 #define itkFEMLinearSystemWrapperDenseVNL_h
22 #include "vnl/vnl_matrix.h"
23 #include "vnl/vnl_vector.h"
24 #include "vnl/algo/vnl_svd.h"
25 #include "ITKFEMExport.h"
62 virtual void InitializeMatrix(
unsigned int matrixIndex) ITK_OVERRIDE;
64 virtual bool IsMatrixInitialized(
unsigned int matrixIndex) ITK_OVERRIDE;
66 virtual void DestroyMatrix(
unsigned int matrixIndex) ITK_OVERRIDE;
68 virtual void InitializeVector(
unsigned int vectorIndex) ITK_OVERRIDE;
70 virtual bool IsVectorInitialized(
unsigned int vectorIndex) ITK_OVERRIDE;
72 virtual void DestroyVector(
unsigned int vectorIndex) ITK_OVERRIDE;
74 virtual void InitializeSolution(
unsigned int solutionIndex) ITK_OVERRIDE;
76 virtual bool IsSolutionInitialized(
unsigned int solutionIndex) ITK_OVERRIDE;
78 virtual void DestroySolution(
unsigned int solutionIndex) 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;
115 virtual Float GetSolutionValue(
unsigned int i,
unsigned int solutionIndex)
const ITK_OVERRIDE;
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 ScaleVector(Float scale,
unsigned int vectorIndex);
134 virtual
void ScaleSolution(Float scale,
unsigned int solutionIndex);
136 virtual
void SwapMatrices(
unsigned int matrixIndex1,
unsigned int matrixIndex2) ITK_OVERRIDE;
138 virtual
void SwapVectors(
unsigned int vectorIndex1,
unsigned int vectorIndex2) ITK_OVERRIDE;
140 virtual
void SwapSolutions(
unsigned int solutionIndex1,
unsigned int solutionIndex2) ITK_OVERRIDE;
142 virtual
void CopySolution2Vector(
unsigned solutionIndex,
unsigned int vectorIndex) ITK_OVERRIDE;
144 virtual
void CopyVector2Solution(
unsigned int vectorIndex,
unsigned int solutionIndex) ITK_OVERRIDE;
146 virtual
void MultiplyMatrixMatrix(
unsigned int resultMatrixIndex,
unsigned int leftMatrixIndex,
147 unsigned int rightMatrixIndex) ITK_OVERRIDE;
149 virtual
void MultiplyMatrixVector(
unsigned int resultVectorIndex,
unsigned int matrixIndex,
unsigned int vectorIndex) ITK_OVERRIDE;
158 std::vector<vnl_vector<
Float> *> *m_Vectors;
161 std::vector<vnl_vector<
Float> *> *m_Solutions;
virtual void SetVectorValue(unsigned int i, Float value, unsigned int vectorIndex) override
LinearSystemWrapperDenseVNL()
vnl_matrix< Float > MatrixRepresentation
LinearSystemWrapper SuperClass
LinearSystemWrapper class that uses VNL numeric library functions to define a sparse linear system of...
virtual void SetMaximumNonZeroValuesInMatrix(unsigned int, unsigned int)
virtual void SetSolutionValue(unsigned int i, Float value, unsigned int solutionIndex) override
LinearSystemWrapper::Float Float
virtual void AddMatrixValue(unsigned int i, unsigned int j, Float value, unsigned int matrixIndex) override
std::vector< MatrixRepresentation * > MatrixHolder
virtual Float GetVectorValue(unsigned int i, unsigned int vectorIndex) const override
Defines all functions required by Solver class to allocate, assemble and solve a linear system of equ...
virtual void AddVectorValue(unsigned int i, Float value, unsigned int vectorIndex) override
virtual void AddSolutionValue(unsigned int i, Float value, unsigned int solutionIndex) override
virtual Float GetMatrixValue(unsigned int i, unsigned int j, unsigned int matrixIndex) const override
virtual void SetMatrixValue(unsigned int i, unsigned int j, Float value, unsigned int matrixIndex) override