]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Replace one set of uses of a deprecated function.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 15 Jan 2013 02:57:37 +0000 (02:57 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 15 Jan 2013 02:57:37 +0000 (02:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@28057 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/sparse_decomposition.templates.h

index 777aae6a249b98368e916c1f536b68db7ce23c93..b196265526e0e31adf232bc3b1c21aae78b7ea64 100644 (file)
@@ -1,5 +1,5 @@
 //---------------------------------------------------------------------------
-//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2011, 2012 by the deal.II authors
+//    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2011, 2012, 2013 by the deal.II authors
 //    by the deal.II authors and Stephen "Cheffo" Kolaroff
 //
 //    This file is subject to QPL and may not be  distributed
@@ -251,17 +251,18 @@ SparseLUDecomposition<number>::strengthen_diagonal_impl ()
 
       // get the global index of the first
       // non-diagonal element in this row
-      const unsigned int rowstart
-        = this->get_sparsity_pattern().get_rowstart_indices()[row] + 1;
-      number *const diagonal_element = &this->global_entry(rowstart-1);
+      Assert (this->cols->optimize_diagonal(),  ExcNotImplemented());
+      typename SparseMatrix<number>::iterator
+       diagonal_element = this->begin(row);
 
       number rowsum = 0;
-      for (unsigned int global_index=rowstart;
-           global_index<rowstart+rowlength; ++global_index)
-        rowsum += std::fabs(this->global_entry(global_index));
+      for (typename SparseMatrix<number>::iterator
+            p = diagonal_element + 1;
+          p != this->end(row); ++p)
+        rowsum += std::fabs(p->value());
 
-      *diagonal_element += this->get_strengthen_diagonal (rowsum, row)  *
-                           rowsum;
+      diagonal_element->value() += this->get_strengthen_diagonal (rowsum, row)  *
+                                  rowsum;
     }
 }
 

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.