From 791e5cfb6990220b2cfdb7b6f793298a5153561b Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Wed, 30 Mar 2016 18:36:36 -0700 Subject: Added NumTraits for type2index. --- unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h index 01c31c13e..985594bc8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h @@ -45,6 +45,23 @@ struct type2index { } }; +template struct NumTraits > +{ + typedef DenseIndex Real; + enum { + IsComplex = 0, + RequireInitialization = false, + ReadCost = 1, + AddCost = 1, + MulCost = 1 + }; + + EIGEN_DEVICE_FUNC static inline Real epsilon() { return 0; } + EIGEN_DEVICE_FUNC static inline Real dummy_precision() { return 0; } + EIGEN_DEVICE_FUNC static inline Real highest() { return n; } + EIGEN_DEVICE_FUNC static inline Real lowest() { return n; } +}; + namespace internal { template EIGEN_DEVICE_FUNC void update_value(T& val, DenseIndex new_val) { -- cgit v1.2.3