From 740d7d1055ddecb574635a9b97af5a21b83e95c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Thu, 29 Dec 2016 15:04:38 +0100 Subject: [PATCH] Fixed bugs in StaticVector --- src/TNL/Containers/StaticVector.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TNL/Containers/StaticVector.h b/src/TNL/Containers/StaticVector.h index d3a10c9865..2b0e7c7fde 100644 --- a/src/TNL/Containers/StaticVector.h +++ b/src/TNL/Containers/StaticVector.h @@ -306,9 +306,9 @@ class StaticVector< 3, Real > : public Containers::StaticArray< 3, Real > ThisType abs() const; }; -template< int Size, typename Real > +template< int Size, typename Real, typename Scalar > __cuda_callable__ -StaticVector< Size, Real > operator * ( const Real& c, const StaticVector< Size, Real >& u ); +StaticVector< Size, Real > operator * ( const Scalar& c, const StaticVector< Size, Real >& u ); template< int Size, typename Real > __cuda_callable__ @@ -377,10 +377,10 @@ Real tnlTriangleArea( const StaticVector< 3, Real >& a, StaticVector< 3, Real > u1, u2; u1. x() = b. x() - a. x(); u1. y() = b. y() - a. y(); - u1. z() = 0.0; + u1. z() = b. z() - a. z(); u2. x() = c. x() - a. x(); u2. y() = c. y() - a. y(); - u2. z() = 0; + u2. z() = c. z() - a. z(); const StaticVector< 3, Real > v = VectorProduct( u1, u2 ); return 0.5 * ::sqrt( tnlScalarProduct( v, v ) ); -- GitLab