ITK  4.8.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Private Attributes | List of all members
itk::fem::LinearSystemWrapperDenseVNL Class Reference

#include <itkFEMLinearSystemWrapperDenseVNL.h>

+ Inheritance diagram for itk::fem::LinearSystemWrapperDenseVNL:
+ Collaboration diagram for itk::fem::LinearSystemWrapperDenseVNL:

Detailed Description

LinearSystemWrapper class that uses VNL numeric library functions to define a sparse linear system of equations.

See Also
LinearSystemWrapper

Definition at line 39 of file itkFEMLinearSystemWrapperDenseVNL.h.

Public Types

typedef LinearSystemWrapper::Float Float
 
typedef std::vector
< MatrixRepresentation * > 
MatrixHolder
 
typedef vnl_matrix< FloatMatrixRepresentation
 
typedef LinearSystemWrapper SuperClass
 
- Public Types inherited from itk::fem::LinearSystemWrapper
typedef std::vector< unsigned int > ColumnArray
 
typedef const SelfConstPointer
 
typedef SelfPointer
 
typedef LinearSystemWrapper Self
 
typedef Solution Superclass
 
- Public Types inherited from itk::fem::Solution
typedef const SelfConstPointer
 
typedef double Float
 
typedef SelfPointer
 
typedef Solution Self
 
typedef Solution Superclass
 

Public Member Functions

virtual void AddMatrixValue (unsigned int i, unsigned int j, Float value, unsigned int matrixIndex) override
 
virtual void AddSolutionValue (unsigned int i, Float value, unsigned int solutionIndex) override
 
virtual void AddVectorValue (unsigned int i, Float value, unsigned int vectorIndex) override
 
virtual void CopySolution2Vector (unsigned solutionIndex, unsigned int vectorIndex) override
 
virtual void CopyVector2Solution (unsigned int vectorIndex, unsigned int solutionIndex) override
 
virtual void DestroyMatrix (unsigned int matrixIndex) override
 
virtual void DestroySolution (unsigned int solutionIndex) override
 
virtual void DestroyVector (unsigned int vectorIndex) override
 
virtual Float GetMatrixValue (unsigned int i, unsigned int j, unsigned int matrixIndex) const override
 
virtual Float GetSolutionValue (unsigned int i, unsigned int solutionIndex) const override
 
virtual Float GetVectorValue (unsigned int i, unsigned int vectorIndex) const override
 
virtual void InitializeMatrix (unsigned int matrixIndex) override
 
virtual void InitializeSolution (unsigned int solutionIndex) override
 
virtual void InitializeVector (unsigned int vectorIndex) override
 
virtual bool IsMatrixInitialized (unsigned int matrixIndex) override
 
virtual bool IsSolutionInitialized (unsigned int solutionIndex) override
 
virtual bool IsVectorInitialized (unsigned int vectorIndex) override
 
 LinearSystemWrapperDenseVNL ()
 
virtual void MultiplyMatrixMatrix (unsigned int resultMatrixIndex, unsigned int leftMatrixIndex, unsigned int rightMatrixIndex) override
 
virtual void MultiplyMatrixVector (unsigned int resultVectorIndex, unsigned int matrixIndex, unsigned int vectorIndex) override
 
virtual void ScaleMatrix (Float scale, unsigned int matrixIndex) override
 
virtual void ScaleSolution (Float scale, unsigned int solutionIndex)
 
virtual void ScaleVector (Float scale, unsigned int vectorIndex)
 
virtual void SetMatrixValue (unsigned int i, unsigned int j, Float value, unsigned int matrixIndex) override
 
virtual void SetMaximumNonZeroValuesInMatrix (unsigned int, unsigned int)
 
virtual void SetSolutionValue (unsigned int i, Float value, unsigned int solutionIndex) override
 
virtual void SetVectorValue (unsigned int i, Float value, unsigned int vectorIndex) override
 
virtual void Solve (void) override
 
virtual void SwapMatrices (unsigned int matrixIndex1, unsigned int matrixIndex2) override
 
virtual void SwapSolutions (unsigned int solutionIndex1, unsigned int solutionIndex2) override
 
virtual void SwapVectors (unsigned int vectorIndex1, unsigned int vectorIndex2) override
 
virtual ~LinearSystemWrapperDenseVNL ()
 
- Public Member Functions inherited from itk::fem::LinearSystemWrapper
virtual void AddMatrixMatrix (unsigned int matrixIndex1, unsigned int matrixIndex2)
 
virtual void AddVectorVector (unsigned int vectorIndex1, unsigned int vectorIndex2)
 
virtual void Clean ()
 
virtual void CopyMatrix (unsigned int matrixIndex1, unsigned int matrixIndex2)
 
virtual void CopySolution2Vector (unsigned int solutionIndex, unsigned int vectorIndex)=0
 
virtual void CopyVector (unsigned int vectorSource, unsigned int vectorDestination)
 
virtual void GetColumnsOfNonZeroMatrixElementsInRow (unsigned int row, ColumnArray &cols, unsigned int matrixIndex=0)
 
unsigned int GetNumberOfMatrices () const
 
unsigned int GetNumberOfSolutions () const
 
unsigned int GetNumberOfVectors () const
 
unsigned int GetSystemOrder () const
 
virtual void MultiplyMatrixSolution (unsigned int resultVectorIndex, unsigned int matrixIndex, unsigned int solutionIndex)
 
virtual void OptimizeMatrixStorage (unsigned int matrixIndex, unsigned int tempMatrixIndex)
 
virtual void ReverseCuthillMckeeOrdering (ColumnArray &newNumbering, unsigned int matrixIndex=0)
 
void ScaleSolution (Float scale, unsigned int solutionIndex=0)
 
void ScaleVector (Float scale, unsigned int vectorIndex=0)
 
void SetNumberOfMatrices (unsigned int nMatrices)
 
void SetNumberOfSolutions (unsigned int nSolutions)
 
void SetNumberOfVectors (unsigned int nVectors)
 
void SetSystemOrder (unsigned int N)
 
virtual ~LinearSystemWrapper ()
 
 LinearSystemWrapper ()
 
- Public Member Functions inherited from itk::fem::Solution
virtual ~Solution ()
 

Private Attributes

MatrixHolderm_Matrices
 
std::vector< vnl_vector< Float > * > * m_Solutions
 
std::vector< vnl_vector< Float > * > * m_Vectors
 

Additional Inherited Members

- Protected Attributes inherited from itk::fem::LinearSystemWrapper
unsigned int m_NumberOfMatrices
 
unsigned int m_NumberOfSolutions
 
unsigned int m_NumberOfVectors
 
unsigned int m_Order
 

Member Typedef Documentation

Definition at line 44 of file itkFEMLinearSystemWrapperDenseVNL.h.

Definition at line 53 of file itkFEMLinearSystemWrapperDenseVNL.h.

Definition at line 50 of file itkFEMLinearSystemWrapperDenseVNL.h.

Definition at line 47 of file itkFEMLinearSystemWrapperDenseVNL.h.

Constructor & Destructor Documentation

itk::fem::LinearSystemWrapperDenseVNL::LinearSystemWrapperDenseVNL ( )
inline

Definition at line 56 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual itk::fem::LinearSystemWrapperDenseVNL::~LinearSystemWrapperDenseVNL ( )
virtual

Member Function Documentation

virtual void itk::fem::LinearSystemWrapperDenseVNL::AddMatrixValue ( unsigned int  i,
unsigned int  j,
Float  value,
unsigned int  matrixIndex 
)
inlineoverridevirtual

Virtual function to add a value to a specific element of the A matrix.

Parameters
irow of the element
jcolumn of the element
valuevalue to add to the existing element
matrixIndexindex of matrix to add value to

Implements itk::fem::LinearSystemWrapper.

Definition at line 95 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual void itk::fem::LinearSystemWrapperDenseVNL::AddSolutionValue ( unsigned int  i,
Float  value,
unsigned int  solutionIndex 
)
inlineoverridevirtual

Virtual function to add a value of specific element of the solution vector.

Parameters
ielement Index in solution vector
valuenew value of the element
solutionIndexindex of solution vector to add value to

Implements itk::fem::LinearSystemWrapper.

Definition at line 122 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual void itk::fem::LinearSystemWrapperDenseVNL::AddVectorValue ( unsigned int  i,
Float  value,
unsigned int  vectorIndex 
)
inlineoverridevirtual

Virtual function to add a value to a specific element of the B vector.

Parameters
irow of the element
valuevalue to add to the existing element
vectorIndexindex of vector to add value to

Implements itk::fem::LinearSystemWrapper.

Definition at line 110 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual void itk::fem::LinearSystemWrapperDenseVNL::CopySolution2Vector ( unsigned  solutionIndex,
unsigned int  vectorIndex 
)
overridevirtual
virtual void itk::fem::LinearSystemWrapperDenseVNL::CopyVector2Solution ( unsigned int  vectorIndex,
unsigned int  solutionIndex 
)
overridevirtual

Copy a vector to a solution vector

Parameters
vectorIndexindex of a vector to copy
solutionIndexindex of a solution to copy the solution to

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::DestroyMatrix ( unsigned int  matrixIndex)
overridevirtual

Free the memory from a matrix

Parameters
matrixIndexindex of matrix to destroy

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::DestroySolution ( unsigned int  solutionIndex)
overridevirtual

Free the memory from a solution vector

Parameters
solutionIndexindex of solution vector to destroy

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::DestroyVector ( unsigned int  vectorIndex)
overridevirtual

Free the memory from a vector

Parameters
vectorIndexindex of vector to destroy

Implements itk::fem::LinearSystemWrapper.

virtual Float itk::fem::LinearSystemWrapperDenseVNL::GetMatrixValue ( unsigned int  i,
unsigned int  j,
unsigned int  matrixIndex 
) const
inlineoverridevirtual

Virtual function to get a value of a specific element of a matrix.

Parameters
irow of the element
jcolumn of the element
matrixIndexindex of matrix to get value from

Implements itk::fem::LinearSystemWrapper.

Definition at line 85 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual Float itk::fem::LinearSystemWrapperDenseVNL::GetSolutionValue ( unsigned int  i,
unsigned int  solutionIndex 
) const
overridevirtual

Returns value of i-th element in a solution vector. This value is calculated generalized displacement of the i-th degree of freedom in a FEM problem. Note that in general there may be several solution vectors. You can select which one do you want by passing the second parameter.

Parameters
ielement index in solution vector
solutionIndexindex of solution vector to get value from
Note
If the solution vector doesn't exist (problem was not yet solved), or the index i is out of range, the function returns 0.0.

Implements itk::fem::Solution.

virtual Float itk::fem::LinearSystemWrapperDenseVNL::GetVectorValue ( unsigned int  i,
unsigned int  vectorIndex 
) const
inlineoverridevirtual

Virtual function to get a value of a specific element of the B vector.

Parameters
irow of the element
vectorIndexindex of vector to get value from

Implements itk::fem::LinearSystemWrapper.

Definition at line 100 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual void itk::fem::LinearSystemWrapperDenseVNL::InitializeMatrix ( unsigned int  matrixIndex)
overridevirtual

Initialization of the A matrix. First any existing data for matrix A must be be destroyed, and then a new matrix is created in the memory. All elements in A must be set to zero.

Parameters
matrixIndexindex of matrix to initialize

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::InitializeSolution ( unsigned int  solutionIndex)
overridevirtual

Initialization of a solution vector. Existing memory must be destroyed and the new solution vector is created in memory. All values should be set to zero.

Parameters
solutionIndexindex of solution vector to initialize

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::InitializeVector ( unsigned int  vectorIndex)
overridevirtual

Initialization of the a vector. First any existing data for vector B must be destroyed, then new vector is created in the memory. All elements in B must be set to zero.

Implements itk::fem::LinearSystemWrapper.

virtual bool itk::fem::LinearSystemWrapperDenseVNL::IsMatrixInitialized ( unsigned int  matrixIndex)
overridevirtual

Check to see if matrix is initialized

Parameters
matrixIndexindex of matrix to examine

Implements itk::fem::LinearSystemWrapper.

virtual bool itk::fem::LinearSystemWrapperDenseVNL::IsSolutionInitialized ( unsigned int  solutionIndex)
overridevirtual

Check to see if solution vector is initialized

Parameters
solutionIndexindex of solution vector to examine

Implements itk::fem::LinearSystemWrapper.

virtual bool itk::fem::LinearSystemWrapperDenseVNL::IsVectorInitialized ( unsigned int  vectorIndex)
overridevirtual

Check to see if vector is initialized

Parameters
vectorIndexvector of index to examine

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::MultiplyMatrixMatrix ( unsigned int  resultMatrixIndex,
unsigned int  leftMatrixIndex,
unsigned int  rightMatrixIndex 
)
overridevirtual

Perform a matrix*matrix operation and store the result in the linear system

Parameters
leftMatrixIndexindex of left matrix
rightMatrixIndexindex of right matrix
resultMatrixIndexindex of matrix where solution is stored

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::MultiplyMatrixVector ( unsigned int  resultVectorIndex,
unsigned int  matrixIndex,
unsigned int  vectorIndex 
)
overridevirtual

Perform a matrix*vector operation and store the result in the linear system

Parameters
matrixIndexindex of matrix to multiply
vectorIndexindex of vector to multiply
resultVectorIndexindex of vector where result is store

Reimplemented from itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::ScaleMatrix ( Float  scale,
unsigned int  matrixIndex 
)
overridevirtual

Multiplies all elements of a matrix by a scalar

Parameters
scalescalar to multiply all matrix values by
matrixIndexindex of matrix to modify

Reimplemented from itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::ScaleSolution ( Float  scale,
unsigned int  solutionIndex 
)
virtual
virtual void itk::fem::LinearSystemWrapperDenseVNL::ScaleVector ( Float  scale,
unsigned int  vectorIndex 
)
virtual
virtual void itk::fem::LinearSystemWrapperDenseVNL::SetMatrixValue ( unsigned int  i,
unsigned int  j,
Float  value,
unsigned int  matrixIndex 
)
inlineoverridevirtual

Virtual function to set a value of a specific element of the A matrix.

Parameters
irow of the element
jcolumn of the element
valuenew value of the element
matrixIndexindex of matrix to set value in

Implements itk::fem::LinearSystemWrapper.

Definition at line 90 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual void itk::fem::LinearSystemWrapperDenseVNL::SetMaximumNonZeroValuesInMatrix ( unsigned  int,
unsigned  int 
)
inlinevirtual

Definition at line 80 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual void itk::fem::LinearSystemWrapperDenseVNL::SetSolutionValue ( unsigned int  i,
Float  value,
unsigned int  solutionIndex 
)
inlineoverridevirtual

Virtual function to set a value of specific element of the solution vector.

Parameters
ielement Index in solution vector
valuenew value of the element
solutionIndexindex of solution vector to set value in

Implements itk::fem::LinearSystemWrapper.

Definition at line 117 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual void itk::fem::LinearSystemWrapperDenseVNL::SetVectorValue ( unsigned int  i,
Float  value,
unsigned int  vectorIndex 
)
inlineoverridevirtual

Virtual function to set a value of a specific element of the B vector.

Parameters
irow of the element
valuenew value of the element
vectorIndexindex of vector to set value in

Implements itk::fem::LinearSystemWrapper.

Definition at line 105 of file itkFEMLinearSystemWrapperDenseVNL.h.

virtual void itk::fem::LinearSystemWrapperDenseVNL::Solve ( void  )
overridevirtual

Solves the linear system and creates the solution vector, which can later be accessed via GetSolutionValue(i,SolutionIndex) member function. Here all the major processing is done with calls to external numeric library.

Note
This function can only be called after the linear system was properly assembled.

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::SwapMatrices ( unsigned int  matrixIndex1,
unsigned int  matrixIndex2 
)
overridevirtual

Swaps access indices of any 2 matrices in the linear system

Parameters
matrixIndex1index of a matrix to swap
matrixIndex2index of matrix to swap with

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::SwapSolutions ( unsigned int  solutionIndex1,
unsigned int  solutionIndex2 
)
overridevirtual

Swaps access indices of any 2 solution vectors in the linear system

Parameters
solutionIndex1index of a solution vector to swap
solutionIndex2index of solution vector to swap with

Implements itk::fem::LinearSystemWrapper.

virtual void itk::fem::LinearSystemWrapperDenseVNL::SwapVectors ( unsigned int  vectorIndex1,
unsigned int  vectorIndex2 
)
overridevirtual

Swaps access indices of any 2 vectors in the linear system

Parameters
vectorIndex1index of a vector to swap
vectorIndex2index of vector to swap with

Implements itk::fem::LinearSystemWrapper.

Member Data Documentation

MatrixHolder* itk::fem::LinearSystemWrapperDenseVNL::m_Matrices
private

vector of pointers to VNL sparse matrices

Definition at line 155 of file itkFEMLinearSystemWrapperDenseVNL.h.

std::vector<vnl_vector<Float> *>* itk::fem::LinearSystemWrapperDenseVNL::m_Solutions
private

vector of pointers to VNL vectors

Definition at line 161 of file itkFEMLinearSystemWrapperDenseVNL.h.

std::vector<vnl_vector<Float> *>* itk::fem::LinearSystemWrapperDenseVNL::m_Vectors
private

vector of pointers to VNL vectors

Definition at line 158 of file itkFEMLinearSystemWrapperDenseVNL.h.


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