]> https://gitweb.dealii.org/ - dealii.git/commitdiff
make sure simple functions like isfinite are inlined\
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 22 Mar 2006 10:54:16 +0000 (10:54 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 22 Mar 2006 10:54:16 +0000 (10:54 +0000)
give those their own header file

git-svn-id: https://svn.dealii.org/trunk@12656 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/config.h.in
deal.II/base/include/base/numbers.h [new file with mode: 0644]
deal.II/base/source/config.cc [deleted file]
deal.II/configure
deal.II/configure.in
deal.II/lac/include/lac/block_matrix_base.h
deal.II/lac/include/lac/full_matrix.h
deal.II/lac/include/lac/sparse_matrix.h
deal.II/lac/include/lac/sparse_matrix_ez.h
deal.II/lac/include/lac/vector.h

index a3d01466f70b5d24764ddbfb321652b45e44545f..3723f02506f11f4d90bea9c7b3a3f630c23b3b76 100644 (file)
@@ -403,15 +403,6 @@ namespace deal_II_numbers {
                                               * 1/sqrt(2)
                                               */
   static const double  SQRT1_2 = 0.70710678118654752440;
-
-                                            /**
-                                             * Return @p true if the given
-                                             * value is a finite floating point
-                                             * number, i.e. is neither plus or
-                                             * minus infinity nor NaN (not a
-                                             * number).
-                                             */
-  bool is_finite (const double x);
 }
 
 #endif
diff --git a/deal.II/base/include/base/numbers.h b/deal.II/base/include/base/numbers.h
new file mode 100644 (file)
index 0000000..1ff30d6
--- /dev/null
@@ -0,0 +1,64 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2006 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+#ifndef __deal2__numbers_h
+#define __deal2__numbers_h
+
+#include <base/config.h>
+#include <cmath>
+#include <limits>
+
+
+/**
+ * Namespace for the declaration of universal constants. Since the
+ * availability in <tt>math.h</tt> is not always guaranteed, we put
+ * them here.
+ *
+ * The constants defined here are a subset of the <tt>M_XXX</tt> constants
+ * sometimes declared in the system include file <tt>math.h</tt>, but without
+ * the prefix <tt>M_</tt>.
+ *
+ * In addition to that, we declare  <tt>invalid_unsigned_int</tt> to be the
+ * largest unsigned integer representable; this value is widely used in
+ * the library as a marker for an invalid index, an invalid size of an
+ * array, and similar purposes.
+ *
+ * Most of the members of this namespace are defined in
+ * <tt>base/config.h</tt>. Nevertheless, the inline functions are in
+ * <tt>base/numbers.h</tt>.
+ */
+namespace deal_II_numbers 
+{
+                                            /**
+                                             * Return @p true if the given
+                                             * value is a finite floating point
+                                             * number, i.e. is neither plus or
+                                             * minus infinity nor NaN (not a
+                                             * number).
+                                             */
+
+  inline bool is_finite (const double x) 
+  {
+#ifdef DEAL_II_HAVE_ISFINITE
+    return std::isfinite (x);
+#else
+                                    // check against infinities. not
+                                    // that if x is a NaN, then both
+                                    // comparisons will be false
+    return ((x >= std::numeric_limits<double>::min())
+           &&
+           (x <= std::numeric_limits<double>::max()));
+#endif
+  }
+}
+
+#endif
diff --git a/deal.II/base/source/config.cc b/deal.II/base/source/config.cc
deleted file mode 100644 (file)
index 4d8ec7b..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
-//
-//    Copyright (C) 2006 by the deal.II authors
-//
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//---------------------------------------------------------------------------
-
-
-#include <base/config.h>
-#include <cmath>
-#include <limits>
-
-
-namespace deal_II_numbers 
-{
-  bool is_finite (const double x) 
-  {
-#ifdef DEAL_II_HAVE_ISFINITE
-    return std::isfinite (x);
-#else
-                                    // check against infinities. not
-                                    // that if x is a NaN, then both
-                                    // comparisons will be false
-    return ((x >= std::numeric_limits<double>::min())
-           &&
-           (x <= std::numeric_limits<double>::max()));
-#endif
-  }
-}
index 43e964224bd45e568fc2e986f7b020dc571f9b7f..5065e61ac86581b364ee708de620a809721cbbbb 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.221 .
+# From configure.in Revision: 1.222 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for deal.II 5.3.pre.
 #
index 5db6d179c6af9b67155ca50634e34f81045df5a3..3fa4acd1eb98f9278f447b3ff814ab6626cc8ec1 100644 (file)
@@ -606,22 +606,6 @@ AH_BOTTOM(
 #endif
 
 
-/**
- * Have a namespace into which we declare some numeric constants, such
- * as pi. Unfortunately, these are not always available, on all systems
- * or depending on compiler flags, so we duplicate their declarations
- * here to make them unconditionally available to all other parts of the
- * library.
- *
- * The constants defined here are a subset of the <tt>M_XXX</tt> constants
- * sometimes declared in the system include file <tt>math.h</tt>, but without
- * the prefix <tt>M_</tt>.
- *
- * In addition to that, we declare  <tt>invalid_unsigned_int</tt> to be the
- * largest unsigned integer representable; this value is widely used in
- * the library as a marker for an invalid index, an invalid size of an
- * array, and similar purposes.
- */
 namespace deal_II_numbers {
                                              /**
                                               * Representation of the
@@ -690,15 +674,6 @@ namespace deal_II_numbers {
                                               * 1/sqrt(2)
                                               */
   static const double  SQRT1_2 = 0.70710678118654752440;
-
-                                            /**
-                                             * Return @p true if the given
-                                             * value is a finite floating point
-                                             * number, i.e. is neither plus or
-                                             * minus infinity nor NaN (not a
-                                             * number).
-                                             */
-  bool is_finite (const double x);
 }
 
 #endif
index 7a6348ea65a797c00778619a459d7a8de80bdd5e..3dbc9db6edd9d7ff743e2eefc774728aa408ef32 100644 (file)
@@ -15,6 +15,7 @@
 
 
 #include <base/config.h>
+#include <base/numbers.h>
 #include <base/table.h>
 #include <base/smartpointer.h>
 #include <lac/block_indices.h>
index 9d14820f82de347aae0f3a4a9ec984bf6f0832ae..42f0c91707d3963acaed3dd7c01398e3ecf6a954 100644 (file)
@@ -15,6 +15,7 @@
 
 
 #include <base/config.h>
+#include <base/numbers.h>
 #include <base/table.h>
 #include <lac/exceptions.h>
 
index 4c375109817c80e1574284f67a799e87bbf050d3..d203064586c44399dc13eed69fc0f545f3dfe995 100644 (file)
@@ -15,6 +15,7 @@
 
 
 #include <base/config.h>
+#include <base/numbers.h>
 #include <base/subscriptor.h>
 #include <base/smartpointer.h>
 #include <lac/sparsity_pattern.h>
index b112250626ad2d3c0af80939c0e09b65d5b12dc4..435b0bc0e387947c5a903259b9922517e2630296 100644 (file)
@@ -15,6 +15,7 @@
 
 
 #include <base/config.h>
+#include <base/numbers.h>
 #include <base/subscriptor.h>
 #include <base/smartpointer.h>
 #include <lac/exceptions.h>
index 4f2fcf79127b06add3b3115110811e5e57aebf0c..9e9b1692ed72c0344106f18503d058e93b6cc99b 100644 (file)
@@ -15,6 +15,7 @@
 
 
 #include <base/config.h>
+#include <base/numbers.h>
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
 

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.