]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Undo "bug" fix.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 2 Jun 2000 13:46:40 +0000 (13:46 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 2 Jun 2000 13:46:40 +0000 (13:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@2988 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 035d296032990a9de66b8ef232970a94632eba06..2d9d7d0eb442c89734c46b313d1b1148cf8174d7 100644 (file)
@@ -821,7 +821,8 @@ void SparseMatrix<number>::set (const unsigned int i,
 
 template <typename number>
 inline
-void SparseMatrix<number>::add (const unsigned int i, const unsigned int j,
+void SparseMatrix<number>::add (const unsigned int i,
+                               const unsigned int j,
                                const number value)
 {
   Assert (cols != 0, ExcMatrixNotInitialized());
@@ -843,11 +844,9 @@ number SparseMatrix<number>::operator () (const unsigned int i,
                                          const unsigned int j) const
 {
   Assert (cols != 0, ExcMatrixNotInitialized());
-
-  const unsigned int index = cols->operator()(i,j);
-  if (index == SparsityPattern::invalid_entry)
-    return 0.;
-  return val[index];
+  Assert (cols->operator()(i,j) != SparsityPattern::invalid_entry,
+         ExcInvalidIndex(i,j));
+  return val[cols->operator()(i,j)];
 };
 
 

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.