19 #ifndef itkFEMLinearSystemWrapperVNL_h
20 #define itkFEMLinearSystemWrapperVNL_h
22 #include "vnl/vnl_sparse_matrix.h"
23 #include "vnl/vnl_vector.h"
25 #include "ITKFEMExport.h"
61 virtual
void InitializeMatrix(
unsigned int matrixIndex) ITK_OVERRIDE;
63 virtual
bool IsMatrixInitialized(
unsigned int matrixIndex) ITK_OVERRIDE;
65 virtual
void DestroyMatrix(
unsigned int matrixIndex) ITK_OVERRIDE;
67 virtual
void InitializeVector(
unsigned int vectorIndex) ITK_OVERRIDE;
69 virtual
bool IsVectorInitialized(
unsigned int vectorIndex) ITK_OVERRIDE;
71 virtual
void DestroyVector(
unsigned int vectorIndex) ITK_OVERRIDE;
73 virtual
void InitializeSolution(
unsigned int solutionIndex) ITK_OVERRIDE;
75 virtual
bool IsSolutionInitialized(
unsigned int solutionIndex) ITK_OVERRIDE;
77 virtual
void DestroySolution(
unsigned int solutionIndex) ITK_OVERRIDE;
79 virtual
void SetMaximumNonZeroValuesInMatrix(
unsigned int,
unsigned int)
85 unsigned int matrixIndex)
const ITK_OVERRIDE
87 return ( *( ( *m_Matrices )[matrixIndex] ) )(i, j);
90 unsigned int matrixIndex) ITK_OVERRIDE
92 ( *( ( *m_Matrices )[matrixIndex] ) )(i, j) = value;
95 unsigned int matrixIndex) ITK_OVERRIDE
97 ( *( ( *m_Matrices )[matrixIndex] ) )(i, j) += value;
100 unsigned int vectorIndex)
const ITK_OVERRIDE
102 return ( *( ( *m_Vectors )[vectorIndex] ) )[i];
105 unsigned int vectorIndex) ITK_OVERRIDE
107 ( *( ( *m_Vectors )[vectorIndex] ) )(i) = value;
110 unsigned int vectorIndex) ITK_OVERRIDE
112 ( *( ( *m_Vectors )[vectorIndex] ) )(i) += value;
114 virtual Float GetSolutionValue(
unsigned int i,
unsigned int solutionIndex)
const ITK_OVERRIDE;
117 unsigned int solutionIndex) ITK_OVERRIDE
119 ( *( ( *m_Solutions )[solutionIndex] ) )(i) = value;
122 unsigned int solutionIndex) ITK_OVERRIDE
124 ( *( ( *m_Solutions )[solutionIndex] ) )(i) += value;
126 virtual void Solve(
void) ITK_OVERRIDE;
129 virtual
void ScaleMatrix(Float scale,
unsigned int matrixIndex) ITK_OVERRIDE;
131 virtual
void SwapMatrices(
unsigned int matrixIndex1,
unsigned int matrixIndex2) ITK_OVERRIDE;
133 virtual
void SwapVectors(
unsigned int vectorIndex1,
unsigned int vectorIndex2) ITK_OVERRIDE;
135 virtual
void SwapSolutions(
unsigned int solutionIndex1,
unsigned int solutionIndex2) ITK_OVERRIDE;
137 virtual
void CopySolution2Vector(
unsigned solutionIndex,
unsigned int vectorIndex) ITK_OVERRIDE;
139 virtual
void CopyVector2Solution(
unsigned int vectorIndex,
unsigned int solutionIndex) ITK_OVERRIDE;
141 virtual
void MultiplyMatrixMatrix(
unsigned int resultMatrixIndex,
unsigned int leftMatrixIndex,
142 unsigned int rightMatrixIndex) ITK_OVERRIDE;
144 virtual
void MultiplyMatrixVector(
unsigned int resultVectorIndex,
unsigned int matrixIndex,
unsigned int vectorIndex) ITK_OVERRIDE;
153 std::vector<vnl_vector<
Float> *> *m_Vectors;
156 std::vector<vnl_vector<
Float> *> *m_Solutions;
virtual void SetVectorValue(unsigned int i, Float value, unsigned int vectorIndex) override
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
LinearSystemWrapper Superclass
virtual Float GetVectorValue(unsigned int i, unsigned int vectorIndex) const override
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