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

@ -181,6 +181,29 @@ namespace rotgen
return *this;
}
auto minCoeff() const { return parent::minCoeff(); }
auto maxCoeff() const { return parent::maxCoeff(); }
template<std::integral IndexType>
auto minCoeff(IndexType* row, IndexType* col) const
{
Index r,c;
auto result = parent::minCoeff(&r, &c);
*row = r;
*col = c;
return result;
}
template<std::integral IndexType>
auto maxCoeff(IndexType* row, IndexType* col) const
{
Index r,c;
auto result = parent::maxCoeff(&r, &c);
*row = r;
*col = c;
return result;
}
static auto Zero() requires( requires {Ref::Zero();} )
{
return Ref::Zero();