From 7d0a363ada30da976a3630a3ce7f0f2df072ba7f Mon Sep 17 00:00:00 2001 From: mdessole Date: Wed, 23 Apr 2025 13:51:19 +0200 Subject: [PATCH 1/2] [GenVector] Add access operator for Rotation3D --- math/genvector/inc/Math/GenVector/Rotation3D.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/math/genvector/inc/Math/GenVector/Rotation3D.h b/math/genvector/inc/Math/GenVector/Rotation3D.h index 5bd3b3fabe6dc..f2026b731ebfc 100644 --- a/math/genvector/inc/Math/GenVector/Rotation3D.h +++ b/math/genvector/inc/Math/GenVector/Rotation3D.h @@ -34,6 +34,7 @@ #include "Math/GenVector/RotationYfwd.h" #include "Math/GenVector/RotationZfwd.h" +#include "Math/GenVector/GenVector_exception.h" #include #include @@ -345,6 +346,18 @@ class Rotation3D { // =========== operations ============== + /** + Access operator + */ + Scalar operator()(size_t i, size_t j) const + { + if (i < 3 && j < 3) + return fM[i + 3 * j]; + else + GenVector::Throw("Rotation3D::operator(size_t i, size_t j):\n" + " indices i and j must range in {0,1,2}"); + return 0.0; + } /** Rotation operation on a displacement vector in any coordinate system From f257a6edfc33680280a92c4629a02b08fcfdba49 Mon Sep 17 00:00:00 2001 From: mdessole Date: Mon, 28 Apr 2025 10:00:03 +0200 Subject: [PATCH 2/2] [GenVector] Add parameters in documentation --- math/genvector/inc/Math/GenVector/Rotation3D.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/math/genvector/inc/Math/GenVector/Rotation3D.h b/math/genvector/inc/Math/GenVector/Rotation3D.h index f2026b731ebfc..55409e2ebda61 100644 --- a/math/genvector/inc/Math/GenVector/Rotation3D.h +++ b/math/genvector/inc/Math/GenVector/Rotation3D.h @@ -347,7 +347,9 @@ class Rotation3D { // =========== operations ============== /** - Access operator + Access operator, used to have direct access to rotation matrix's entries + \param i row index in {0,1,2} + \param j column index in {0,1,2} */ Scalar operator()(size_t i, size_t j) const {