From 0d3f4ab6f15cd10aa0758931a4d3abccca812415 Mon Sep 17 00:00:00 2001 From: guido Date: Fri, 6 Nov 1998 12:19:30 +0000 Subject: [PATCH] Matrixnorm git-svn-id: https://svn.dealii.org/trunk@643 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/dfmatrix.h | 6 ++++++ deal.II/lac/source/dfmatrix.cc | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/deal.II/lac/include/lac/dfmatrix.h b/deal.II/lac/include/lac/dfmatrix.h index 418db1360c..01a6e7af36 100644 --- a/deal.II/lac/include/lac/dfmatrix.h +++ b/deal.II/lac/include/lac/dfmatrix.h @@ -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 diff --git a/deal.II/lac/source/dfmatrix.cc b/deal.II/lac/source/dfmatrix.cc index b344c7e095..8dfd49e033 100644 --- a/deal.II/lac/source/dfmatrix.cc +++ b/deal.II/lac/source/dfmatrix.cc @@ -1027,6 +1027,13 @@ double dFMatrix::determinant () const { }; }; +double dFMatrix::norm2 () const +{ + double s = 0.; + for (unsigned int i=0;i