From a65bdf1377c90eba8493493f636472ef2242355d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Thu, 20 Sep 2018 11:31:23 +0200 Subject: [PATCH] Fixes in ArrayView and VectorView --- src/TNL/Containers/ArrayView.h | 2 +- src/TNL/Containers/VectorView.h | 2 +- src/TNL/Containers/VectorView_impl.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TNL/Containers/ArrayView.h b/src/TNL/Containers/ArrayView.h index 05f00a418c..8b2b1ef33e 100644 --- a/src/TNL/Containers/ArrayView.h +++ b/src/TNL/Containers/ArrayView.h @@ -52,7 +52,7 @@ public: // "Templated copy-constructor" accepting any cv-qualification of Value template< typename Value_ > __cuda_callable__ - ArrayView( ArrayView< Value_, Device, Index >& array ) + ArrayView( const ArrayView< Value_, Device, Index >& array ) : data(array.getData()), size(array.getSize()) {} // default move-constructor diff --git a/src/TNL/Containers/VectorView.h b/src/TNL/Containers/VectorView.h index c53a165d11..4ef863aa90 100644 --- a/src/TNL/Containers/VectorView.h +++ b/src/TNL/Containers/VectorView.h @@ -109,7 +109,7 @@ public: //! Computes scalar dot product template< typename Vector > - NonConstReal scalarProduct( const Vector& v ); + NonConstReal scalarProduct( const Vector& v ) const; //! Computes this = thisMultiplicator * this + alpha * x. template< typename Vector > diff --git a/src/TNL/Containers/VectorView_impl.h b/src/TNL/Containers/VectorView_impl.h index 5e120b32c1..fed792ab33 100644 --- a/src/TNL/Containers/VectorView_impl.h +++ b/src/TNL/Containers/VectorView_impl.h @@ -243,7 +243,7 @@ template< typename Real, template< typename Vector > typename VectorView< Real, Device, Index >::NonConstReal VectorView< Real, Device, Index >:: -scalarProduct( const Vector& v ) +scalarProduct( const Vector& v ) const { return Algorithms::VectorOperations< Device >::template getScalarProduct< VectorView, Vector, NonConstReal >( *this, v ); } -- GitLab