diff --git a/math/cmath/include/algebra/math/impl/cmath_getter.hpp b/math/cmath/include/algebra/math/impl/cmath_getter.hpp index e0824d2c..cd9b0463 100644 --- a/math/cmath/include/algebra/math/impl/cmath_getter.hpp +++ b/math/cmath/include/algebra/math/impl/cmath_getter.hpp @@ -134,7 +134,7 @@ struct vector_getter { ALGEBRA_HOST_DEVICE inline result_type operator()( const matrix_type &m, std::size_t row, std::size_t col) { - result_type subvector; + result_type subvector{}; for (std::size_t irow = row; irow < row + SIZE; ++irow) { subvector[irow - row] = m[col][irow]; } diff --git a/tests/common/test_host_basics.hpp b/tests/common/test_host_basics.hpp index bcde193b..da493cae 100644 --- a/tests/common/test_host_basics.hpp +++ b/tests/common/test_host_basics.hpp @@ -171,6 +171,11 @@ TYPED_TEST_P(test_host_basics, transform3) { auto m44 = trf2.matrix(); typename TypeParam::transform3 trfm(m44); + // Make sure that algebra::getter:vector can be called. + (void)algebra::getter::vector<3>(m44, 0, 0); + (void)algebra::getter::vector<3>(m44, 0, 1); + (void)algebra::getter::vector<3>(m44, 0, 2); + // Re-evaluate rot and trn auto rotm = trfm.rotation(); ASSERT_NEAR(element_getter(rotm, 0, 0), x[0], this->m_epsilon);