mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Support Product::coeff(0,0) even for dynamic matrices
This commit is contained in:
@@ -109,16 +109,6 @@ public:
|
||||
{
|
||||
return typename internal::evaluator<ProductXpr>::type(derived()).coeff(0,0);
|
||||
}
|
||||
|
||||
Scalar coeff(Index row, Index col) const
|
||||
{
|
||||
return typename internal::evaluator<ProductXpr>::type(derived()).coeff(row,col);
|
||||
}
|
||||
|
||||
Scalar coeff(Index i) const
|
||||
{
|
||||
return typename internal::evaluator<ProductXpr>::type(derived()).coeff(i);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
@@ -132,6 +122,22 @@ class ProductImpl<Lhs,Rhs,Option,Dense>
|
||||
|
||||
typedef typename internal::dense_product_base<Lhs, Rhs, Option> Base;
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
|
||||
|
||||
Scalar coeff(Index row, Index col) const
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
|
||||
eigen_assert(this->rows() == 1 && this->cols() == 1);
|
||||
|
||||
return typename internal::evaluator<Derived>::type(derived()).coeff(row,col);
|
||||
}
|
||||
|
||||
Scalar coeff(Index i) const
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
|
||||
eigen_assert(this->rows() == 1 && this->cols() == 1);
|
||||
|
||||
return typename internal::evaluator<Derived>::type(derived()).coeff(i);
|
||||
}
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user