[ARITHMETIC][FUNCTIONS] implemented and tested the unary operations transpose, adjoint, conjugate and transposeInPlace and adjointInPlace

This commit is contained in:
kallore 2025-05-20 10:23:57 +02:00
parent 8759c7381a
commit 8aea305ad3
4 changed files with 119 additions and 0 deletions

View file

@ -36,6 +36,13 @@ namespace rotgen
void resize(std::size_t new_rows, std::size_t new_cols);
void conservativeResize(std::size_t new_rows, std::size_t new_cols);
matrix_impl64 transpose() const;
matrix_impl64 conjugate() const;
matrix_impl64 adjoint() const;
void transposeInPlace();
void adjointInPlace();
double& operator()(std::size_t i, std::size_t j);
double const& operator()(std::size_t i, std::size_t j) const;

View file

@ -60,6 +60,25 @@ namespace rotgen
parent::conservativeResize(new_rows, new_cols);
}
matrix transpose() const
{
return matrix(static_cast<parent const&>(*this).transpose());
}
matrix conjugate() const
{
return matrix(static_cast<parent const&>(*this).conjugate());
}
matrix adjoint() const
{
return matrix(static_cast<parent const&>(*this).adjoint());
}
void transposeInPlace() { parent::transposeInPlace(); }
void adjointInPlace() { parent::adjointInPlace(); }
friend bool operator==(matrix const& lhs, matrix const& rhs)
{
return static_cast<parent const&>(lhs) == static_cast<parent const&>(rhs);