Skip to content
Snippets Groups Projects
Commit c12886b4 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Provide explicit default constructors for TinyMatrix and TinyVector

g++-7 does not like the mix of constexpr and these implicit constructors
parent 91a2ab35
No related branches found
No related tags found
No related merge requests found
......@@ -46,11 +46,8 @@ public:
KOKKOS_INLINE_FUNCTION
constexpr friend TinyMatrix operator*(const T& t, const TinyMatrix& A)
{
TinyMatrix tA;
for (size_t i=0; i<N*N; ++i) {
tA.m_values[i] = t * A.m_values[i];
}
return std::move(tA);
TinyMatrix B = A;
return std::move(B *= t);
}
KOKKOS_INLINE_FUNCTION
......@@ -242,7 +239,10 @@ public:
}
KOKKOS_INLINE_FUNCTION
constexpr TinyMatrix() noexcept = default;
constexpr TinyMatrix() noexcept
{
;
}
KOKKOS_INLINE_FUNCTION
constexpr TinyMatrix(const ZeroType& z) noexcept
......@@ -273,7 +273,7 @@ public:
}
KOKKOS_INLINE_FUNCTION
constexpr TinyMatrix(TinyMatrix&& A) noexcept = default;
TinyMatrix(TinyMatrix&& A) noexcept = default;
KOKKOS_INLINE_FUNCTION
~TinyMatrix()=default;
......
......@@ -78,11 +78,8 @@ class TinyVector
KOKKOS_INLINE_FUNCTION
constexpr friend TinyVector operator*(const T& t, const TinyVector& v)
{
TinyVector tv;
for (size_t i=0; i<N; ++i) {
tv.m_values[i] = t * v.m_values[i];
}
return std::move(tv);
TinyVector w = v;
return std::move(w*=t);
}
KOKKOS_INLINE_FUNCTION
......@@ -230,10 +227,7 @@ class TinyVector
constexpr TinyVector(TinyVector&& v) noexcept = default;
KOKKOS_INLINE_FUNCTION
~TinyVector() noexcept
{
;
}
~TinyVector() noexcept = default;
};
template <size_t N, typename T>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment