Skip to content
Snippets Groups Projects
Commit e55ca181 authored by Peter Bastian's avatar Peter Bastian
Browse files

added K11Matrix to printmatrix

[[Imported from SVN: r973]]
parent 2d596ee0
Branches
Tags
No related merge requests found
......@@ -104,20 +104,6 @@ namespace Dune {
}
}
//! print one row of a matrix
template<class K, int n, int m>
void print_row (std::ostream& s, FieldMatrix<K,n,m>& A, int I, int J, int therow, int width, int precision)
{
for (int i=0; i<n; i++)
if (I+i==therow)
for (int j=0; j<m; j++)
{
s << " "; // space in front of each entry
s.width(width); // set width for each entry anew
s << A[i][j]; // yeah, the number !
}
}
//! print one row of a matrix
template<class M>
void print_row (std::ostream& s, M& A, int I, int J, int therow, int width, int precision)
......@@ -149,6 +135,32 @@ namespace Dune {
}
}
//! print one row of a matrix, specialization for FieldMatrix
template<class K, int n, int m>
void print_row (std::ostream& s, FieldMatrix<K,n,m>& A, int I, int J, int therow, int width, int precision)
{
for (int i=0; i<n; i++)
if (I+i==therow)
for (int j=0; j<m; j++)
{
s << " "; // space in front of each entry
s.width(width); // set width for each entry anew
s << A[i][j]; // yeah, the number !
}
}
//! print one row of a matrix, specialization for K11Matrix
template<class K>
void print_row (std::ostream& s, K11Matrix<K>& A, int I, int J, int therow, int width, int precision)
{
if (I==therow)
{
s << " "; // space in front of each entry
s.width(width); // set width for each entry anew
s << A(); // yeah, the number !
}
}
template<class M>
void printmatrix (std::ostream& s, M& A, std::string title, std::string rowtext,
int width=10, int precision=2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment