Orfeo Toolbox  3.16
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
itk::fem::LinearSystemWrapper Class Referenceabstract

Defines all functions required by Solver class to allocate, assemble and solve a linear system of equation. More...

#include <itkFEMLinearSystemWrapper.h>

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

Public Types

typedef std::vector< unsigned int > ColumnArray
 
typedef const SelfConstPointer
 
typedef double Float
 
typedef SelfPointer
 
typedef LinearSystemWrapper Self
 
typedef Solution Superclass
 

Public Member Functions

 LinearSystemWrapper ()
 
virtual ~LinearSystemWrapper ()
 
virtual void AddMatrixMatrix (unsigned int matrixIndex1, unsigned int matrixIndex2)
 
virtual void AddMatrixValue (unsigned int i, unsigned int j, Float value, unsigned int matrixIndex=0)=0
 
virtual void AddSolutionValue (unsigned int i, Float value, unsigned int solutionIndex=0)=0
 
virtual void AddVectorValue (unsigned int i, Float value, unsigned int vectorIndex=0)=0
 
virtual void AddVectorVector (unsigned int vectorIndex1, unsigned int vectorIndex2)
 
virtual void Clean (void)
 
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 CopyVector2Solution (unsigned int vectorIndex, unsigned int solutionIndex)=0
 
virtual void DestroyMatrix (unsigned int matrixIndex=0)=0
 
virtual void DestroySolution (unsigned int solutionIndex=0)=0
 
virtual void DestroyVector (unsigned int vectorIndex=0)=0
 
virtual void GetColumnsOfNonZeroMatrixElementsInRow (unsigned int row, ColumnArray &cols, unsigned int matrixIndex=0)
 
virtual Float GetMatrixValue (unsigned int i, unsigned int j, unsigned int matrixIndex=0) const =0
 
unsigned int GetNumberOfMatrices ()
 
unsigned int GetNumberOfSolutions ()
 
unsigned int GetNumberOfVectors ()
 
virtual Float GetSolutionValue (unsigned int i, unsigned int solutionIndex=0) const =0
 
unsigned int GetSystemOrder () const
 
virtual Float GetVectorValue (unsigned int i, unsigned int vectorIndex=0) const =0
 
virtual void InitializeMatrix (unsigned int matrixIndex=0)=0
 
virtual void InitializeSolution (unsigned int solutionIndex=0)=0
 
virtual void InitializeVector (unsigned int vectorIndex=0)=0
 
virtual bool IsMatrixInitialized (unsigned int matrixIndex=0)=0
 
virtual bool IsSolutionInitialized (unsigned int solutionIndex=0)=0
 
virtual bool IsVectorInitialized (unsigned int vectorIndex=0)=0
 
virtual void MultiplyMatrixMatrix (unsigned int resultMatrixIndex, unsigned int leftMatrixIndex, unsigned int rightMatrixIndex)=0
 
virtual void MultiplyMatrixVector (unsigned int resultVectorIndex, unsigned int matrixIndex, unsigned int vectorIndex)
 
virtual void OptimizeMatrixStorage (unsigned int matrixIndex, unsigned int tempMatrixIndex)
 
virtual void ReverseCuthillMckeeOrdering (ColumnArray &newNumbering, unsigned int matrixIndex=0)
 
virtual void ScaleMatrix (Float scale, unsigned int matrixIndex=0)
 
void ScaleSolution (Float scale, unsigned int solutionIndex=0)
 
void ScaleVector (Float scale, unsigned int vectorIndex=0)
 
virtual void SetMatrixValue (unsigned int i, unsigned int j, Float value, unsigned int matrixIndex=0)=0
 
void SetNumberOfMatrices (unsigned int nMatrices)
 
void SetNumberOfSolutions (unsigned int nSolutions)
 
void SetNumberOfVectors (unsigned int nVectors)
 
virtual void SetSolutionValue (unsigned int i, Float value, unsigned int solutionIndex=0)=0
 
void SetSystemOrder (unsigned int N)
 
virtual void SetVectorValue (unsigned int i, Float value, unsigned int vectorIndex=0)=0
 
virtual void Solve (void)=0
 
virtual void SwapMatrices (unsigned int matrixIndex1, unsigned int matrixIndex2)=0
 
virtual void SwapSolutions (unsigned int solutionIndex1, unsigned int solutionIndex2)=0
 
virtual void SwapVectors (unsigned int vectorIndex1, unsigned int vectorIndex2)=0
 

Protected Attributes

unsigned int m_NumberOfMatrices
 
unsigned int m_NumberOfSolutions
 
unsigned int m_NumberOfVectors
 
unsigned int m_Order
 

Private Member Functions

 LinearSystemWrapper (const LinearSystemWrapper &)
 
void CuthillMckeeOrdering (ColumnArray &newNumbering, int startingRow, unsigned int matrixIndex=0)
 
void FollowConnectionsCuthillMckeeOrdering (unsigned int rowNumber, ColumnArray &rowDegree, ColumnArray &newNumbering, unsigned int nextRowNumber, unsigned int matrixIndex=0)
 
const LinearSystemWrapperoperator= (const LinearSystemWrapper &)
 

Detailed Description

Defines all functions required by Solver class to allocate, assemble and solve a linear system of equation.

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.

See Also
Solver::SetLinearSystemWrapper

Definition at line 51 of file itkFEMLinearSystemWrapper.h.

Member Typedef Documentation

typedef std::vector<unsigned int> itk::fem::LinearSystemWrapper::ColumnArray

Definition at line 59 of file itkFEMLinearSystemWrapper.h.

Definition at line 57 of file itkFEMLinearSystemWrapper.h.

typedef double itk::fem::Solution::Float
inherited

Floating point storage type used within a class

Definition at line 47 of file itkFEMSolution.h.

Definition at line 56 of file itkFEMLinearSystemWrapper.h.

Definition at line 54 of file itkFEMLinearSystemWrapper.h.

Definition at line 55 of file itkFEMLinearSystemWrapper.h.

Constructor & Destructor Documentation

itk::fem::LinearSystemWrapper::LinearSystemWrapper ( )
inline

Constructor for linear system, should perform any initialization that is required by derived class.

Definition at line 65 of file itkFEMLinearSystemWrapper.h.

virtual itk::fem::LinearSystemWrapper::~LinearSystemWrapper ( )
inlinevirtual

Virtual destructor should properly destroy the object and clean up any memory allocated for matrix and vector storage.

Definition at line 73 of file itkFEMLinearSystemWrapper.h.

itk::fem::LinearSystemWrapper::LinearSystemWrapper ( const LinearSystemWrapper )
private

Copy constructor is not allowed.

Member Function Documentation

void itk::fem::LinearSystemWrapper::AddMatrixMatrix ( unsigned int  matrixIndex1,
unsigned int  matrixIndex2 
)
virtual

Adds two matrices storing the result in the first matrix.

Parameters
matrixIndex1index of a matrix to add the other matrix to
matrixIndex2index of matrix to add

Definition at line 214 of file itkFEMLinearSystemWrapper.cxx.

void itk::fem::LinearSystemWrapper::AddMatrixValue ( unsigned int  i,
unsigned int  j,
Float  value,
unsigned int  matrixIndex = 0 
)
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Definition at line 123 of file itkFEMLinearSystemWrapper.cxx.

References GetMatrixValue(), and SetMatrixValue().

Referenced by itk::fem::Solver::AssembleElementMatrix(), itk::fem::SolverCrankNicolson::AssembleKandM(), and itk::fem::Solver::AssembleLandmarkContribution().

void itk::fem::LinearSystemWrapper::AddSolutionValue ( unsigned int  i,
Float  value,
unsigned int  solutionIndex = 0 
)
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Definition at line 128 of file itkFEMLinearSystemWrapper.cxx.

References itk::fem::Solution::GetSolutionValue(), and SetSolutionValue().

Referenced by itk::fem::SolverCrankNicolson::AddToDisplacements().

void itk::fem::LinearSystemWrapper::AddVectorValue ( unsigned int  i,
Float  value,
unsigned int  vectorIndex = 0 
)
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Definition at line 118 of file itkFEMLinearSystemWrapper.cxx.

References GetVectorValue(), and SetVectorValue().

Referenced by itk::fem::SolverCrankNicolson::AddToDisplacements(), itk::fem::Solver::ApplyBC(), itk::fem::Solver::AssembleF(), and MultiplyMatrixVector().

void itk::fem::LinearSystemWrapper::AddVectorVector ( unsigned int  vectorIndex1,
unsigned int  vectorIndex2 
)
virtual

Adds two vectors storing the result in the first vector.

Parameters
vectorIndex1index of a vector to add the other vector to
vectorIndex2index of vector to add

Definition at line 242 of file itkFEMLinearSystemWrapper.cxx.

void itk::fem::LinearSystemWrapper::Clean ( void  )
virtual

Clear all the data (matrices) inside the system, so that the system is ready to solve another problem from scratch.

Definition at line 31 of file itkFEMLinearSystemWrapper.cxx.

References DestroyMatrix(), DestroySolution(), DestroyVector(), m_NumberOfMatrices, m_NumberOfSolutions, m_NumberOfVectors, and SetSystemOrder().

void itk::fem::LinearSystemWrapper::CopyMatrix ( unsigned int  matrixIndex1,
unsigned int  matrixIndex2 
)
virtual

Copies the content of source matrix to destination matrix. Any existing data in destination matrix is overwritten.

Parameters
matrixIndex1index of a matrix that will be copied
matrixIndex2index of matrix to copy to

Definition at line 195 of file itkFEMLinearSystemWrapper.cxx.

virtual void itk::fem::LinearSystemWrapper::CopySolution2Vector ( unsigned int  solutionIndex,
unsigned int  vectorIndex 
)
pure virtual

Copy a solution vector to a vector

Parameters
solutionIndexindex of solution vector to copy
vectorIndexindex of vector to copy solution to
void itk::fem::LinearSystemWrapper::CopyVector ( unsigned int  vectorSource,
unsigned int  vectorDestination 
)
virtual

Copy a vector

Parameters
vectorSourceindex of a vector to copy
vectorDestinationindex to copy the vector to

Definition at line 231 of file itkFEMLinearSystemWrapper.cxx.

virtual void itk::fem::LinearSystemWrapper::CopyVector2Solution ( unsigned int  vectorIndex,
unsigned int  solutionIndex 
)
pure virtual

Copy a vector to a solution vector

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperDenseVNL, and itk::fem::LinearSystemWrapperVNL.

void itk::fem::LinearSystemWrapper::CuthillMckeeOrdering ( ColumnArray newNumbering,
int  startingRow,
unsigned int  matrixIndex = 0 
)
private
virtual void itk::fem::LinearSystemWrapper::DestroyMatrix ( unsigned int  matrixIndex = 0)
pure virtual

Free the memory from a matrix

Parameters
matrixIndexindex of matrix to destroy

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by Clean(), and OptimizeMatrixStorage().

virtual void itk::fem::LinearSystemWrapper::DestroySolution ( unsigned int  solutionIndex = 0)
pure virtual

Free teh mememory from a solution vector

Parameters
solutionIndexindex of solution vector to destroy

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by Clean().

virtual void itk::fem::LinearSystemWrapper::DestroyVector ( unsigned int  vectorIndex = 0)
pure virtual

Free the memory from a vector

Parameters
vectorIndexindex of vector to destroy

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by itk::fem::Solver::ApplyBC(), and Clean().

void itk::fem::LinearSystemWrapper::FollowConnectionsCuthillMckeeOrdering ( unsigned int  rowNumber,
ColumnArray rowDegree,
ColumnArray newNumbering,
unsigned int  nextRowNumber,
unsigned int  matrixIndex = 0 
)
private
void itk::fem::LinearSystemWrapper::GetColumnsOfNonZeroMatrixElementsInRow ( unsigned int  row,
ColumnArray cols,
unsigned int  matrixIndex = 0 
)
virtual

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.

Parameters
rowRow number
colsWhich element in that row. Can range from 0 to number of elements allocated in a row. If this is out of range, the function returns -1.
matrixIndexIndex of matrix (defaults to 0)

Reimplemented in itk::fem::LinearSystemWrapperItpack.

Definition at line 155 of file itkFEMLinearSystemWrapper.cxx.

References m_Order.

Referenced by itk::fem::Solver::ApplyBC(), CuthillMckeeOrdering(), FollowConnectionsCuthillMckeeOrdering(), and OptimizeMatrixStorage().

virtual Float itk::fem::LinearSystemWrapper::GetMatrixValue ( unsigned int  i,
unsigned int  j,
unsigned int  matrixIndex = 0 
) const
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by AddMatrixValue(), itk::fem::Solver::ApplyBC(), itk::fem::SolverCrankNicolson::EvaluateResidual(), itk::fem::SolverCrankNicolson::GetDeformationEnergy(), MultiplyMatrixVector(), OptimizeMatrixStorage(), and ScaleMatrix().

unsigned int itk::fem::LinearSystemWrapper::GetNumberOfMatrices ( )
inline

Set the maximum number of entries permitted in a matrix

Parameters
matrixIndexindex of matrix to set value for
maxNonZerosmaximum number of entries allowed in matrix
Note
in general this function does nothing, however it may redefined by the derived wrapper if necessary Get Index of matrices used by system

Definition at line 111 of file itkFEMLinearSystemWrapper.h.

References m_NumberOfMatrices.

unsigned int itk::fem::LinearSystemWrapper::GetNumberOfSolutions ( )
inline

Get Index of solutions used by system

Definition at line 133 of file itkFEMLinearSystemWrapper.h.

References m_NumberOfSolutions.

unsigned int itk::fem::LinearSystemWrapper::GetNumberOfVectors ( )
inline

Get Index of vectors used by system

Definition at line 122 of file itkFEMLinearSystemWrapper.h.

References m_NumberOfVectors.

virtual Float itk::fem::Solution::GetSolutionValue ( unsigned int  i,
unsigned int  solutionIndex = 0 
) const
pure virtualinherited

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.

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by AddSolutionValue(), itk::fem::SolverCrankNicolson::AddToDisplacements(), itk::fem::SolverCrankNicolson::AverageLastTwoDisplacements(), itk::fem::SolverCrankNicolson::EvaluateResidual(), itk::fem::SolverCrankNicolson::GetDeformationEnergy(), itk::fem::Solver::GetDeformationEnergy(), itk::fem::LoadLandmark::GetSolution(), itk::fem::ImageMetricLoad< TMoving, TFixed >::GetSolution(), itk::fem::FiniteDifferenceFunctionLoad< TMoving, TFixed >::GetSolution(), itk::fem::Solver::GetSolution(), itk::fem::ImageMetricLoadImplementation< TLoadClass >::Implementation(), itk::fem::Element::InterpolateSolution(), itk::fem::Element::InterpolateSolutionN(), itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::InterpolateVectorField(), itk::fem::SolverCrankNicolson::PrintDisplacements(), itk::fem::SolverCrankNicolson::PrintMinMaxOfSolution(), ScaleSolution(), and itk::fem::SolverCrankNicolson::SetEnergyToMin().

unsigned int itk::fem::LinearSystemWrapper::GetSystemOrder ( ) const
inline
virtual Float itk::fem::LinearSystemWrapper::GetVectorValue ( unsigned int  i,
unsigned int  vectorIndex = 0 
) const
pure virtual
virtual void itk::fem::LinearSystemWrapper::InitializeMatrix ( unsigned int  matrixIndex = 0)
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by itk::fem::SolverCrankNicolson::InitializeForSolution(), itk::fem::Solver::InitializeMatrixForAssembly(), and OptimizeMatrixStorage().

virtual void itk::fem::LinearSystemWrapper::InitializeSolution ( unsigned int  solutionIndex = 0)
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by itk::fem::SolverCrankNicolson::InitializeForSolution(), itk::fem::SolverCrankNicolson::Solve(), and itk::fem::Solver::Solve().

virtual void itk::fem::LinearSystemWrapper::InitializeVector ( unsigned int  vectorIndex = 0)
pure virtual

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::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by itk::fem::Solver::ApplyBC(), itk::fem::Solver::AssembleF(), itk::fem::SolverCrankNicolson::InitializeForSolution(), and MultiplyMatrixVector().

virtual bool itk::fem::LinearSystemWrapper::IsMatrixInitialized ( unsigned int  matrixIndex = 0)
pure virtual

Check to see if matrix is initialized

Parameters
matrixIndexindex of matrix to examine

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by itk::fem::Solver::Solve().

virtual bool itk::fem::LinearSystemWrapper::IsSolutionInitialized ( unsigned int  solutionIndex = 0)
pure virtual

Check to see if solution vector is initialized

Parameters
solutionIndexindex of solution vector to examine

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

virtual bool itk::fem::LinearSystemWrapper::IsVectorInitialized ( unsigned int  vectorIndex = 0)
pure virtual

Check to see if vector is initialized

Parameters
vectorIndexvector of index to examine

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by itk::fem::Solver::ApplyBC(), itk::fem::Solver::AssembleF(), and itk::fem::Solver::Solve().

virtual void itk::fem::LinearSystemWrapper::MultiplyMatrixMatrix ( unsigned int  resultMatrixIndex,
unsigned int  leftMatrixIndex,
unsigned int  rightMatrixIndex 
)
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperDenseVNL, and itk::fem::LinearSystemWrapperVNL.

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

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 in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperDenseVNL, and itk::fem::LinearSystemWrapperVNL.

Definition at line 134 of file itkFEMLinearSystemWrapper.cxx.

References AddVectorValue(), GetMatrixValue(), GetVectorValue(), InitializeVector(), and m_Order.

Referenced by itk::fem::SolverCrankNicolson::AssembleFforTimeStep().

const LinearSystemWrapper& itk::fem::LinearSystemWrapper::operator= ( const LinearSystemWrapper )
private

Asignment operator is not allowed.

void itk::fem::LinearSystemWrapper::OptimizeMatrixStorage ( unsigned int  matrixIndex,
unsigned int  tempMatrixIndex 
)
virtual

Remove all zeros from a matrix

Parameters
matrixIndexindex of matrix to remove zeros from
tempMatrixIndexindex of matrix to use for temp storage space
Note
an extra matrix must be allocated by the solver in order to use this method

Definition at line 166 of file itkFEMLinearSystemWrapper.cxx.

References DestroyMatrix(), GetColumnsOfNonZeroMatrixElementsInRow(), GetMatrixValue(), InitializeMatrix(), m_Order, SetMatrixValue(), and SwapMatrices().

void itk::fem::LinearSystemWrapper::ReverseCuthillMckeeOrdering ( ColumnArray newNumbering,
unsigned int  matrixIndex = 0 
)
virtual

Reorder the Degrees of Freedom in order to reduce bandwidth of matrix

Parameters
matrixIndexindex of matrix to examine
newNumberingvector of new degree of freedom ordering

Definition at line 252 of file itkFEMLinearSystemWrapper.cxx.

References CuthillMckeeOrdering().

void itk::fem::LinearSystemWrapper::ScaleMatrix ( Float  scale,
unsigned int  matrixIndex = 0 
)
virtual

Multiplies all elements of a matrix by a scalar

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

Reimplemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Definition at line 56 of file itkFEMLinearSystemWrapper.cxx.

References GetMatrixValue(), m_Order, and SetMatrixValue().

void itk::fem::LinearSystemWrapper::ScaleSolution ( Float  scale,
unsigned int  solutionIndex = 0 
)

Multiplies all elements of a solution by a scalar

Parameters
scalescalar to multiply all solution values by
solutionIndexindex of solution to modify

Definition at line 98 of file itkFEMLinearSystemWrapper.cxx.

References itk::fem::Solution::GetSolutionValue(), m_Order, and SetSolutionValue().

void itk::fem::LinearSystemWrapper::ScaleVector ( Float  scale,
unsigned int  vectorIndex = 0 
)

Multiplies all elements of a vector by a scalar

Parameters
scalescalar to multiply all vector values by
vectorIndexindex of vector to modify

Definition at line 79 of file itkFEMLinearSystemWrapper.cxx.

References GetVectorValue(), m_Order, and SetVectorValue().

virtual void itk::fem::LinearSystemWrapper::SetMatrixValue ( unsigned int  i,
unsigned int  j,
Float  value,
unsigned int  matrixIndex = 0 
)
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by AddMatrixValue(), itk::fem::Solver::ApplyBC(), OptimizeMatrixStorage(), and ScaleMatrix().

void itk::fem::LinearSystemWrapper::SetNumberOfMatrices ( unsigned int  nMatrices)
inline

Set Index of matrices used by the system

Parameters
nMatricesIndex of matrices used by system

Definition at line 97 of file itkFEMLinearSystemWrapper.h.

References m_NumberOfMatrices.

Referenced by itk::fem::SolverCrankNicolson::InitializeForSolution(), and itk::fem::Solver::InitializeLinearSystemWrapper().

void itk::fem::LinearSystemWrapper::SetNumberOfSolutions ( unsigned int  nSolutions)
inline

Set Index of solutions used by the system

Parameters
nSolutionsIndex of solutions used by system

Definition at line 128 of file itkFEMLinearSystemWrapper.h.

References m_NumberOfSolutions.

Referenced by itk::fem::SolverCrankNicolson::InitializeForSolution(), and itk::fem::Solver::InitializeLinearSystemWrapper().

void itk::fem::LinearSystemWrapper::SetNumberOfVectors ( unsigned int  nVectors)
inline

Set Index of vectors used by the system

Parameters
nVectorsIndex of vectors used by system

Definition at line 117 of file itkFEMLinearSystemWrapper.h.

References m_NumberOfVectors.

Referenced by itk::fem::SolverCrankNicolson::InitializeForSolution(), and itk::fem::Solver::InitializeLinearSystemWrapper().

virtual void itk::fem::LinearSystemWrapper::SetSolutionValue ( unsigned int  i,
Float  value,
unsigned int  solutionIndex = 0 
)
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by AddSolutionValue(), itk::fem::SolverCrankNicolson::AddToDisplacements(), itk::fem::SolverCrankNicolson::AssembleFforTimeStep(), itk::fem::SolverCrankNicolson::AverageLastTwoDisplacements(), ScaleSolution(), and itk::fem::SolverCrankNicolson::SetEnergyToMin().

void itk::fem::LinearSystemWrapper::SetSystemOrder ( unsigned int  N)
inline

Set the order of the system. All matrices will be of size NxN and all vectors will be of size N

Parameters
Norder of the linear system

Definition at line 86 of file itkFEMLinearSystemWrapper.h.

References m_Order.

Referenced by Clean(), itk::fem::SolverCrankNicolson::InitializeForSolution(), and itk::fem::Solver::InitializeMatrixForAssembly().

virtual void itk::fem::LinearSystemWrapper::SetVectorValue ( unsigned int  i,
Float  value,
unsigned int  vectorIndex = 0 
)
pure virtual
virtual void itk::fem::LinearSystemWrapper::Solve ( void  )
pure virtual

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.

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperVNL, and itk::fem::LinearSystemWrapperDenseVNL.

Referenced by itk::fem::SolverCrankNicolson::Solve(), and itk::fem::Solver::Solve().

virtual void itk::fem::LinearSystemWrapper::SwapMatrices ( unsigned int  matrixIndex1,
unsigned int  matrixIndex2 
)
pure virtual

Swaps access indices of any 2 matrices in the linear system

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperDenseVNL, and itk::fem::LinearSystemWrapperVNL.

Referenced by OptimizeMatrixStorage().

virtual void itk::fem::LinearSystemWrapper::SwapSolutions ( unsigned int  solutionIndex1,
unsigned int  solutionIndex2 
)
pure virtual

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperDenseVNL, and itk::fem::LinearSystemWrapperVNL.

virtual void itk::fem::LinearSystemWrapper::SwapVectors ( unsigned int  vectorIndex1,
unsigned int  vectorIndex2 
)
pure virtual

Swaps access indices of any 2 vectors in the linear system

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

Implemented in itk::fem::LinearSystemWrapperItpack, itk::fem::LinearSystemWrapperDenseVNL, and itk::fem::LinearSystemWrapperVNL.

Member Data Documentation

unsigned int itk::fem::LinearSystemWrapper::m_NumberOfMatrices
protected
unsigned int itk::fem::LinearSystemWrapper::m_NumberOfSolutions
protected
unsigned int itk::fem::LinearSystemWrapper::m_NumberOfVectors
protected
unsigned int itk::fem::LinearSystemWrapper::m_Order
protected

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

Generated at Sun Jun 16 2013 03:03:15 for Orfeo Toolbox with doxygen 1.8.3.1