Skip to content
Snippets Groups Projects
Commit 6a999a4e authored by Oliver Sander's avatar Oliver Sander
Browse files

Put printInnerMatrixElement into Impl namespace

... and move it in front of the method that calls it.
AIUI this facilitates template deduction.
parent 849843e9
Branches
Tags
1 merge request!558Various fixes and tests for the printSparseMatrix method
......@@ -246,6 +246,28 @@ namespace Dune {
s.precision(oldprec);
}
namespace Impl
{
template<class B, int n>
void printInnerMatrixElement(std::ostream& s,
const ScaledIdentityMatrix<B,n> innerMatrixElement,
int innerrow, int innercol)
{
if (innerrow == innercol)
s<<innerMatrixElement.scalar()<<" ";
else
s<<"-";
}
template<class B, int n, int m>
void printInnerMatrixElement(std::ostream& s,
const FieldMatrix<B,n,m> innerMatrixElement,
int innerrow, int innercol)
{
s<<innerMatrixElement[innerrow][innercol]<<" ";
}
}
/**
* \brief Prints a BCRSMatrix with fixed sized blocks.
*
......@@ -325,7 +347,7 @@ namespace Dune {
}
for(int innercol=0; innercol < m; ++innercol) {
s.width(9);
printInnerMatrixElement(s,*col,innerrow,innercol);
Impl::printInnerMatrixElement(s,*col,innerrow,innercol);
}
s<<"|";
......@@ -346,25 +368,6 @@ namespace Dune {
s.precision(oldprec);
}
template<class B, int n>
void printInnerMatrixElement(std::ostream& s,
const ScaledIdentityMatrix<B,n> innerMatrixElement,
int innerrow, int innercol)
{
if (innerrow == innercol)
s<<innerMatrixElement.scalar()<<" ";
else
s<<"-";
}
template<class B, int n, int m>
void printInnerMatrixElement(std::ostream& s,
const FieldMatrix<B,n,m> innerMatrixElement,
int innerrow, int innercol)
{
s<<innerMatrixElement[innerrow][innercol]<<" ";
}
namespace
{
template<typename T>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment