]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add add function like for sparse matrix
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 13 Mar 2012 00:27:20 +0000 (00:27 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 13 Mar 2012 00:27:20 +0000 (00:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@25269 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/full_matrix.h

index 73dc2b4b569aa31da5f8e7117f020f1e4c9deef2..35bd45e912d5c2d9a5123fa56ef00b8697b117c3 100644 (file)
@@ -1,7 +1,7 @@
 //---------------------------------------------------------------------------
 //    $Id$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -799,6 +799,12 @@ class FullMatrix : public Table<2,number>
               const unsigned int src_offset_i = 0,
               const unsigned int src_offset_j = 0);
 
+                                    /**
+                                     * Adda single element at the
+                                     * given position.
+                                     */
+    void add(const unsigned int row, const unsigned int column, const number value);
+    
                                     /**
                                      * <i>A(i,1...n) +=
                                      * s*A(j,1...n)</i>.  Simple
@@ -1614,6 +1620,15 @@ FullMatrix<number>::end (const unsigned int r) const
 
 
 
+template <typename number>
+inline
+void
+FullMatrix<number>::add (const unsigned int r, const unsigned int c, const number v)
+{
+  this->operator()(r,c) += v;
+}
+
+
 template <typename number>
 template <class STREAM>
 inline

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.