]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Adjust one test, augment documentation.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 16 Feb 2014 18:21:54 +0000 (18:21 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 16 Feb 2014 18:21:54 +0000 (18:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@32495 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/block_matrix_array.h
tests/bits/block_matrix_array_01.cc
tests/bits/block_matrix_array_01.output

index 6f9a21d10bda62c5173f656942fde25c24a9c467..e0a3b5be3410595ad84ec67d4169e80f7f5c8756 100644 (file)
@@ -301,18 +301,49 @@ public:
    * Print the block structure as a
    * LaTeX-array. This output will
    * not be very intuitive, since
-   * the matrix object lacks
-   * important information. What
-   * you see is an entry for each
+   * the current object lacks
+   * knowledge about what the individual blocks represent or
+   * how they should be named. Instead, what
+   * you will see is an entry for each
    * block showing all the matrices
-   * with their multiplicaton
+   * with their multiplication
    * factors and possibly transpose
-   * mark. The matrices itself are
-   * numbered successively upon
-   * being entred. If the same
+   * marks. The matrices itself are
+   * named successively as they are encountered. If the same
    * matrix is entered several
    * times, it will be listed with
-   * the same number everytime.
+   * different names.
+   *
+   * As an example, consider the following code:
+   * @code
+   *   FullMatrix<double> A1(4,4);
+   *  FullMatrix<double> A2(4,4);
+   *  FullMatrix<double> B(4,3);
+   *  FullMatrix<double> C(3,3);
+   *
+   *  BlockMatrixArray<double> block(2,2);
+   *
+   *  block.enter(A1,0,0);
+   *  block.enter(A2,0,0,2,true);
+   *  block.enter(B,0,1,-3.);
+   *  block.enter(B,0,1,-3.,true);
+   *  block.enter(C,1,1,1.,true);
+   *
+   *  block.print_latex(std::cout);
+   * @endcode
+   * The current function will then produce output of the following
+   * kind:
+   * @code
+   * \begin{array}{cc}
+   *    M0+2xM1^T &     -3xM2-3xM3^T\\
+   *    &      M4^T
+   * \end{array}
+   * @endcode
+   * Note how the individual blocks here are just numbered successively
+   * as <code>M0</code> to <code>M4</code> and that the output misses
+   * the fact that <code>M2</code> and <code>M3</code> are, in fact,
+   * the same matrix. Nevertheless, the output at least gives some
+   * kind of idea of the block structure of this matrix.
    */
   template <class STREAM>
   void print_latex (STREAM &out) const;
@@ -713,17 +744,6 @@ BlockMatrixArray<number>::enter_aux (
 }
 
 
-template<typename number>
-struct BlockMatrixArrayPointerMatrixLess
-{
-  bool operator () (const PointerMatrixBase<Vector<number> > *a,
-                    const PointerMatrixBase<Vector<number> > *b) const
-  {
-    return *a < *b;
-  }
-};
-
-
 template <typename number>
 template <class STREAM>
 inline
@@ -736,8 +756,7 @@ BlockMatrixArray<number>::print_latex (STREAM &out) const
 
   Table<2,std::string> array(n_block_rows(), n_block_cols());
 
-  typedef std::map<const PointerMatrixBase<Vector<number> > *,
-          std::string, BlockMatrixArrayPointerMatrixLess<number> > NameMap;
+  typedef std::map<const PointerMatrixBase<Vector<number> > *, std::string> NameMap;
   NameMap matrix_names;
 
   typename std::vector<Entry>::const_iterator m = entries.begin();
@@ -776,7 +795,12 @@ BlockMatrixArray<number>::print_latex (STREAM &out) const
       {
         out << '\t' << array(i,j);
         if (j==n_block_cols()-1)
-          out << "\\\\" << std::endl;
+          {
+            if (i != n_block_rows() - 1)
+              out << "\\\\" << std::endl;
+            else
+              out << std::endl;
+          }
         else
           out << " &";
       }
index 692a2eb5b12bab5487f3aa29cc25039809e6d26d..901b4e0e5ec99887441679975b45fde5de48d5f5 100644 (file)
@@ -1,7 +1,7 @@
 // ---------------------------------------------------------------------
 // $Id$
 //
-// Copyright (C) 2005 - 2013 by the deal.II authors
+// Copyright (C) 2005 - 2014 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -38,9 +38,8 @@ int main ()
   FullMatrix<double> A2(4,4);
   FullMatrix<double> B(4,3);
   FullMatrix<double> C(3,3);
-  PrimitiveVectorMemory<Vector<double> > mem;
 
-  BlockMatrixArray<double> block(2,2,mem);
+  BlockMatrixArray<double> block(2,2);
 
   block.enter(A1,0,0);
   block.enter(A2,0,0,2,true);
index 3a8202dfb29fe596c40b708b6daa56563f7fa021..084edb26a445938b813e8b80bf95c26024b08b32 100644 (file)
@@ -1,5 +1,5 @@
 
 DEAL::\begin{array}{cc}
-DEAL:: M0+2xM1^T &     -3xM2-3xM2^T\\
-DEAL::  &      M3^T\\
+DEAL:: M0+2xM1^T &     -3xM2-3xM3^T\\
+DEAL::  &      M4^T
 DEAL::\end{array}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.