]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add VectorizedArray::size() function
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 8 Oct 2019 07:15:59 +0000 (09:15 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 9 Oct 2019 07:28:21 +0000 (09:28 +0200)
include/deal.II/base/vectorization.h

index 96395f83242884da5f4735606efa7bdf0ac135c6..5dc022dfb11a5e0bbc6a5efa8ce736aee914c17c 100644 (file)
@@ -216,6 +216,16 @@ public:
     return *this;
   }
 
+  /**
+   * Return the number of elements in the array stored in the variable
+   * n_array_elements.
+   */
+  static constexpr unsigned int
+  size()
+  {
+    return n_array_elements;
+  }
+
   /**
    * Access operator (only valid with component 0 in the base class without
    * specialization).
@@ -684,6 +694,16 @@ public:
     return *this;
   }
 
+  /**
+   * Return the number of elements in the array stored in the variable
+   * n_array_elements.
+   */
+  static constexpr unsigned int
+  size()
+  {
+    return n_array_elements;
+  }
+
   /**
    * Access operator.
    */
@@ -1117,6 +1137,16 @@ public:
     return *this;
   }
 
+  /**
+   * Return the number of elements in the array stored in the variable
+   * n_array_elements.
+   */
+  static constexpr unsigned int
+  size()
+  {
+    return n_array_elements;
+  }
+
   /**
    * Access operator.
    */
@@ -1601,6 +1631,16 @@ public:
     return *this;
   }
 
+  /**
+   * Return the number of elements in the array stored in the variable
+   * n_array_elements.
+   */
+  static constexpr unsigned int
+  size()
+  {
+    return n_array_elements;
+  }
+
   /**
    * Access operator.
    */
@@ -2003,6 +2043,16 @@ public:
     return *this;
   }
 
+  /**
+   * Return the number of elements in the array stored in the variable
+   * n_array_elements.
+   */
+  static constexpr unsigned int
+  size()
+  {
+    return n_array_elements;
+  }
+
   /**
    * Access operator.
    */
@@ -2415,6 +2465,16 @@ public:
     this->operator=(scalar);
   }
 
+  /**
+   * Return the number of elements in the array stored in the variable
+   * n_array_elements.
+   */
+  static constexpr unsigned int
+  size()
+  {
+    return n_array_elements;
+  }
+
   /**
    * This function can be used to set all data fields to a given scalar.
    */
@@ -2788,6 +2848,16 @@ public:
     return *this;
   }
 
+  /**
+   * Return the number of elements in the array stored in the variable
+   * n_array_elements.
+   */
+  static constexpr unsigned int
+  size()
+  {
+    return n_array_elements;
+  }
+
   /**
    * Access operator.
    */
@@ -3169,6 +3239,16 @@ public:
     return *this;
   }
 
+  /**
+   * Return the number of elements in the array stored in the variable
+   * n_array_elements.
+   */
+  static constexpr unsigned int
+  size()
+  {
+    return n_array_elements;
+  }
+
   /**
    * Access operator. The component must be either 0 or 1.
    */
@@ -3401,6 +3481,16 @@ public:
     return *this;
   }
 
+  /**
+   * Return the number of elements in the array stored in the variable
+   * n_array_elements.
+   */
+  static constexpr unsigned int
+  size()
+  {
+    return n_array_elements;
+  }
+
   /**
    * Access operator. The component must be between 0 and 3.
    */

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.