diff options
author | 2015-06-09 10:52:04 +0200 | |
---|---|---|
committer | 2015-06-09 10:52:04 +0200 | |
commit | 3a4299b2454859cc386a14c1ea97ed868bffd2bf (patch) | |
tree | 56f975dc4a52fc3d982d8392ed67390d3190602f /Eigen/src/plugins | |
parent | 9aef0db9928e54d1b0a317b07c2cc3a9b42fe5b2 (diff) |
bug #872: remove usage of deprecated bind1st.
Diffstat (limited to 'Eigen/src/plugins')
-rw-r--r-- | Eigen/src/plugins/MatrixCwiseBinaryOps.h | 18 | ||||
-rw-r--r-- | Eigen/src/plugins/MatrixCwiseUnaryOps.h | 21 |
2 files changed, 21 insertions, 18 deletions
diff --git a/Eigen/src/plugins/MatrixCwiseBinaryOps.h b/Eigen/src/plugins/MatrixCwiseBinaryOps.h index b9582a5a0..6dd2e1192 100644 --- a/Eigen/src/plugins/MatrixCwiseBinaryOps.h +++ b/Eigen/src/plugins/MatrixCwiseBinaryOps.h @@ -132,3 +132,21 @@ cwiseQuotient(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { return CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>(derived(), other.derived()); } + +typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar,internal::cmp_EQ>, const Derived, const ConstantReturnType> CwiseScalarEqualReturnType; + +/** \returns an expression of the coefficient-wise == operator of \c *this and a scalar \a s + * + * \warning this performs an exact comparison, which is generally a bad idea with floating-point types. + * In order to check for equality between two vectors or matrices with floating-point coefficients, it is + * generally a far better idea to use a fuzzy comparison as provided by isApprox() and + * isMuchSmallerThan(). + * + * \sa cwiseEqual(const MatrixBase<OtherDerived> &) const + */ +EIGEN_DEVICE_FUNC +inline const CwiseScalarEqualReturnType +cwiseEqual(const Scalar& s) const +{ + return CwiseScalarEqualReturnType(derived(), Derived::Constant(rows(), cols(), s), internal::scalar_cmp_op<Scalar,internal::cmp_EQ>()); +} diff --git a/Eigen/src/plugins/MatrixCwiseUnaryOps.h b/Eigen/src/plugins/MatrixCwiseUnaryOps.h index c99ee94ec..e339140bf 100644 --- a/Eigen/src/plugins/MatrixCwiseUnaryOps.h +++ b/Eigen/src/plugins/MatrixCwiseUnaryOps.h @@ -8,13 +8,14 @@ // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -// This file is a base class plugin containing matrix specifics coefficient wise functions. +// This file is included into the body of the base classes supporting matrix specific coefficient-wise functions. +// This include MatrixBase and SparseMatrixBase. typedef CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived> CwiseAbsReturnType; typedef CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived> CwiseAbs2ReturnType; typedef CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived> CwiseSqrtReturnType; typedef CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived> CwiseInverseReturnType; -typedef CwiseUnaryOp<std::binder1st<std::equal_to<Scalar> >, const Derived> CwiseScalarEqualReturnType; + /** \returns an expression of the coefficient-wise absolute value of \c *this * * Example: \include MatrixBase_cwiseAbs.cpp @@ -58,19 +59,3 @@ cwiseSqrt() const { return CwiseSqrtReturnType(derived()); } EIGEN_DEVICE_FUNC inline const CwiseInverseReturnType cwiseInverse() const { return CwiseInverseReturnType(derived()); } - -/** \returns an expression of the coefficient-wise == operator of \c *this and a scalar \a s - * - * \warning this performs an exact comparison, which is generally a bad idea with floating-point types. - * In order to check for equality between two vectors or matrices with floating-point coefficients, it is - * generally a far better idea to use a fuzzy comparison as provided by isApprox() and - * isMuchSmallerThan(). - * - * \sa cwiseEqual(const MatrixBase<OtherDerived> &) const - */ -EIGEN_DEVICE_FUNC -inline const CwiseScalarEqualReturnType -cwiseEqual(const Scalar& s) const -{ - return CwiseScalarEqualReturnType(derived(), std::bind1st(std::equal_to<Scalar>(), s)); -} |