diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-08-03 11:53:04 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-08-03 11:53:04 -0700 |
commit | ca2cee27397e04357756c2d2b03751899bc0de00 (patch) | |
tree | 8a83bda410520986bfd368e002f7479714dcb1f6 | |
parent | d92df04ce893b75c9d2c8ebc463c17a05425edb7 (diff) | |
parent | 78f37ca03ce9a6e348858d1b7d7b2c2b0e7fec93 (diff) |
Merged in ibab/eigen (pull request PR-206)
Expose real and imag methods on Tensors
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index 69d91c97b..19d2b50b5 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -210,6 +210,18 @@ class TensorBase<Derived, ReadOnlyAccessors> } EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_real_op<Scalar>, const Derived> + real() const { + return unaryExpr(internal::scalar_real_op<Scalar>()); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_imag_op<Scalar>, const Derived> + imag() const { + return unaryExpr(internal::scalar_imag_op<Scalar>()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::bind2nd_op<internal::scalar_sum_op<Scalar,Scalar> >, const Derived> operator+ (Scalar rhs) const { return unaryExpr(internal::bind2nd_op<internal::scalar_sum_op<Scalar,Scalar> >(rhs)); |