diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2013-10-17 15:37:29 +0200 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2013-10-17 15:37:29 +0200 |
commit | 36052c4911ff4a3034af260b56c7e8c7bdda017b (patch) | |
tree | a91581b7ee48ac3c299837b6e8f794d2ae5c35b1 /Eigen/src/plugins/ArrayCwiseUnaryOps.h | |
parent | 3d2a3bc755f34dd1df330aa2439ef8bacc78fe93 (diff) |
Added comparisons scalar to array (previously only the array to scalar was possible) (Fixes bug #147)
Extended the unit test for that
Diffstat (limited to 'Eigen/src/plugins/ArrayCwiseUnaryOps.h')
-rw-r--r-- | Eigen/src/plugins/ArrayCwiseUnaryOps.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Eigen/src/plugins/ArrayCwiseUnaryOps.h b/Eigen/src/plugins/ArrayCwiseUnaryOps.h index a59636790..b58d8667c 100644 --- a/Eigen/src/plugins/ArrayCwiseUnaryOps.h +++ b/Eigen/src/plugins/ArrayCwiseUnaryOps.h @@ -191,6 +191,11 @@ cube() const METHOD_NAME(const Scalar& s) const { \ return CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >, const Derived> \ (derived(), std::bind2nd(FUNCTOR<Scalar>(), s)); \ + } \ + friend inline const CwiseUnaryOp<std::binder1st<FUNCTOR<Scalar> >, const Derived> \ + METHOD_NAME(const Scalar& s, const Derived& d) { \ + return CwiseUnaryOp<std::binder1st<FUNCTOR<Scalar> >, const Derived> \ + (d, std::bind1st(FUNCTOR<Scalar>(), s)); \ } EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator==, std::equal_to) |