]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added operator== for VectorizedArray
authorJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 12 Aug 2017 07:04:41 +0000 (01:04 -0600)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Tue, 15 Aug 2017 15:03:47 +0000 (09:03 -0600)
include/deal.II/base/vectorization.h

index 96231eaf35f93a24586cc2d73d995186990e3460..74dbedf6ba0252fb5c745708661f6027eeaac83f 100644 (file)
@@ -2706,6 +2706,25 @@ vectorized_transpose_and_store(const bool                    add_into,
 #endif // if DEAL_II_COMPILER_VECTORIZATION_LEVEL > 0
 
 
+/**
+ * Relational operator == for VectorizedArray
+ *
+ * @relates VectorizedArray
+ */
+template <typename Number>
+inline DEAL_II_ALWAYS_INLINE
+bool
+operator == (const VectorizedArray<Number> &lhs,
+             const VectorizedArray<Number> &rhs)
+{
+  for (unsigned int i=0; i<VectorizedArray<Number>::n_array_elements; ++i)
+    if (lhs[i] != rhs[i])
+      return false;
+
+  return true;
+}
+
+
 /**
  * Addition of two vectorized arrays with operator +.
  *

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.