LLTMatrix, LUscalarMatrix, QRMatrix: Provided consistent construction, decomposition and solution interface

This commit is contained in:
Henry Weller
2016-03-24 18:05:18 +00:00
parent 523b01c1b2
commit 95dda0efc0
4 changed files with 32 additions and 7 deletions

View File

@ -27,6 +27,11 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::LLTMatrix<Type>::LLTMatrix()
{}
template<class Type>
Foam::LLTMatrix<Type>::LLTMatrix(const SquareMatrix<Type>& M)
{

View File

@ -61,6 +61,9 @@ public:
// Constructors
//- Construct null
LLTMatrix();
//- Construct from a square matrix and perform the decomposition
LLTMatrix(const SquareMatrix<Type>& M);

View File

@ -39,6 +39,12 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::LUscalarMatrix::LUscalarMatrix()
:
comm_(Pstream::worldComm)
{}
Foam::LUscalarMatrix::LUscalarMatrix(const scalarSquareMatrix& matrix)
:
scalarSquareMatrix(matrix),
@ -249,8 +255,6 @@ void Foam::LUscalarMatrix::convert
}
}
}
//printDiagonalDominance();
}
@ -380,8 +384,6 @@ void Foam::LUscalarMatrix::convert
}
}
}
//printDiagonalDominance();
}
@ -402,4 +404,12 @@ void Foam::LUscalarMatrix::printDiagonalDominance() const
}
void Foam::LUscalarMatrix::decompose(const scalarSquareMatrix& M)
{
scalarSquareMatrix::operator=(M);
pivotIndices_.setSize(m());
LUDecompose(*this, pivotIndices_);
}
// ************************************************************************* //

View File

@ -25,7 +25,7 @@ Class
Foam::LUscalarMatrix
Description
Foam::LUscalarMatrix
Class to perform the LU decomposition on a symmetric matrix.
SourceFiles
LUscalarMatrix.C
@ -93,10 +93,14 @@ public:
// Declare name of the class and its debug switch
ClassName("LUscalarMatrix");
// Constructors
//- Construct from scalarSquareMatrix and perform LU decomposition
LUscalarMatrix(const scalarSquareMatrix&);
//- Construct null
LUscalarMatrix();
//- Construct from and perform LU decomposition of the matrix M
LUscalarMatrix(const scalarSquareMatrix& M);
//- Construct from lduMatrix and perform LU decomposition
LUscalarMatrix
@ -109,6 +113,9 @@ public:
// Member Functions
//- Perform the LU decomposition of the matrix M
void decompose(const scalarSquareMatrix& M);
//- Solve the matrix using the LU decomposition with pivoting
// returning the solution in the source
template<class T>