diff options
author | Gael Guennebaud <g.gael@free.fr> | 2017-01-26 08:04:23 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2017-01-26 08:04:23 +0000 |
commit | 25a17035798698187fc410d1bffb603f98992b56 (patch) | |
tree | 7af99be43c7d4f8b53d28231b80938550b590028 /Eigen/src/Core/util/XprHelper.h | |
parent | 7d39c6d50a594f37a2f1e5cb9140917993b5e776 (diff) | |
parent | 98dfe0c13f717c0572c55527f077ed01c110972c (diff) |
Merged in ggael/eigen-flexidexing (pull request PR-294)
generalized operator() for indexed access and slicing
Diffstat (limited to 'Eigen/src/Core/util/XprHelper.h')
-rw-r--r-- | Eigen/src/Core/util/XprHelper.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index d5e565cb8..4b337f29f 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -109,6 +109,7 @@ template<typename T, int Value> class variable_if_dynamic EIGEN_EMPTY_STRUCT_CTOR(variable_if_dynamic) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T v) { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); } EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE T value() { return T(Value); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE operator T() const { return T(Value); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T) {} }; @@ -119,6 +120,7 @@ template<typename T> class variable_if_dynamic<T, Dynamic> public: EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit variable_if_dynamic(T value) : m_value(value) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value() const { return m_value; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE operator T() const { return m_value; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T value) { m_value = value; } }; |