]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Matrixnorm
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 6 Nov 1998 12:19:30 +0000 (12:19 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 6 Nov 1998 12:19:30 +0000 (12:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@643 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/dfmatrix.h
deal.II/lac/source/dfmatrix.cc

index 418db1360cee9cd3df511f96162bc14cb1459eda..01a6e7af3666323dd308a851898e470466548182 100644 (file)
@@ -292,6 +292,12 @@ class dFMatrix
                                       */
     double determinant () const;
 
+                                    /**
+                                     * Compute the quadratic matrix norm.
+                                     * Return value is the root of the square
+                                     * sum of all matrix entries.
+                                     */
+    double norm2 () const;
                                     /**
                                      * Assign the inverse of the given
                                      * matrix to #*this#. This function is
index b344c7e09548057b7199266d94a4e70540ece688..8dfd49e033d75affc6ec6d17b9f0b9629b430e5b 100644 (file)
@@ -1027,6 +1027,13 @@ double dFMatrix::determinant () const {
     };
 };
 
+double dFMatrix::norm2 () const
+{
+  double s = 0.;
+  for (unsigned int i=0;i<dim_image*dim_range;++i)
+    s += val[i]*val[i];
+  return s;
+}
 
 
 void dFMatrix::clear () {

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.