mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 12:46:00 +08:00
fix #12, but the fix is not optimal, householder transformations need to be rethought in the complex case, see:
http://download.tuxfamily.org/eigen/complex-householder.pdf
This commit is contained in:
parent
a1a26f45d3
commit
c3bab0edb7
@ -201,6 +201,7 @@ void Tridiagonalization<MatrixType>::_compute(MatrixType& matA, CoeffVectorType&
|
|||||||
// squared norm of the vector v skipping the first element
|
// squared norm of the vector v skipping the first element
|
||||||
RealScalar v1norm2 = matA.col(i).end(n-(i+2)).squaredNorm();
|
RealScalar v1norm2 = matA.col(i).end(n-(i+2)).squaredNorm();
|
||||||
|
|
||||||
|
// FIXME comparing against 1
|
||||||
if (ei_isMuchSmallerThan(v1norm2,static_cast<Scalar>(1)))
|
if (ei_isMuchSmallerThan(v1norm2,static_cast<Scalar>(1)))
|
||||||
{
|
{
|
||||||
hCoeffs.coeffRef(i) = 0.;
|
hCoeffs.coeffRef(i) = 0.;
|
||||||
@ -331,7 +332,8 @@ void Tridiagonalization<MatrixType>::_compute(MatrixType& matA, CoeffVectorType&
|
|||||||
if (ei_real(v0)>=0.)
|
if (ei_real(v0)>=0.)
|
||||||
beta = -beta;
|
beta = -beta;
|
||||||
matA.col(i).coeffRef(i+1) = beta;
|
matA.col(i).coeffRef(i+1) = beta;
|
||||||
hCoeffs.coeffRef(i) = (beta - v0) / beta;
|
if(ei_isMuchSmallerThan(beta, Scalar(1))) hCoeffs.coeffRef(i) = Scalar(0);
|
||||||
|
else hCoeffs.coeffRef(i) = (beta - v0) / beta;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user