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
|
Alignment = (int(Flags)&DirectAccessBit) || (int(Flags)&AlignedBit) ? 1 : 0
|
||||||
};
|
};
|
||||||
int n = size();
|
int n = size();
|
||||||
int bi=0;
|
int bi = ei_first_aligned(derived());
|
||||||
if ((int(Flags)&DirectAccessBit) && !(int(Flags)&AlignedBit))
|
if (bi>0)
|
||||||
{
|
ei_stable_norm_kernel(this->head(bi), ssq, scale, invScale);
|
||||||
bi = ei_first_aligned(&const_cast_derived().coeffRef(0), n);
|
|
||||||
if (bi>0)
|
|
||||||
ei_stable_norm_kernel(this->head(bi), ssq, scale, invScale);
|
|
||||||
}
|
|
||||||
for (; bi<n; bi+=blockSize)
|
for (; bi<n; bi+=blockSize)
|
||||||
ei_stable_norm_kernel(this->segment(bi,std::min(blockSize, n - bi)).template forceAlignedAccessIf<Alignment>(), ssq, scale, invScale);
|
ei_stable_norm_kernel(this->segment(bi,std::min(blockSize, n - bi)).template forceAlignedAccessIf<Alignment>(), ssq, scale, invScale);
|
||||||
return scale * ei_sqrt(ssq);
|
return scale * ei_sqrt(ssq);
|
||||||
|
Loading…
Reference in New Issue
Block a user