aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-06-02 08:08:11 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-06-02 08:08:11 -0700
commit6021c90fdf034cd94502cd1e122407a88ffe6105 (patch)
tree82bfb92ee46f2ec3e218b33299ec166408da6a3f /unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
parent8b6f53222b84d1e4f0f1e86b1d321777b58a28dc (diff)
parentfbd7ed6ff73eca76aa6e0691228d26098ad9c19e (diff)
Merged in ibab/eigen (pull request PR-189)
Add scan op to Tensor module
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorBase.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorBase.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
index 07dcfa556..1eaa8d4fc 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
@@ -453,6 +453,21 @@ class TensorBase<Derived, ReadOnlyAccessors>
return TensorFFTOp<const FFT, const Derived, FFTDataType, FFTDirection>(derived(), fft);
}
+ // Scan.
+ typedef TensorScanOp<internal::SumReducer<CoeffReturnType>, const Derived> TensorScanSumOp;
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
+ const TensorScanSumOp
+ cumsum(const Index& axis) const {
+ return TensorScanSumOp(derived(), axis);
+ }
+
+ typedef TensorScanOp<internal::ProdReducer<CoeffReturnType>, const Derived> TensorScanProdOp;
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
+ const TensorScanProdOp
+ cumprod(const Index& axis) const {
+ return TensorScanProdOp(derived(), axis);
+ }
+
// Reductions.
template <typename Dims> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const TensorReductionOp<internal::SumReducer<CoeffReturnType>, const Dims, const Derived>