661{
662 using std::abs;
663 using std::sqrt;
664 bool finite = true;
665 bool nonzero = false;
666 bool safe = true;
667 int top = 0;
668 for (Eigen::Index j = 0; j < matrix.cols(); ++j) {
669 for (Eigen::Index i = 0; i < matrix.rows(); ++i) {
670 const Work value = matrix(i, j);
672 finite = false;
673 continue;
674 }
675 if (value == Work(0)) continue;
678 top = nonzero ? std::max(top, exponent) : exponent;
679 nonzero = true;
680 }
681 }
682 if (!finite || !nonzero || safe)
683 return ScaledNorm<Work>{Work(matrix.norm()), 0, norm_ops};
684
685 const Work dropped_below(std::ldexp(1.0,
kDroppedExp));
686 Work sum(0);
687 for (Eigen::Index j = 0; j < matrix.cols(); ++j) {
688 for (Eigen::Index i = 0; i < matrix.rows(); ++i) {
689 const Work value = matrix(i, j);
690 if (value == Work(0)) continue;
691 bool exact = true;
693 if (
y < dropped_below)
continue;
695 }
696 }
697 sum += Work(std::ldexp(static_cast<double>(matrix.size()), -917));
699}
constexpr int kDroppedExp
long double scaleByPowerOfTwo(long double value, int shift, bool &exact)
int leadingExponent(long double value)
DoubleDouble sqrt(DoubleDouble a)
DoubleDouble abs(DoubleDouble a)
bool workingFinite(Work value)