]> https://gitweb.dealii.org/ - dealii.git/commitdiff
put is_finite into config.cc again
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 22 Mar 2006 20:20:51 +0000 (20:20 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 22 Mar 2006 20:20:51 +0000 (20:20 +0000)
remove namespace deal_II_numbers from configure.in

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

deal.II/base/include/base/config.h.in
deal.II/base/include/base/numbers.h
deal.II/base/source/config.cc [new file with mode: 0644]
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 3723f02506f11f4d90bea9c7b3a3f630c23b3b76..f3a78ab426127c9595239b8244261aca069c5ef5 100644 (file)
 #  define DEAL_VOLATILE
 #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
-                                              * largest number that
-                                              * can be put into an
-                                              * unsigned integer. This
-                                              * value is widely used
-                                              * throughout the library
-                                              * as a marker for an
-                                              * invalid unsigned
-                                              * integer value, such as
-                                              * an invalid array
-                                              * index, an invalid
-                                              * array size, and the
-                                              * like.
-                                              */
-  static const unsigned int 
-    invalid_unsigned_int = static_cast<unsigned int> (-1);
-
-                                             /**
-                                              * e
-                                              */
-  static const double  E       = 2.7182818284590452354;
-
-                                             /**
-                                              * log_2 e
-                                              */
-  static const double  LOG2E   = 1.4426950408889634074;
-
-                                             /**
-                                              * log_10 e
-                                              */
-  static const double  LOG10E  = 0.43429448190325182765;
-
-                                             /**
-                                              * log_e 2
-                                              */
-  static const double  LN2     = 0.69314718055994530942;
-
-                                             /**
-                                              * log_e 10
-                                              */
-  static const double  LN10    = 2.30258509299404568402;
-
-                                             /**
-                                              * pi
-                                              */
-  static const double  PI      = 3.14159265358979323846;
-
-                                             /**
-                                              * pi/2
-                                              */
-  static const double  PI_2    = 1.57079632679489661923;
-
-                                             /**
-                                              * pi/4
-                                              */
-  static const double  PI_4    = 0.78539816339744830962;
-
-                                             /**
-                                              * sqrt(2)
-                                              */
-  static const double  SQRT2   = 1.41421356237309504880;
-
-                                             /**
-                                              * 1/sqrt(2)
-                                              */
-  static const double  SQRT1_2 = 0.70710678118654752440;
-}
+#include <base/numbers.h>
 
 #endif
 
index 1ff30d66f45c1dd6badbb3783b5140f6fe370c44..fd8ce1842f4157c32f1472b4e9fdfa191b5f42bd 100644 (file)
@@ -21,7 +21,8 @@
 /**
  * Namespace for the declaration of universal constants. Since the
  * availability in <tt>math.h</tt> is not always guaranteed, we put
- * them here.
+ * them here. Since this file is included by <tt>base/config.h</tt>,
+ * they are available to the whole 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
  * 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 
-{
-                                            /**
+namespace deal_II_numbers {
+                                             /**
+                                              * Representation of the
+                                              * largest number that
+                                              * can be put into an
+                                              * unsigned integer. This
+                                              * value is widely used
+                                              * throughout the library
+                                              * as a marker for an
+                                              * invalid unsigned
+                                              * integer value, such as
+                                              * an invalid array
+                                              * index, an invalid
+                                              * array size, and the
+                                              * like.
+                                              */
+  static const unsigned int 
+    invalid_unsigned_int = static_cast<unsigned int> (-1);
+
+                                             /**
+                                              * e
+                                              */
+  static const double  E       = 2.7182818284590452354;
+
+                                             /**
+                                              * log_2 e
+                                              */
+  static const double  LOG2E   = 1.4426950408889634074;
+
+                                             /**
+                                              * log_10 e
+                                              */
+  static const double  LOG10E  = 0.43429448190325182765;
+
+                                             /**
+                                              * log_e 2
+                                              */
+  static const double  LN2     = 0.69314718055994530942;
+
+                                             /**
+                                              * log_e 10
+                                              */
+  static const double  LN10    = 2.30258509299404568402;
+
+                                             /**
+                                              * pi
+                                              */
+  static const double  PI      = 3.14159265358979323846;
+
+                                             /**
+                                              * pi/2
+                                              */
+  static const double  PI_2    = 1.57079632679489661923;
+
+                                             /**
+                                              * pi/4
+                                              */
+  static const double  PI_4    = 0.78539816339744830962;
+
+                                             /**
+                                              * sqrt(2)
+                                              */
+  static const double  SQRT2   = 1.41421356237309504880;
+
+                                             /**
+                                              * 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).
                                              */
-
-  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
-  }
+  bool is_finite (const double x);
 }
 
 #endif
diff --git a/deal.II/base/source/config.cc b/deal.II/base/source/config.cc
new file mode 100644 (file)
index 0000000..4d8ec7b
--- /dev/null
@@ -0,0 +1,35 @@
+//---------------------------------------------------------------------------
+//    $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 3fa4acd1eb98f9278f447b3ff814ab6626cc8ec1..89032d1d499ca1ae413de93c8325dd628bdab3f7 100644 (file)
@@ -605,76 +605,7 @@ AH_BOTTOM(
 #  define DEAL_VOLATILE
 #endif
 
-
-namespace deal_II_numbers {
-                                             /**
-                                              * Representation of the
-                                              * largest number that
-                                              * can be put into an
-                                              * unsigned integer. This
-                                              * value is widely used
-                                              * throughout the library
-                                              * as a marker for an
-                                              * invalid unsigned
-                                              * integer value, such as
-                                              * an invalid array
-                                              * index, an invalid
-                                              * array size, and the
-                                              * like.
-                                              */
-  static const unsigned int 
-    invalid_unsigned_int = static_cast<unsigned int> (-1);
-
-                                             /**
-                                              * e
-                                              */
-  static const double  E       = 2.7182818284590452354;
-
-                                             /**
-                                              * log_2 e
-                                              */
-  static const double  LOG2E   = 1.4426950408889634074;
-
-                                             /**
-                                              * log_10 e
-                                              */
-  static const double  LOG10E  = 0.43429448190325182765;
-
-                                             /**
-                                              * log_e 2
-                                              */
-  static const double  LN2     = 0.69314718055994530942;
-
-                                             /**
-                                              * log_e 10
-                                              */
-  static const double  LN10    = 2.30258509299404568402;
-
-                                             /**
-                                              * pi
-                                              */
-  static const double  PI      = 3.14159265358979323846;
-
-                                             /**
-                                              * pi/2
-                                              */
-  static const double  PI_2    = 1.57079632679489661923;
-
-                                             /**
-                                              * pi/4
-                                              */
-  static const double  PI_4    = 0.78539816339744830962;
-
-                                             /**
-                                              * sqrt(2)
-                                              */
-  static const double  SQRT2   = 1.41421356237309504880;
-
-                                             /**
-                                              * 1/sqrt(2)
-                                              */
-  static const double  SQRT1_2 = 0.70710678118654752440;
-}
+#include <base/numbers.h>
 
 #endif
 ])
index 3dbc9db6edd9d7ff743e2eefc774728aa408ef32..7a6348ea65a797c00778619a459d7a8de80bdd5e 100644 (file)
@@ -15,7 +15,6 @@
 
 
 #include <base/config.h>
-#include <base/numbers.h>
 #include <base/table.h>
 #include <base/smartpointer.h>
 #include <lac/block_indices.h>
index 42f0c91707d3963acaed3dd7c01398e3ecf6a954..9d14820f82de347aae0f3a4a9ec984bf6f0832ae 100644 (file)
@@ -15,7 +15,6 @@
 
 
 #include <base/config.h>
-#include <base/numbers.h>
 #include <base/table.h>
 #include <lac/exceptions.h>
 
index d203064586c44399dc13eed69fc0f545f3dfe995..4c375109817c80e1574284f67a799e87bbf050d3 100644 (file)
@@ -15,7 +15,6 @@
 
 
 #include <base/config.h>
-#include <base/numbers.h>
 #include <base/subscriptor.h>
 #include <base/smartpointer.h>
 #include <lac/sparsity_pattern.h>
index 435b0bc0e387947c5a903259b9922517e2630296..b112250626ad2d3c0af80939c0e09b65d5b12dc4 100644 (file)
@@ -15,7 +15,6 @@
 
 
 #include <base/config.h>
-#include <base/numbers.h>
 #include <base/subscriptor.h>
 #include <base/smartpointer.h>
 #include <lac/exceptions.h>
index 9e9b1692ed72c0344106f18503d058e93b6cc99b..4f2fcf79127b06add3b3115110811e5e57aebf0c 100644 (file)
@@ -15,7 +15,6 @@
 
 
 #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.