mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-30 15:54:13 +08:00
bug #1203: by-pass large stack-allocation in stableNorm if EIGEN_STACK_ALLOCATION_LIMIT is too small
This commit is contained in:
parent
40c9923a8a
commit
2a7115daca
@ -168,11 +168,12 @@ MatrixBase<Derived>::stableNorm() const
|
|||||||
DerivedCopy copy(derived());
|
DerivedCopy copy(derived());
|
||||||
|
|
||||||
enum {
|
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>,
|
typedef typename internal::conditional<CanAlign, Ref<const Matrix<Scalar,Dynamic,1,0,blockSize,1>, internal::evaluator<DerivedCopyClean>::Alignment>,
|
||||||
typename DerivedCopyClean
|
typename DerivedCopyClean::ConstSegmentReturnType>::type SegmentWrapper;
|
||||||
::ConstSegmentReturnType>::type SegmentWrapper;
|
|
||||||
Index n = size();
|
Index n = size();
|
||||||
|
|
||||||
if(n==1)
|
if(n==1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user