Make max/minCoeff templated on index type
See merge request oss/rotgen!23
This commit is contained in:
parent
c40a947daa
commit
d667fd28b5
12 changed files with 157 additions and 18 deletions
|
|
@ -268,11 +268,33 @@ namespace rotgen
|
|||
using parent::mean;
|
||||
using parent::prod;
|
||||
using parent::trace;
|
||||
using parent::maxCoeff;
|
||||
using parent::minCoeff;
|
||||
using parent::norm;
|
||||
using parent::squaredNorm;
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
template<int P> value_type lpNorm() const
|
||||
{
|
||||
static_assert(P == 1 || P == 2 || P == Infinity);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue