Implements map and ref for both static & dynamic mode

See merge request oss/rotgen!12
This commit is contained in:
Joel Falcou 2025-08-13 17:43:57 +02:00
parent aacae1cbb1
commit 6c2b260229
58 changed files with 4121 additions and 1205 deletions

View file

@ -46,7 +46,7 @@ CLASSNAME& CLASSNAME::operator=(CLASSNAME const& o)
CLASSNAME& CLASSNAME::operator=(CLASSNAME&&) noexcept = default;
CLASSNAME::~CLASSNAME() = default;
CLASSNAME::~CLASSNAME() = default;
//==================================================================================================
// Matrix API
@ -72,6 +72,7 @@ TYPE& CLASSNAME::operator()(std::size_t index) { return storage_->da
TYPE const& CLASSNAME::operator()(std::size_t index) const { return storage_->data(index); }
const TYPE* CLASSNAME::data() const { return storage_->data.data(); }
TYPE* CLASSNAME::data() { return storage_->data.data(); }
CLASSNAME CLASSNAME::transpose() const
{
@ -139,6 +140,11 @@ bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs)
return lhs.storage_->data == rhs.storage_->data;
}
bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs)
{
return lhs.storage_->data != rhs.storage_->data;
}
CLASSNAME& CLASSNAME::operator+=(CLASSNAME const& rhs)
{
storage_->data += rhs.storage_->data;
@ -180,6 +186,13 @@ CLASSNAME& CLASSNAME::operator/=(TYPE s)
// Static functions
//==================================================================================================
CLASSNAME CLASSNAME::Ones(std::size_t rows, std::size_t cols)
{
CLASSNAME m;
m.storage_ = std::make_unique<payload>(payload::data_type::Ones(rows, cols));
return m;
}
CLASSNAME CLASSNAME::Zero(std::size_t rows, std::size_t cols)
{
CLASSNAME m;