From f275afdddc9ea074ab6097fc04268d52a0ba6ed3 Mon Sep 17 00:00:00 2001 From: Daniel Garcia-Sanchez Date: Wed, 24 Jul 2019 20:47:54 +0200 Subject: [PATCH] Add Point assignment operator Assignment operator from a Tensor<1, dim, Number> with different underlying scalar type. --- include/deal.II/base/point.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/deal.II/base/point.h b/include/deal.II/base/point.h index 3afb0fa319..f2836107ec 100644 --- a/include/deal.II/base/point.h +++ b/include/deal.II/base/point.h @@ -195,6 +195,15 @@ public: DEAL_II_CUDA_HOST_DEV Number & operator()(const unsigned int index); + /** + * Assignment operator from Tensor<1, dim, Number> with different underlying + * scalar type. This obviously requires that the @p OtherNumber type is + * convertible to @p Number. + */ + template + Point & + operator=(const Tensor<1, dim, OtherNumber> &p); + /** * @name Addition and subtraction of points. * @{ @@ -481,6 +490,17 @@ Point::operator()(const unsigned int index) +template +template +inline DEAL_II_ALWAYS_INLINE Point & +Point::operator=(const Tensor<1, dim, OtherNumber> &p) +{ + Tensor<1, dim, Number>::operator=(p); + return *this; +} + + + template inline DEAL_II_CUDA_HOST_DEV Point Point::operator+(const Tensor<1, dim, Number> &p) const -- 2.39.5