diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-05-27 12:58:43 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-05-27 12:58:43 -0700 |
commit | e2946d962d1e06a1070a391a6aa92d03a9162573 (patch) | |
tree | 5de813648552ea95619e96f2bab149c8232e855c /unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h | |
parent | e96d36d4cd12d72d27d646a5e8b57fb35ac4ee41 (diff) |
Reimplement clamp as a static function.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h index caf994961..620666cc7 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h @@ -708,9 +708,6 @@ struct TensorEvaluator<const TensorStridingSlicingOp<StartIndices, StopIndices, EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : m_impl(op.expression(), device), m_device(device), m_strides(op.strides()) { - auto clamp = [](Index value, Index min, Index max){ - return numext::maxi(min,numext::mini(max,value)); - }; // Handle degenerate intervals by gracefully clamping and allowing m_dimensions to be zero DSizes<Index,NumDims> startIndicesClamped, stopIndicesClamped; for (int i = 0; i < internal::array_size<Dimensions>::value; ++i) { @@ -834,6 +831,10 @@ struct TensorEvaluator<const TensorStridingSlicingOp<StartIndices, StopIndices, return inputIndex; } + static EIGEN_STRONG_INLINE Index clamp(Index value, Index min, Index max) { + return numext::maxi(min, numext::mini(max,value)); + } + array<Index, NumDims> m_outputStrides; array<internal::TensorIntDivisor<Index>, NumDims> m_fastOutputStrides; array<Index, NumDims> m_inputStrides; |