Implements noalias/evaluate

See merge request oss/rotgen!18
This commit is contained in:
Joel Falcou 2025-09-09 15:21:35 +02:00
parent 1f8663aad2
commit cc5ab775bc
9 changed files with 181 additions and 2 deletions

View file

@ -72,6 +72,16 @@ namespace rotgen
return *this;
}
map& operator=(concepts::entity auto const& other) requires(!is_immutable)
{
assert(parent::rows() == other.rows() && parent::cols() == other.cols());
for (rotgen::Index r = 0; r < parent::rows(); ++r)
for (rotgen::Index c = 0; c < parent::cols(); ++c)
(*this)(r, c) = other(r, c);
return *this;
}
value_type& operator()(Index i, Index j) requires(!is_immutable) { return parent::operator()(i,j); }
value_type& operator()(Index i) requires(!is_immutable)
{
@ -90,6 +100,10 @@ namespace rotgen
return parent::operator()(i);
}
auto evaluate() const { return *this; }
decltype(auto) noalias() const { return *this; }
decltype(auto) noalias() { return *this; }
concrete_type transpose() const
{
return concrete_type(static_cast<parent const &>(*this).transpose());