From 95e56587b70b336331df0f9895a37270f8ac2665 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 8 Oct 2019 09:15:59 +0200 Subject: [PATCH] Add VectorizedArray::size() function --- include/deal.II/base/vectorization.h | 90 ++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index 96395f8324..5dc022dfb1 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -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. */ -- 2.39.5