aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-30 18:36:36 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-30 18:36:36 -0700
commit791e5cfb6990220b2cfdb7b6f793298a5153561b (patch)
tree72c6689f67a2ada5efe44b8e9f5cdeb54f6fd3a9 /unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h
parent4f1a7e51c17586487c986a456e39af40b41bf4b4 (diff)
Added NumTraits for type2index.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h17
1 files changed, 17 insertions, 0 deletions
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<DenseIndex n> struct NumTraits<type2index<n> >
+{
+ 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 <typename T>
EIGEN_DEVICE_FUNC void update_value(T& val, DenseIndex new_val) {