aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-05-27 12:58:43 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-05-27 12:58:43 -0700
commite2946d962d1e06a1070a391a6aa92d03a9162573 (patch)
tree5de813648552ea95619e96f2bab149c8232e855c /unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h
parente96d36d4cd12d72d27d646a5e8b57fb35ac4ee41 (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.h7
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;