]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement numbers::signaling_nan() also for Point<dim>.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 19 Jan 2017 01:12:05 +0000 (18:12 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 19 Jan 2017 01:12:05 +0000 (18:12 -0700)
include/deal.II/base/signaling_nan.h

index 6c9a42354f93993ee21ef0b7ebc129f6c7d69bec..5011dd52754ffe381663d3e1eeb3996d1f35fca2 100644 (file)
@@ -20,6 +20,7 @@
 #include <deal.II/base/tensor.h>
 #include <deal.II/base/symmetric_tensor.h>
 #include <deal.II/base/derivative_form.h>
+#include <deal.II/base/point.h>
 
 #include <limits>
 
@@ -122,6 +123,27 @@ namespace numbers
 
 
 
+      /**
+       * A specialization of the general NaNInitializer class that provides a
+       * function that returns a Tensor<rank,dim> value whose components are
+       * invalid signaling NaN values.
+       */
+      template <int dim, typename T>
+      struct NaNInitializer<Point<dim,T> >
+      {
+        static Point<dim,T> invalid_element ()
+        {
+          Point<dim,T> nan_point;
+
+          for (unsigned int i=0; i<dim; ++i)
+            nan_point[i] = NaNInitializer<T>::invalid_element();
+
+          return nan_point;
+        }
+      };
+
+
+
       /**
        * A specialization of the general NaNInitializer class that provides a
        * function that returns a SymmetricTensor<rank,dim> value whose

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.