diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-04-15 22:34:11 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-04-15 22:34:11 +0200 |
commit | 2a7115daca3e36e1486c4e22f05ad11f8a055030 (patch) | |
tree | 67d757e80834e25d7d20fa028b75b7c65e9d92b0 /Eigen | |
parent | 40c9923a8aa84bb273e003a92e7cbd644bdecc4c (diff) |
bug #1203: by-pass large stack-allocation in stableNorm if EIGEN_STACK_ALLOCATION_LIMIT is too small
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/StableNorm.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Eigen/src/Core/StableNorm.h b/Eigen/src/Core/StableNorm.h index 7fe39808b..d2fe1e199 100644 --- a/Eigen/src/Core/StableNorm.h +++ b/Eigen/src/Core/StableNorm.h @@ -168,11 +168,12 @@ MatrixBase<Derived>::stableNorm() const DerivedCopy copy(derived()); enum { - CanAlign = (int(Flags)&DirectAccessBit) || (int(internal::evaluator<DerivedCopyClean>::Alignment)>0) // FIXME + CanAlign = ( (int(DerivedCopyClean::Flags)&DirectAccessBit) + || (int(internal::evaluator<DerivedCopyClean>::Alignment)>0) // FIXME Alignment)>0 might not be enough + ) && (blockSize*sizeof(Scalar)*2<EIGEN_STACK_ALLOCATION_LIMIT) // ifwe cannot allocate on the stack, then let's not bother about this optimization }; typedef typename internal::conditional<CanAlign, Ref<const Matrix<Scalar,Dynamic,1,0,blockSize,1>, internal::evaluator<DerivedCopyClean>::Alignment>, - typename DerivedCopyClean - ::ConstSegmentReturnType>::type SegmentWrapper; + typename DerivedCopyClean::ConstSegmentReturnType>::type SegmentWrapper; Index n = size(); if(n==1) |