diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-11-05 19:39:48 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-11-05 19:39:48 -0800 |
commit | 29038b982d4e8028b69211ef09e3fc3c7e6dfb69 (patch) | |
tree | 4fb700d05fa984582ce280527022f37d557b560d /unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | |
parent | fbcf8cc8c1096ef5cf4585e10af997ee94c2e981 (diff) |
Added support for modulo operation
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorBase.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index b004fdd7d..ceced984b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -173,6 +173,13 @@ class TensorBase<Derived, ReadOnlyAccessors> } EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_mod_op<Scalar>, const Derived> + operator% (Scalar rhs) const { + EIGEN_STATIC_ASSERT(std::numeric_limits<Scalar>::is_integer, YOU_MADE_A_PROGRAMMING_MISTAKE_TRY_MOD); + return unaryExpr(internal::scalar_mod_op<Scalar>(rhs)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<internal::scalar_max_op<Scalar>, const Derived, const TensorCwiseNullaryOp<internal::scalar_constant_op<Scalar>, const Derived> > cwiseMax(Scalar threshold) const { return cwiseMax(constant(threshold)); |