From 4edeb988473f05af4d0a2c194c92a24cfe4de9a0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 17 Oct 2019 23:39:59 -0600 Subject: [PATCH] Minor code and documentation updates. --- include/deal.II/base/vectorization.h | 34 +++++++++++++++------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index 58f40cbc6d..d39cc14a0f 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -99,7 +99,7 @@ public: * @param data The actual VectorizedArray. * @param lane A pointer to the current lane. */ - VectorizedArrayIterator(T &data, unsigned int lane) + VectorizedArrayIterator(T &data, const unsigned int lane) : data(data) , lane(lane) {} @@ -162,11 +162,13 @@ private: /** - * A base class for the VectorizedArray specialization, containing common - * functionalities. + * A base class for the various VectorizedArray template specializations, + * containing common functionalities. * - * @tparam Type of the actual vectorized array. We are using CRTP to prevent - * the usage of the virtual keyword. + * @tparam T Type of the actual vectorized array. We are using the + * Couriously Recurring Template Pattern (see + * https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern) in this + * class to avoid having to resort to `virtual` member functions. * * @author Peter Munch, 2019 */ @@ -194,27 +196,27 @@ public: } /** - * @return An iterator pointing to the end of the underlying data. + * @return An iterator pointing to the beginning of the underlying data (`const` + * version). */ - VectorizedArrayIterator - end() + VectorizedArrayIterator + begin() const { - return VectorizedArrayIterator(static_cast(*this), - T::n_array_elements); + return VectorizedArrayIterator(static_cast(*this), 0); } /** - * @return An iterator pointing to the beginning of the underlying data (const - * version). + * @return An iterator pointing to the end of the underlying data. */ - VectorizedArrayIterator - begin() const + VectorizedArrayIterator + end() { - return VectorizedArrayIterator(static_cast(*this), 0); + return VectorizedArrayIterator(static_cast(*this), + T::n_array_elements); } /** - * @return An iterator pointing to the end of the underlying data (const + * @return An iterator pointing to the end of the underlying data (`const` * version). */ VectorizedArrayIterator -- 2.39.5