Make max/minCoeff templated on index type

See merge request oss/rotgen!23
This commit is contained in:
Joel Falcou 2025-09-18 15:08:10 +02:00
parent c40a947daa
commit d667fd28b5
12 changed files with 157 additions and 18 deletions

View file

@ -331,14 +331,14 @@ struct CLASSNAME::payload
return val;
}
TYPE CLASSNAME::minCoeff(std::ptrdiff_t* row, std::ptrdiff_t* col) const
TYPE CLASSNAME::minCoeff(Index* row, Index* col) const
{
TYPE val{};
storage_->apply([&](const auto& blk) { val = blk.minCoeff(row, col); });
return val;
}
TYPE CLASSNAME::maxCoeff(std::ptrdiff_t* row, std::ptrdiff_t* col) const
TYPE CLASSNAME::maxCoeff(Index* row, Index* col) const
{
TYPE val{};
storage_->apply([&](const auto& blk) { val = blk.maxCoeff(row, col); });

View file

@ -143,8 +143,8 @@ TYPE CLASSNAME::trace() const { return storage_->data.trace(); }
TYPE CLASSNAME::minCoeff() const { return storage_->data.minCoeff(); }
TYPE CLASSNAME::maxCoeff() const { return storage_->data.maxCoeff(); }
TYPE CLASSNAME::minCoeff(std::ptrdiff_t* row, std::ptrdiff_t* col) const { return storage_->data.minCoeff(row, col); }
TYPE CLASSNAME::maxCoeff(std::ptrdiff_t* row, std::ptrdiff_t* col) const { return storage_->data.maxCoeff(row, col); }
TYPE CLASSNAME::minCoeff(Index* row, Index* col) const { return storage_->data.minCoeff(row, col); }
TYPE CLASSNAME::maxCoeff(Index* row, Index* col) const { return storage_->data.maxCoeff(row, col); }
TYPE CLASSNAME::squaredNorm() const { return storage_->data.squaredNorm(); }
TYPE CLASSNAME::norm() const { return storage_->data.norm(); }