]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Inherit the value_type of the matrix over which we build the
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 3 Mar 2005 20:09:46 +0000 (20:09 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 3 Mar 2005 20:09:46 +0000 (20:09 +0000)
array. General clean-ups.

git-svn-id: https://svn.dealii.org/trunk@9979 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.html
deal.II/lac/include/lac/block_matrix_array.h
tests/bits/block_matrix_array_01.cc [new file with mode: 0644]

index a45bc52b747b408a172e707d71bf417dd07b22e1..d47d7cfdf4987ed2a79ec19d348fd3ee45ce2bfc 100644 (file)
@@ -85,6 +85,15 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>lac</h3>
 
 <ol>
+  <li> <p>
+       Fixed: The <code>BlockSparseMatrix</code> class had no local
+       typedef <code>value_type</code> like all other classes, which
+       made it a little awkward to use in some places. This has now
+       been fixed.
+       <br> 
+       (WB, 2005/03/03)
+       </p>
+
   <li> <p>
        Fixed: The <code>PETScWrappers::MatrixBase</code> class
        documented that adding or setting a value that hasn't been in
index d24c6dc12bcad2a1ddb15e8fc78b300f30bb8366..f802ba0d99ef4db0a62443391f6e044c94da8c32 100644 (file)
@@ -64,6 +64,13 @@ template <class MATRIX>
 class BlockMatrixArray : public Subscriptor
 {
   public:
+                                    /**
+                                     * Inherit the value_type from
+                                     * the class over which we build
+                                     * the array.
+                                     */
+    typedef typename MATRIX::value_type value_type;
+    
                                     /**
                                      * Constructor fixing the
                                      * dimensions.
@@ -74,11 +81,11 @@ class BlockMatrixArray : public Subscriptor
                                     /**
                                      * Add a block matrix entry.
                                      */
-    void enter (const MATRIXmatrix,
-               unsigned row,
-               unsigned int col,
-               double prefix = 1.,
-               bool transpose = false);
+    void enter (const MATRIX      &matrix,
+               const unsigned int row,
+               const unsigned int col,
+               const double       prefix = 1.,
+               const bool         transpose = false);
 
                                     /**
                                      * Delete all entries, i.e. reset
diff --git a/tests/bits/block_matrix_array_01.cc b/tests/bits/block_matrix_array_01.cc
new file mode 100644 (file)
index 0000000..aa4c51b
--- /dev/null
@@ -0,0 +1,41 @@
+//----------------------------  block_matrix_array_01.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2005 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//----------------------------  block_matrix_array_01.cc  ---------------------------
+
+
+// the class BlockMatrixArray had no local type value_type that is
+// needed in some places. in particular, this is needed for
+// PreconditionBlockSSOR
+
+#include <base/logstream.h>
+#include <lac/block_matrix_array.h>
+#include <lac/sparse_matrix.h>
+#include <lac/precondition_block.h>
+#include <iostream>
+#include <fstream>
+
+
+int main () 
+{
+  std::ofstream logfile("block_matrix_array_01.output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  BlockMatrixArray<SparseMatrix<double> >::value_type i = 1.0;
+  deallog << i << std::endl;
+
+                                  // the following did not compile
+                                  // right away
+  PreconditionBlockSSOR<BlockMatrixArray<SparseMatrix<double> > > p;
+  
+  return 0;
+}

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.