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

works with const arguments now ...

[[Imported from SVN: r1019]]
parent 67799ff0
Branches
Tags
No related merge requests found
......@@ -30,16 +30,16 @@ namespace Dune {
// recursively print all the blocks
template<class V>
void recursive_printvector (std::ostream& s, V& v, std::string rowtext, int& counter,
void recursive_printvector (std::ostream& s, const V& v, std::string rowtext, int& counter,
int columns, int width, int precision)
{
for (typename V::Iterator i=v.begin(); i!=v.end(); ++i)
for (typename V::ConstIterator i=v.begin(); i!=v.end(); ++i)
recursive_printvector(s,*i,rowtext,counter,columns,width,precision);
}
// specialization for FieldVector
template<class K, int n>
void recursive_printvector (std::ostream& s, FieldVector<K,n>& v, std::string rowtext, int& counter,
void recursive_printvector (std::ostream& s, const FieldVector<K,n>& v, std::string rowtext, int& counter,
int columns, int width, int precision)
{
// we now can print n numbers
......@@ -63,7 +63,7 @@ namespace Dune {
template<class V>
void printvector (std::ostream& s, V& v, std::string title, std::string rowtext,
void printvector (std::ostream& s, const V& v, std::string title, std::string rowtext,
int columns=1, int width=10, int precision=2)
{
// count the numbers printed to make columns
......@@ -106,7 +106,7 @@ namespace Dune {
//! 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)
void print_row (std::ostream& s, const M& A, int I, int J, int therow, int width, int precision)
{
int i0=I;
for (int i=0; i<A.N(); i++)
......@@ -118,7 +118,7 @@ namespace Dune {
for (int j=0; j<A.M(); j++)
{
// find this block
typename M::ColIterator it = A[i].find(j);
typename M::ConstColIterator it = A[i].find(j);
// print row or filler
if (it!=A[i].end())
......@@ -137,7 +137,7 @@ 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)
void print_row (std::ostream& s, const 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)
......@@ -151,7 +151,7 @@ namespace Dune {
//! 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)
void print_row (std::ostream& s, const K11Matrix<K>& A, int I, int J, int therow, int width, int precision)
{
if (I==therow)
{
......@@ -162,7 +162,7 @@ namespace Dune {
}
template<class M>
void printmatrix (std::ostream& s, M& A, std::string title, std::string rowtext,
void printmatrix (std::ostream& s, const M& A, std::string title, std::string rowtext,
int width=10, int precision=2)
{
// set the output format
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment