]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make the SparseMatrix(SparsityPattern&) constructor explicit to avoid
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 17 Oct 2000 13:37:49 +0000 (13:37 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 17 Oct 2000 13:37:49 +0000 (13:37 +0000)
nasty bugs.

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

deal.II/lac/include/lac/sparse_matrix.h

index 9fe43678a1c88115b7dae4ab01c912afdd93fcab..17b5e94e02b06700b8350d11066517e837b05c2c 100644 (file)
@@ -83,19 +83,31 @@ class SparseMatrix : public Subscriptor
     SparseMatrix (const SparseMatrix &);
 
                                     /**
-                                     * Constructor. Takes the given matrix
-                                     * sparsity structure to represent the
-                                     * sparsity pattern of this matrix. You
-                                     * can change the sparsity pattern later
-                                     * on by calling the @p{reinit} function.
+                                     * Constructor. Takes the given
+                                     * matrix sparsity structure to
+                                     * represent the sparsity pattern
+                                     * of this matrix. You can change
+                                     * the sparsity pattern later on
+                                     * by calling the @p{reinit}
+                                     * function.
                                      *
-                                     * You have to make sure that the lifetime
-                                     * of the sparsity structure is at least
-                                     * as long as that of this matrix or as
-                                     * long as @p{reinit} is not called with a
-                                     * new sparsity structure.
-                                     */
-    SparseMatrix (const SparsityPattern &sparsity);
+                                     * You have to make sure that the
+                                     * lifetime of the sparsity
+                                     * structure is at least as long
+                                     * as that of this matrix or as
+                                     * long as @p{reinit} is not
+                                     * called with a new sparsity
+                                     * structure.
+                                     *
+                                     * The constructor is marked
+                                     * explicit so as to disallow
+                                     * that someone passes a sparsity
+                                     * pattern in place of a sparse
+                                     * matrix to some function, where
+                                     * an empty matrix would be
+                                     * generated then.
+                                     */
+    explicit SparseMatrix (const SparsityPattern &sparsity);
     
                                     /**
                                      * Destructor. Free all memory, but do not

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.