From b206f40372dd5fa41536f658a3d0de6ff1c1f647 Mon Sep 17 00:00:00 2001 From: kallore Date: Tue, 20 May 2025 15:22:55 +0200 Subject: [PATCH] [ARITHMETIC][FUNCTIONS] modified teh transpose and adjoint implementations to use the in place version and avoid having a redundant copy --- src/matrix_impl64.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/matrix_impl64.cpp b/src/matrix_impl64.cpp index 34cb985..f70259a 100644 --- a/src/matrix_impl64.cpp +++ b/src/matrix_impl64.cpp @@ -79,8 +79,9 @@ namespace rotgen matrix_impl64 matrix_impl64::transpose() const { matrix_impl64 result(*this); - result.storage_->data = storage_->data.transpose(); + result.storage_->data.transposeInPlace(); return result; + } matrix_impl64 matrix_impl64::conjugate() const @@ -93,7 +94,7 @@ namespace rotgen matrix_impl64 matrix_impl64::adjoint() const { matrix_impl64 result(*this); - result.storage_->data = storage_->data.adjoint(); + result.storage_->data.adjointInPlace(); return result; } @@ -144,7 +145,8 @@ namespace rotgen return *this; } - matrix_impl64 matrix_impl64::operator-() const { + matrix_impl64 matrix_impl64::operator-() const + { matrix_impl64 result(*this); result.storage_->data = -result.storage_->data; return result;