From: Wolfgang Bangerth Date: Sun, 4 Nov 2007 00:08:09 +0000 (+0000) Subject: Use a better way to see whether two vectors are the same. X-Git-Tag: v8.0.0~9662 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=664bd23a660889bc1afc2c5f458fbe1fdfae7061;p=dealii.git Use a better way to see whether two vectors are the same. git-svn-id: https://svn.dealii.org/trunk@15435 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/vector.templates.h b/deal.II/lac/include/lac/vector.templates.h index 70c396ede1..3cea6f17f2 100644 --- a/deal.II/lac/include/lac/vector.templates.h +++ b/deal.II/lac/include/lac/vector.templates.h @@ -14,6 +14,7 @@ #define __deal2__vector_templates_h +#include #include #include @@ -201,7 +202,7 @@ Number Vector::operator * (const Vector& v) const { Assert (vec_size!=0, ExcEmptyObject()); - if (this == reinterpret_cast*>(&v)) + if (PointerComparison::equal (this, &v)) return norm_sqr(); Assert (vec_size == v.size(), ExcDimensionMismatch(vec_size, v.size()));