10 #ifndef EIGEN_STABLENORM_H 11 #define EIGEN_STABLENORM_H 17 template<
typename ExpressionType,
typename Scalar>
20 Scalar maxCoeff = bl.cwiseAbs().maxCoeff();
29 scale =
Scalar(1)/invScale;
42 else if(maxCoeff!=maxCoeff)
50 ssq += (bl*invScale).squaredNorm();
53 template<
typename Derived>
61 const Derived& vec(_vec.
derived());
62 static bool initialized =
false;
63 static RealScalar
b1,
b2, s1m, s2m, rbig,
relerr;
66 int ibeta, it, iemin, iemax, iexp;
77 it = std::numeric_limits<RealScalar>::digits;
78 iemin = std::numeric_limits<RealScalar>::min_exponent;
79 iemax = std::numeric_limits<RealScalar>::max_exponent;
82 iexp = -((1-iemin)/2);
84 iexp = (iemax + 1 - it)/2;
89 iexp = - ((iemax+it)/2);
101 for(
typename Derived::InnerIterator it(vec, 0); it; ++it)
103 RealScalar ax =
abs(it.value());
128 amed =
sqrt(asml) / s1m;
131 return sqrt(asml)/s1m;
137 if(asml <= abig*relerr)
155 template<
typename Derived>
161 const Index blockSize = 4096;
168 const DerivedCopy
copy(derived());
181 return abs(this->coeff(0));
186 for (; bi<
n; bi+=blockSize)
188 return scale *
sqrt(ssq);
200 template<
typename Derived>
212 template<
typename Derived>
221 #endif // EIGEN_STABLENORM_H
const unsigned int DirectAccessBit
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Namespace containing all symbols from the Eigen library.
void stable_norm_kernel(const ExpressionType &bl, Scalar &ssq, Scalar &scale, Scalar &invScale)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
Derived::RealScalar relerr(const MatrixBase< Derived > &A, const MatrixBase< OtherDerived > &B)
static Index first_default_aligned(const DenseBase< Derived > &m)
NumTraits< typename traits< Derived >::Scalar >::Real blueNorm_impl(const EigenBase< Derived > &_vec)
RealScalar blueNorm() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
NumTraits< Scalar >::Real RealScalar
RealScalar stableNorm() const
const VectorBlock< const Derived > ConstSegmentReturnType
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const
mp::number< mp::cpp_dec_float< 100 >, mp::et_on > Real
NumTraits< Scalar >::Real RealScalar
#define EIGEN_MAX_STATIC_ALIGN_BYTES
RealScalar hypotNorm() const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics scale
#define EIGEN_STACK_ALLOCATION_LIMIT
int EIGEN_BLAS_FUNC() copy(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Jet< T, N > pow(const Jet< T, N > &f, double g)
EIGEN_DEVICE_FUNC Derived & derived()