From 08da52eb8537107e2853452bb13c369856d1f84a Mon Sep 17 00:00:00 2001 From: David Tellenbach Date: Sat, 27 Nov 2021 14:31:00 +0000 Subject: [PATCH] Remove DenseBase::nonZeros() which just calls DenseBase::size() Fixes #2382. --- Eigen/src/Core/DenseBase.h | 5 ----- unsupported/test/kronecker_product.cpp | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index 940eabd92..09a44f811 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -204,11 +204,6 @@ template class DenseBase typedef typename internal::conditional::XprKind,MatrixXpr >::value, PlainMatrix, PlainArray>::type PlainObject; - /** \returns the number of nonzero coefficients which is in practice the number - * of stored coefficients. */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR - inline Index nonZeros() const { return size(); } - /** \returns the outer size. * * \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension diff --git a/unsupported/test/kronecker_product.cpp b/unsupported/test/kronecker_product.cpp index b5b764c65..3bac01db4 100644 --- a/unsupported/test/kronecker_product.cpp +++ b/unsupported/test/kronecker_product.cpp @@ -29,7 +29,7 @@ void check_kronecker_product(const MatrixType& ab) { VERIFY_IS_EQUAL(ab.rows(), 6); VERIFY_IS_EQUAL(ab.cols(), 6); - VERIFY_IS_EQUAL(ab.nonZeros(), 36); + VERIFY_IS_EQUAL(ab.size(), 36); VERIFY_IS_APPROX(ab.coeff(0,0), -0.4017367630386106); VERIFY_IS_APPROX(ab.coeff(0,1), 0.1056863433932735); VERIFY_IS_APPROX(ab.coeff(0,2), -0.7255206194554212);