From dae09773fc9291b004c21df345a004f207f0d76a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= Date: Tue, 29 Oct 2024 18:19:02 +0000 Subject: [PATCH] Don't pass matrices by value. --- test/reshape.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/reshape.cpp b/test/reshape.cpp index 7c76cd525..417d18abe 100644 --- a/test/reshape.cpp +++ b/test/reshape.cpp @@ -19,7 +19,7 @@ std::enable_if_t::value, bool> is_same_eq(const T1& a, } template -void check_auto_reshape4x4(MatType m) { +void check_auto_reshape4x4(const MatType& m) { internal::VariableAndFixedInt v1(1); internal::VariableAndFixedInt v2(2); internal::VariableAndFixedInt v4(4); @@ -50,10 +50,10 @@ void check_auto_reshape4x4(MatType m) { } template -void check_direct_access_reshape4x4(MatType, internal::FixedInt) {} +void check_direct_access_reshape4x4(const MatType&, internal::FixedInt) {} template -void check_direct_access_reshape4x4(MatType m, internal::FixedInt<0>) { +void check_direct_access_reshape4x4(const MatType& m, internal::FixedInt<0>) { VERIFY_IS_EQUAL(m.reshaped(1, 16).data(), m.data()); VERIFY_IS_EQUAL(m.reshaped(1, 16).innerStride(), 1); @@ -64,8 +64,9 @@ void check_direct_access_reshape4x4(MatType m, internal::FixedInt<0>) { // just test a 4x4 matrix, enumerate all combination manually template -void reshape4x4(MatType m) { +void reshape4x4(const MatType& m0) { typedef typename MatType::Scalar Scalar; + MatType m = m0; internal::VariableAndFixedInt v1(1); internal::VariableAndFixedInt v2(2);