[ARITHMETIC][FUNCTIONS] modified teh transpose and adjoint implementations to use the in place version and avoid having a redundant copy

This commit is contained in:
kallore 2025-05-20 15:22:55 +02:00
parent 2cb2724bcd
commit b206f40372

View file

@ -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;