Implement unary cwiseXXX() member functions + associated free functions

See merge request oss/rotgen!17
This commit is contained in:
Joel Falcou 2025-09-03 11:50:00 +02:00
parent a2e7718a48
commit 0a3abbb58b
15 changed files with 207 additions and 6 deletions

View file

@ -106,6 +106,34 @@ void CLASSNAME::adjointInPlace()
storage_->data.adjointInPlace();
}
CLASSNAME CLASSNAME::cwiseAbs() const
{
CLASSNAME result(*this);
result.storage_->data = storage_->data.cwiseAbs();
return result;
}
CLASSNAME CLASSNAME::cwiseAbs2() const
{
CLASSNAME result(*this);
result.storage_->data = storage_->data.cwiseAbs2();
return result;
}
CLASSNAME CLASSNAME::cwiseInverse() const
{
CLASSNAME result(*this);
result.storage_->data = storage_->data.cwiseInverse();
return result;
}
CLASSNAME CLASSNAME::cwiseSqrt() const
{
CLASSNAME result(*this);
result.storage_->data = storage_->data.cwiseSqrt();
return result;
}
TYPE CLASSNAME::sum() const { return storage_->data.sum(); }
TYPE CLASSNAME::prod() const { return storage_->data.prod(); }
TYPE CLASSNAME::mean() const { return storage_->data.mean(); }