New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
View | Details | Raw Unified | Return to bug 1014 | Differences between
and this patch

Collapse All | Expand All

(-)a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h (-2 / +5 lines)
Lines 601-608 Link Here
601
    VectorType& eivals = solver.m_eivalues;
601
    VectorType& eivals = solver.m_eivalues;
602
  
602
  
603
    // map the matrix coefficients to [-1:1] to avoid over- and underflow.
603
    // map the matrix coefficients to [-1:1] to avoid over- and underflow.
604
    Scalar scale = mat.cwiseAbs().maxCoeff();
604
    Scalar traceBy3 = mat.trace()/Scalar(3);
605
    MatrixType scaledMat = mat / scale;
605
    MatrixType scaledMat = mat - traceBy3*MatrixType::Identity();
606
    Scalar scale = scaledMat.cwiseAbs().maxCoeff();
607
    if(scale > 0) scaledMat /= scale;
606
608
607
    // compute the eigenvalues
609
    // compute the eigenvalues
608
    computeRoots(scaledMat,eivals);
610
    computeRoots(scaledMat,eivals);
Lines 710-715 Link Here
710
    }
712
    }
711
    // Rescale back to the original size.
713
    // Rescale back to the original size.
712
    eivals *= scale;
714
    eivals *= scale;
715
    eivals.array() += traceBy3;
713
    
716
    
714
    solver.m_info = Success;
717
    solver.m_info = Success;
715
    solver.m_isInitialized = true;
718
    solver.m_isInitialized = true;

Return to bug 1014