From c58f3c34a621398ca4c034160c5f2677fab1eece Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 18 Sep 2002 15:11:37 +0000 Subject: [PATCH] Fix header wobbles. git-svn-id: https://svn.dealii.org/trunk@6458 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/block_matrix_array.h | 34 ++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/deal.II/lac/include/lac/block_matrix_array.h b/deal.II/lac/include/lac/block_matrix_array.h index de0b218f20..33a6123bdb 100644 --- a/deal.II/lac/include/lac/block_matrix_array.h +++ b/deal.II/lac/include/lac/block_matrix_array.h @@ -24,10 +24,8 @@ #ifdef HAVE_STD_STRINGSTREAM # include -# define STRINGSTREAM std::ostringstream #else # include -# define STRINGSTREAM std::ostrstream #endif //TODO:[GK] Obtain aux vector from VectorMemory @@ -131,7 +129,7 @@ class BlockMatrixArray : public Subscriptor * Print the block structure as a * LaTeX-array. */ - void print_latex (ostream& out) const; + void print_latex (std::ostream& out) const; protected: /** @@ -507,14 +505,14 @@ BlockMatrixArray::n_block_cols () const template inline void -BlockMatrixArray::print_latex (ostream& out) const +BlockMatrixArray::print_latex (std::ostream& out) const { out << "\\begin{array}{" << std::string(n_block_cols(), 'c') << "}" << std::endl; Table<2,std::string> array(n_block_rows(), n_block_cols()); - typedef map NameMap; + typedef std::map NameMap; NameMap matrix_names; typename std::vector::const_iterator m = entries.begin(); @@ -527,21 +525,39 @@ BlockMatrixArray::print_latex (ostream& out) const { std::pair x = matrix_names.insert( - std::pair (m->matrix, std::string("M"))); - STRINGSTREAM stream; + std::pair (m->matrix, + std::string("M"))); +#ifdef HAVE_STD_STRINGSTREAM + std::ostringstream stream; +#else + std::ostrstream stream; +#endif + stream << matrix_number++; - stream << std::ends; + +#ifndef HAVE_STD_STRINGSTREAM + stream << std::ends; +#endif x.first->second += stream.str(); } - STRINGSTREAM stream; +#ifdef HAVE_STD_STRINGSTREAM + std::ostringstream stream; +#else + std::ostrstream stream; +#endif + if (m->prefix != 1.) stream << " " << m->prefix << 'x'; stream << matrix_names.find(m->matrix)->second; stream << '(' << m->matrix << ')'; if (m->transpose) stream << "^T"; + +#ifndef HAVE_STD_STRINGSTREAM stream << std::ends; +#endif + array(m->row, m->col) += stream.str(); } for (unsigned int i=0;i