mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-09 07:00:27 +08:00
use modern ei_first_aligned function, dont try compiling coeffRef() on rvalue expressions.
This commit is contained in:
parent
5deda97413
commit
eda2795f51
@ -62,13 +62,9 @@ MatrixBase<Derived>::stableNorm() const
|
||||
Alignment = (int(Flags)&DirectAccessBit) || (int(Flags)&AlignedBit) ? 1 : 0
|
||||
};
|
||||
int n = size();
|
||||
int bi=0;
|
||||
if ((int(Flags)&DirectAccessBit) && !(int(Flags)&AlignedBit))
|
||||
{
|
||||
bi = ei_first_aligned(&const_cast_derived().coeffRef(0), n);
|
||||
if (bi>0)
|
||||
ei_stable_norm_kernel(this->head(bi), ssq, scale, invScale);
|
||||
}
|
||||
int bi = ei_first_aligned(derived());
|
||||
if (bi>0)
|
||||
ei_stable_norm_kernel(this->head(bi), ssq, scale, invScale);
|
||||
for (; bi<n; bi+=blockSize)
|
||||
ei_stable_norm_kernel(this->segment(bi,std::min(blockSize, n - bi)).template forceAlignedAccessIf<Alignment>(), ssq, scale, invScale);
|
||||
return scale * ei_sqrt(ssq);
|
||||
|
Loading…
Reference in New Issue
Block a user