From e2a9a17a0c45bf7ddf2f78b83ac8564998490aae Mon Sep 17 00:00:00 2001 From: Joana Niermann Date: Wed, 4 Dec 2024 21:07:42 +0100 Subject: [PATCH] A few samll fixes --- math/eigen/include/algebra/math/impl/eigen_transform3.hpp | 8 ++++---- storage/common/include/algebra/storage/matrix_getter.hpp | 2 +- .../include/algebra/storage/impl/smatrix_getter.hpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/math/eigen/include/algebra/math/impl/eigen_transform3.hpp b/math/eigen/include/algebra/math/impl/eigen_transform3.hpp index 13c54d85..bda16dd7 100644 --- a/math/eigen/include/algebra/math/impl/eigen_transform3.hpp +++ b/math/eigen/include/algebra/math/impl/eigen_transform3.hpp @@ -65,10 +65,8 @@ struct transform3 { /// @name Data objects /// @{ - Eigen::Transform _data = - Eigen::Transform::Identity(); - Eigen::Transform _data_inv = - Eigen::Transform::Identity(); + Eigen::Transform _data; + Eigen::Transform _data_inv; /// @} @@ -81,6 +79,8 @@ struct transform3 { ALGEBRA_HOST_DEVICE transform3(const vector3 &t, const vector3 &x, const vector3 &y, const vector3 &z, bool get_inverse = true) { + _data.setIdentity(); + auto &matrix = _data.matrix(); matrix.template block<3, 1>(0, 0) = x; matrix.template block<3, 1>(0, 1) = y; diff --git a/storage/common/include/algebra/storage/matrix_getter.hpp b/storage/common/include/algebra/storage/matrix_getter.hpp index 5ac91568..53582880 100644 --- a/storage/common/include/algebra/storage/matrix_getter.hpp +++ b/storage/common/include/algebra/storage/matrix_getter.hpp @@ -241,7 +241,7 @@ ALGEBRA_HOST_DEVICE constexpr void set_block( if constexpr (ROWS == mROW && matrix_t::storage_rows() == input_matrix_t::storage_rows()) { if (row == 0u) { - for (std::size_t j = col; j < mCOL; ++j) { + for (std::size_t j = col; j < col + COLS; ++j) { m[j] = b[j - col]; } return; diff --git a/storage/smatrix/include/algebra/storage/impl/smatrix_getter.hpp b/storage/smatrix/include/algebra/storage/impl/smatrix_getter.hpp index 8433779f..e25c1de0 100644 --- a/storage/smatrix/include/algebra/storage/impl/smatrix_getter.hpp +++ b/storage/smatrix/include/algebra/storage/impl/smatrix_getter.hpp @@ -145,8 +145,8 @@ struct block_getter { ROOT::Math::SVector ret; - for (std::size_t irow = row; irow < row + SIZE; ++irow) { - ret[irow - row] = m[col][irow]; + for (unsigned int irow = row; irow < row + SIZE; ++irow) { + ret[irow - row] = m(irow, col); } return ret;