]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Minor code and documentation updates. 8922/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 18 Oct 2019 05:39:59 +0000 (23:39 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 18 Oct 2019 05:39:59 +0000 (23:39 -0600)
include/deal.II/base/vectorization.h

index 58f40cbc6de6317a63ec48c44a0a35249a463975..d39cc14a0fd0021ccfe51d1c0544aa004c86f6d9 100644 (file)
@@ -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<T>
-  end()
+  VectorizedArrayIterator<const T>
+  begin() const
   {
-    return VectorizedArrayIterator<T>(static_cast<T &>(*this),
-                                      T::n_array_elements);
+    return VectorizedArrayIterator<const T>(static_cast<const T &>(*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<const T>
-  begin() const
+  VectorizedArrayIterator<T>
+  end()
   {
-    return VectorizedArrayIterator<const T>(static_cast<const T &>(*this), 0);
+    return VectorizedArrayIterator<T>(static_cast<T &>(*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<const T>

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.