Skip to content
Snippets Groups Projects
Commit 95dda0ef authored by Henry Weller's avatar Henry Weller
Browse files

LLTMatrix, LUscalarMatrix, QRMatrix: Provided consistent construction,...

LLTMatrix, LUscalarMatrix, QRMatrix: Provided consistent construction, decomposition and solution interface
parent 523b01c1
Branches
Tags
1 merge request!33Merge foundation
......@@ -27,6 +27,11 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::LLTMatrix<Type>::LLTMatrix()
{}
template<class Type>
Foam::LLTMatrix<Type>::LLTMatrix(const SquareMatrix<Type>& M)
{
......
......@@ -61,6 +61,9 @@ public:
// Constructors
//- Construct null
LLTMatrix();
//- Construct from a square matrix and perform the decomposition
LLTMatrix(const SquareMatrix<Type>& M);
......
......@@ -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_);
}
// ************************************************************************* //
......@@ -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>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment