#include <itkFEMLinearSystemWrapper.h>
Inheritance diagram for itk::fem::LinearSystemWrapper:
Public Types | |
typedef LinearSystemWrapper | Self |
typedef Solution | Superclass |
typedef Self * | Pointer |
typedef const Self * | ConstPointer |
typedef std::vector< unsigned int > | ColumnArray |
Public Member Functions | |
virtual | ~LinearSystemWrapper () |
virtual void | Clean (void) |
void | SetSystemOrder (unsigned int N) |
unsigned int | GetSystemOrder () const |
void | SetNumberOfMatrices (unsigned int nMatrices) |
unsigned int | GetNumberOfMatrices () |
void | SetNumberOfVectors (unsigned int nVectors) |
unsigned int | GetNumberOfVectors () |
void | SetNumberOfSolutions (unsigned int nSolutions) |
unsigned int | GetNumberOfSolutions () |
virtual void | InitializeMatrix (unsigned int matrixIndex=0)=0 |
virtual bool | IsMatrixInitialized (unsigned int matrixIndex=0)=0 |
virtual void | DestroyMatrix (unsigned int matrixIndex=0)=0 |
virtual void | InitializeVector (unsigned int vectorIndex=0)=0 |
virtual bool | IsVectorInitialized (unsigned int vectorIndex=0)=0 |
virtual void | DestroyVector (unsigned int vectorIndex=0)=0 |
virtual void | InitializeSolution (unsigned int solutionIndex=0)=0 |
virtual bool | IsSolutionInitialized (unsigned int solutionIndex=0)=0 |
virtual void | DestroySolution (unsigned int solutionIndex=0)=0 |
virtual Float | GetMatrixValue (unsigned int i, unsigned int j, unsigned int matrixIndex=0) const =0 |
virtual void | SetMatrixValue (unsigned int i, unsigned int j, Float value, unsigned int matrixIndex=0)=0 |
virtual void | AddMatrixValue (unsigned int i, unsigned int j, Float value, unsigned int matrixIndex=0)=0 |
virtual void | GetColumnsOfNonZeroMatrixElementsInRow (unsigned int row, ColumnArray &cols, unsigned int matrixIndex=0) |
virtual Float | GetVectorValue (unsigned int i, unsigned int vectorIndex=0) const =0 |
virtual void | SetVectorValue (unsigned int i, Float value, unsigned int vectorIndex=0)=0 |
virtual void | AddVectorValue (unsigned int i, Float value, unsigned int vectorIndex=0)=0 |
virtual void | SetSolutionValue (unsigned int i, Float value, unsigned int solutionIndex=0)=0 |
virtual void | AddSolutionValue (unsigned int i, Float value, unsigned int solutionIndex=0)=0 |
virtual void | Solve (void)=0 |
virtual void | SwapMatrices (unsigned int matrixIndex1, unsigned int matrixIndex2)=0 |
virtual void | CopyMatrix (unsigned int matrixIndex1, unsigned int matrixIndex2) |
virtual void | SwapVectors (unsigned int vectorIndex1, unsigned int vectorIndex2)=0 |
virtual void | SwapSolutions (unsigned int solutionIndex1, unsigned int solutionIndex2)=0 |
virtual void | ScaleMatrix (Float scale, unsigned int matrixIndex=0) |
void | ScaleVector (Float scale, unsigned int vectorIndex=0) |
void | ScaleSolution (Float scale, unsigned int solutionIndex=0) |
virtual void | MultiplyMatrixMatrix (unsigned int resultMatrixIndex, unsigned int leftMatrixIndex, unsigned int rightMatrixIndex)=0 |
virtual void | AddMatrixMatrix (unsigned int matrixIndex1, unsigned int matrixIndex2) |
virtual void | AddVectorVector (unsigned int vectorIndex1, unsigned int vectorIndex2) |
virtual void | MultiplyMatrixVector (unsigned int resultVectorIndex, unsigned int matrixIndex, unsigned int vectorIndex) |
virtual void | CopySolution2Vector (unsigned int solutionIndex, unsigned int vectorIndex)=0 |
virtual void | CopyVector2Solution (unsigned int vectorIndex, unsigned int solutionIndex)=0 |
virtual void | CopyVector (unsigned int vectorSource, unsigned int vectorDestination) |
virtual void | OptimizeMatrixStorage (unsigned int matrixIndex, unsigned int tempMatrixIndex) |
virtual void | ReverseCuthillMckeeOrdering (ColumnArray &newNumbering, unsigned int matrixIndex=0) |
LinearSystemWrapper () | |
Protected Attributes | |
unsigned int | m_Order |
unsigned int | m_NumberOfMatrices |
unsigned int | m_NumberOfVectors |
unsigned int | m_NumberOfSolutions |
Linear system is defined as A*x=B, where A is a square matrix and F is a vector. Member functions are provided to access a specific element within A and B. Objects of derived classes should make appropriate calls to the numeric library in implementation of virtual functions to assemble and solve the linear system.
See comments for each virtual member for more information about how to derive a new LinearSystemWrapper class. An example derived class LinearSystemWrapperVNL is defined to use VNL sparse matrix representation and solver.
Definition at line 51 of file itkFEMLinearSystemWrapper.h.
|
Definition at line 67 of file itkFEMLinearSystemWrapper.h. |
|
Const pointer to an object. Reimplemented from itk::fem::Solution. Definition at line 65 of file itkFEMLinearSystemWrapper.h. |
|
Pointer to an object. Reimplemented from itk::fem::Solution. Definition at line 62 of file itkFEMLinearSystemWrapper.h. Referenced by itk::fem::Solver::SetTimeStep(). |
|
Standard "Self" typedef. Reimplemented from itk::fem::Solution.
Reimplemented in itk::fem::LinearSystemWrapperItpack. Definition at line 56 of file itkFEMLinearSystemWrapper.h. |
|
Standard "Superclass" typedef. Reimplemented from itk::fem::Solution.
Reimplemented in itk::fem::LinearSystemWrapperItpack. Definition at line 59 of file itkFEMLinearSystemWrapper.h. |
|
Constructor for linear system, should perform any initialization that is required by derived class. Definition at line 73 of file itkFEMLinearSystemWrapper.h. References m_NumberOfMatrices, m_NumberOfSolutions, m_NumberOfVectors, and m_Order. |
|
Virtual destructor should properly destroy the object and clean up any memory allocated for matrix and vector storage. Definition at line 82 of file itkFEMLinearSystemWrapper.h. |
|
Adds two matrices storing the result in the first matrix.
|
|
Virtual function to add a value to a specific element of the A matrix.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Virtual function to add a value of specific element of the solution vector.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Virtual function to add a value to a specific element of the B vector.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Adds two vectors storing the result in the first vector.
|
|
Clear all the data (matrices) inside the system, so that the system is ready to solve another problem from scratch. |
|
Copies the content of source matrix to destination matrix. Any existing data in destination matrix is overwritten.
|
|
Copy a solution vector to a vector
|
|
Copy a vector
|
|
Copy a vector to a solution vector
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Free the memory from a matrix
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Free teh mememory from a solution vector
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Free the memory from a vector
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Returns the column index (zero based) of the i-th non zero (non allocated)element in a given row of A matrix. This function is usefull for optimizations when sparse matrices are used. Note that the value of an element with returned column index may actually be equal zero.
Reimplemented in itk::fem::LinearSystemWrapperItpack.
|
|
Virtual function to get a value of a specific element of a matrix.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Get Index of matrices used by system Definition at line 120 of file itkFEMLinearSystemWrapper.h. |
|
Get Index of solutions used by system Definition at line 142 of file itkFEMLinearSystemWrapper.h. |
|
Get Index of vectors used by system Definition at line 131 of file itkFEMLinearSystemWrapper.h. |
|
Get the order of the system Definition at line 100 of file itkFEMLinearSystemWrapper.h. |
|
Virtual function to get a value of a specific element of the B vector.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
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.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
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.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
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. Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Check to see if matrix is initialized
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Check to see if solution vector is initialized
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Check to see if vector is initialized
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Perform a matrix*matrix operation and store the result in the linear system
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Perform a matrix*vector operation and store the result in the linear system
Reimplemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Remove all zeros from a matrix
|
|
Reorder the Degrees of Freedom in order to reduce bandwidth of matrix
|
|
Multiplies all elements of a matrix by a scalar
Reimplemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Multiplies all elements of a solution by a scalar
Reimplemented in itk::fem::LinearSystemWrapperDenseVNL.
|
|
Multiplies all elements of a vector by a scalar
Reimplemented in itk::fem::LinearSystemWrapperDenseVNL.
|
|
Virtual function to set a value of a specific element of the A matrix.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Set Index of matrices used by the system
References m_NumberOfMatrices. |
|
Set Index of solutions used by the system
|
|
Set Index of vectors used by the system
|
|
Virtual function to set a value of specific element of the solution vector.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Set the order of the system. All matrices will be of size NxN and all vectors will be of size N
|
|
Virtual function to set a value of a specific element of the B vector.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
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.
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Swaps access indices of any 2 matrices in the linear system
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Swaps access indices of any 2 solution vectors in the linear system
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Swaps access indices of any 2 vectors in the linear system
Implemented in itk::fem::LinearSystemWrapperDenseVNL, itk::fem::LinearSystemWrapperItpack, and itk::fem::LinearSystemWrapperVNL.
|
|
Number of matrices used by system Definition at line 463 of file itkFEMLinearSystemWrapper.h. Referenced by LinearSystemWrapper(), and SetNumberOfMatrices(). |
|
Number of solutions used by system Definition at line 473 of file itkFEMLinearSystemWrapper.h. Referenced by LinearSystemWrapper(). |
|
Number of vectors used by system Definition at line 468 of file itkFEMLinearSystemWrapper.h. Referenced by LinearSystemWrapper(). |
|
Order of linear system Definition at line 458 of file itkFEMLinearSystemWrapper.h. Referenced by LinearSystemWrapper(). |