Home | History | Annotate | Download | only in SVD

Lines Matching full:col0

177   void computeSingVals(const ArrayRef& col0, const ArrayRef& diag, const IndicesRef& perm, VectorType& singVals, ArrayRef shifts, ArrayRef mus);
178 void perturbCol0(const ArrayRef& col0, const ArrayRef& diag, const IndicesRef& perm, const VectorType& singVals, const ArrayRef& shifts, const ArrayRef& mus, ArrayRef zhat);
186 static RealScalar secularEq(RealScalar x, const ArrayRef& col0, const ArrayRef& diag, const IndicesRef &perm, const ArrayRef& diagShifted, RealScalar shift);
575 ArrayRef col0 = m_computed.col(firstCol).segment(firstCol, n);
586 if (col0.hasNaN() || diag.hasNaN())
597 if(abs(col0(k))>considerZero)
607 std::cout << " z: " << col0.transpose() << "\n";
612 computeSingVals(col0, diag, perm, singVals, shifts, mus);
622 while(actual_n>1 && abs(col0(actual_n-1))<considerZero) --actual_n;
638 perturbCol0(col0, diag, perm, singVals, shifts, mus, zhat);
692 typename BDCSVD<MatrixType>::RealScalar BDCSVD<MatrixType>::secularEq(RealScalar mu, const ArrayRef& col0, const ArrayRef& diag, const IndicesRef &perm, const ArrayRef& diagShifted, RealScalar shift)
699 res += numext::abs2(col0(j)) / ((diagShifted(j) - mu) * (diag(j) + shift + mu));
706 void BDCSVD<MatrixType>::computeSingVals(const ArrayRef& col0, const ArrayRef& diag, const IndicesRef &perm,
712 Index n = col0.size();
714 while(actual_n>1 && col0(actual_n-1)==Literal(0)) --actual_n;
718 if (col0(k) == Literal(0) || actual_n==1)
720 // if col0(k) == 0, then entry is deflated, so singular value is on diagonal
722 singVals(k) = k==0 ? col0(0) : diag(k);
724 shifts(k) = k==0 ? col0(0) : diag(k);
730 RealScalar right; // was: = (k != actual_n-1) ? diag(k+1) : (diag(actual_n-1) + col0.matrix().norm());
732 right = (diag(actual_n-1) + col0.matrix().norm());
737 while(col0(l)==Literal(0)) { ++l; eigen_internal_assert(l<actual_n); }
743 RealScalar fMid = secularEq(mid, col0, diag, perm, diag, Literal(0));
746 std::cout << "fMid = " << fMid << " " << secularEq(mid-left, col0, diag, perm, diag-left, left) << " " << secularEq(mid-right, col0, diag, perm, diag-right, right) << "\n";
747 std::cout << " = " << secularEq(0.1*(left+right), col0, diag, perm, diag, 0)
748 << " " << secularEq(0.2*(left+right), col0, diag, perm, diag, 0)
749 << " " << secularEq(0.3*(left+right), col0, diag, perm, diag, 0)
750 << " " << secularEq(0.4*(left+right), col0, diag, perm, diag, 0)
751 << " " << secularEq(0.49*(left+right), col0, diag, perm, diag, 0)
752 << " " << secularEq(0.5*(left+right), col0, diag, perm, diag, 0)
753 << " " << secularEq(0.51*(left+right), col0, diag, perm, diag, 0)
754 << " " << secularEq(0.6*(left+right), col0, diag, perm, diag, 0)
755 << " " << secularEq(0.7*(left+right), col0, diag, perm, diag, 0)
756 << " " << secularEq(0.8*(left+right), col0, diag, perm, diag, 0)
757 << " " << secularEq(0.9*(left+right), col0, diag, perm, diag, 0) << "\n";
779 RealScalar fPrev = secularEq(muPrev, col0, diag, perm, diagShifted, shift);
780 RealScalar fCur = secularEq(muCur, col0, diag, perm, diagShifted, shift);
799 RealScalar fZero = secularEq(muZero, col0, diag, perm, diagShifted, shift);
832 RealScalar fLeft = secularEq(leftShifted, col0, diag, perm, diagShifted, shift);
835 RealScalar fRight = secularEq(rightShifted, col0, diag, perm, diagShifted, shift);
850 fMid = secularEq(midShifted, col0, diag, perm, diagShifted, shift);
878 // zhat is perturbation of col0 for which singular vectors can be computed stably (see Section 3.1)
881 (const ArrayRef& col0, const ArrayRef& diag, const IndicesRef &perm, const VectorType& singVals,
885 Index n = col0.size();
896 if (col0(k) == Literal(0)) // deflated
922 zhat(k) = col0(k) > Literal(0) ? tmp : -tmp;
1050 Block<MatrixXr,Dynamic,1> col0(m_computed, firstCol+shift, firstCol+shift, length, 1);
1057 RealScalar epsilon_coarse = Literal(8) * NumTraits<RealScalar>::epsilon() * numext::maxi<RealScalar>(col0.cwiseAbs().maxCoeff(), maxDiag);
1080 if (abs(col0(i)) < epsilon_strict)
1083 std::cout << "deflation 4.2, set z(" << i << ") to zero because " << abs(col0(i)) << " < " << epsilon_strict << " (diag(" << i << ")=" << diag(i) << ")\n";
1085 col0(i) = Literal(0);
1093 std::cout << "deflation 4.3, cancel z(" << i << ")=" << col0(i) << " because diag(" << i << ")=" << diag(i) << " < " << epsilon_coarse << "\n";
1108 // If we have a total deflation, then we have to consider col0(0)==diag(0) as a singular value during sorting
1109 bool total_deflation = (col0.tail(length-1).array()<considerZero).all();
1167 if(i!=0 && J!=0) swap(col0(i), col0(J));
1184 std::cout << " : " << col0.transpose() << "\n\n";
1190 while(i>0 && (abs(diag(i))<considerZero || abs(col0(i))<considerZero)) --i;