aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/plugins/ArrayCwiseUnaryOps.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-12-16 19:18:40 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-12-16 19:18:40 +0100
commit9f7955883918f09648618f89f1551b0b6667343d (patch)
treec56b94c1453c3578eb5939c3939099bf41a9cff0 /Eigen/src/plugins/ArrayCwiseUnaryOps.h
parent22a6ab1f4b473a97b1d9bf27eb91788f35d9ac40 (diff)
a lot of cleaning and fixes
Diffstat (limited to 'Eigen/src/plugins/ArrayCwiseUnaryOps.h')
-rw-r--r--Eigen/src/plugins/ArrayCwiseUnaryOps.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Eigen/src/plugins/ArrayCwiseUnaryOps.h b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
index 63bd43871..ce69a04b5 100644
--- a/Eigen/src/plugins/ArrayCwiseUnaryOps.h
+++ b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
@@ -146,3 +146,17 @@ cube() const
{
return derived();
}
+
+#define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(METHOD_NAME,FUNCTOR) \
+ inline const CwiseUnaryOp<std::binder1st<FUNCTOR<Scalar> >,Derived> \
+ METHOD_NAME(Scalar s) const { \
+ return CwiseUnaryOp<std::binder1st<FUNCTOR<Scalar> >,Derived> \
+ (derived(), std::bind1st(FUNCTOR<Scalar>(), s)); \
+ }
+
+EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator==, std::equal_to);
+EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator!=, std::not_equal_to);
+EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator<, std::less);
+EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator<=, std::less_equal);
+EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>, std::greater);
+EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>=, std::greater_equal);