]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Polynomial: Make values_of_array always inline in release mode 16911/head
authorMartin Kronbichler <martin.kronbichler@rub.de>
Sat, 20 Apr 2024 06:08:26 +0000 (08:08 +0200)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Sat, 20 Apr 2024 06:08:26 +0000 (08:08 +0200)
include/deal.II/base/polynomial.h

index fbf98e6ee54f3d969749b31fdf4034c9950b425b..44953ff56d490b2fda1d6f7bf003527431df332e 100644 (file)
@@ -157,10 +157,13 @@ namespace Polynomials
      * `number` by `operator=`.
      */
     template <std::size_t n_entries, typename Number2>
-    void
-    values_of_array(const std::array<Number2, n_entries> &points,
-                    const unsigned int                    n_derivatives,
-                    std::array<Number2, n_entries>       *values) const;
+#ifndef DEBUG
+    DEAL_II_ALWAYS_INLINE
+#endif
+      void
+      values_of_array(const std::array<Number2, n_entries> &points,
+                      const unsigned int                    n_derivatives,
+                      std::array<Number2, n_entries>       *values) const;
 
     /**
      * Degree of the polynomial. This is the degree reflected by the number of
@@ -863,11 +866,15 @@ namespace Polynomials
 
   template <typename number>
   template <std::size_t n_entries, typename Number2>
-  inline void
-  Polynomial<number>::values_of_array(
-    const std::array<Number2, n_entries> &x,
-    const unsigned int                    n_derivatives,
-    std::array<Number2, n_entries>       *values) const
+  inline
+#ifndef DEBUG
+    DEAL_II_ALWAYS_INLINE
+#endif
+    void
+    Polynomial<number>::values_of_array(
+      const std::array<Number2, n_entries> &x,
+      const unsigned int                    n_derivatives,
+      std::array<Number2, n_entries>       *values) const
   {
     // evaluate Lagrange polynomial and derivatives
     if (in_lagrange_product_form == true)

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.