From: wolf Date: Wed, 7 Jun 2006 20:37:58 +0000 (+0000) Subject: Move FullMatrix::print into header file to make it visible for all template arguments... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b0de4580a393d184369202c0dc62582edb3c0f3;p=dealii-svn.git Move FullMatrix::print into header file to make it visible for all template arguments. This follows an email by Roger Young on 2006-04-26 to the mailing list. git-svn-id: https://svn.dealii.org/trunk@13194 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index dcdd5cf4c8..e98b53af4a 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -486,6 +486,17 @@ inconvenience this causes.
    +
  1. Fixed: The FullMatrix::print would yield a link error + when used with std::ofstream since an explicit + instantiation was missing. The function has now been moved to + the header file and made inline so that it is always visible, + whatever the type of the output stream is. +
    + (WB 2006/06/07) +

    + +
  2. Improved: The SparseDirectUMFPACK solver can now also be used with sparse matrices with elements of type float, as well diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index bbb148ed43..dc2792525b 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -1423,6 +1423,28 @@ FullMatrix::end (const unsigned int r) const return const_iterator(this, r+1, 0); } + + +template +template +inline +void +FullMatrix::print (STREAM &s, + const unsigned int w, + const unsigned int p) const +{ + Assert (!this->empty(), ExcEmptyMatrix()); + + for (unsigned int i=0; im(); ++i) + { + for (unsigned int j=0; jn(); ++j) + s << std::setw(w) << std::setprecision(p) << this->el(i,j); + s << std::endl; + } +} + + + #endif // DOXYGEN #endif diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index d2928ae4ef..138289cb25 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -1032,6 +1032,7 @@ number FullMatrix::l1_norm () const } + template number FullMatrix::linfty_norm () const { @@ -1052,23 +1053,6 @@ number FullMatrix::linfty_norm () const } -template -template -void -FullMatrix::print (STREAM &s, - const unsigned int w, - const unsigned int p) const -{ - Assert (!this->empty(), ExcEmptyMatrix()); - - for (unsigned int i=0; im(); ++i) - { - for (unsigned int j=0; jn(); ++j) - s << std::setw(w) << std::setprecision(p) << this->el(i,j); - s << std::endl; - } -} - template template