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 VectorType,
typename RealScalar>
57 const Index blockSize = 4096;
61 const VectorTypeCopy
copy(vec);
76 for (; bi<
n; bi+=blockSize)
80 template<
typename VectorType>
90 return abs(vec.coeff(0));
94 RealScalar invScale(1);
99 return scale *
sqrt(ssq);
102 template<
typename MatrixType>
110 RealScalar invScale(1);
113 for(
Index j=0;
j<mat.outerSize(); ++
j)
115 return scale *
sqrt(ssq);
118 template<
typename Derived>
135 static const int ibeta = std::numeric_limits<RealScalar>::radix;
144 static const RealScalar eps =
RealScalar(
pow(
double(ibeta), 1-it));
147 const Derived& vec(_vec.
derived());
154 for(
Index j=0;
j<vec.outerSize(); ++
j)
156 for(
typename Derived::InnerIterator
iter(vec,
j);
iter; ++
iter)
184 amed =
sqrt(asml) / s1m;
187 return sqrt(asml)/s1m;
193 if(asml <= abig*relerr)
211 template<
typename Derived>
227 template<
typename Derived>
239 template<
typename Derived>
251 #endif // EIGEN_STABLENORM_H
RealScalar blueNorm() const
const unsigned int DirectAccessBit
Namespace containing all symbols from the Eigen library.
void stable_norm_kernel(const ExpressionType &bl, Scalar &ssq, Scalar &scale, Scalar &invScale)
iterator iter(handle obj)
VectorType::RealScalar stable_norm_impl(const VectorType &vec, typename enable_if< VectorType::IsVectorAtCompileTime >::type *=0)
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)
RealScalar stableNorm() const
static Index first_default_aligned(const DenseBase< Derived > &m)
NumTraits< typename traits< Derived >::Scalar >::Real blueNorm_impl(const EigenBase< Derived > &_vec)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real >::type abs(const T &x)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
NumTraits< Scalar >::Real RealScalar
const VectorBlock< const Derived > ConstSegmentReturnType
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
EIGEN_CONSTEXPR Index size(const T &x)
mp::number< mp::cpp_dec_float< 100 >, mp::et_on > Real
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() 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
Jet< T, N > sqrt(const Jet< T, N > &f)
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)
Generic expression where a coefficient-wise unary operator is applied to an expression.
EIGEN_DEVICE_FUNC bool abs2(bool x)
EIGEN_DEVICE_FUNC Derived & derived()
void stable_norm_impl_inner_step(const VectorType &vec, RealScalar &ssq, RealScalar &scale, RealScalar &invScale)
RealScalar hypotNorm() const