* change the nesting order of adjoint_return_type to

1 - make it easier to catch conjugate expressions
 2 - make sure there is no unecessary copy (we had NestByValue<Derived> which seems to be very bad)
* update eigensolver wrt recent changes
This commit is contained in:
Gael Guennebaud
2009-07-07 15:56:13 +02:00
parent 79877a9917
commit ea23f36c78
5 changed files with 18 additions and 12 deletions

View File

@@ -259,11 +259,11 @@ compute(const MatrixType& matA, const MatrixType& matB, bool computeEigenvectors
// compute C = inv(L) A inv(L')
MatrixType matC = matA;
cholB.matrixL().solveTriangularInPlace(matC);
cholB.matrixL().solveInPlace(matC);
// FIXME since we currently do not support A * inv(L'), let's do (inv(L) A')' :
matC = matC.adjoint().eval();
cholB.matrixL().template marked<LowerTriangular>().solveTriangularInPlace(matC);
matC = matC.adjoint().eval();
matC.adjointInPlace();
cholB.matrixL().solveInPlace(matC);
matC.adjointInPlace();
// this version works too:
// matC = matC.transpose();
// cholB.matrixL().conjugate().template marked<LowerTriangular>().solveTriangularInPlace(matC);
@@ -277,7 +277,7 @@ compute(const MatrixType& matA, const MatrixType& matB, bool computeEigenvectors
if (computeEigenvectors)
{
// transform back the eigen vectors: evecs = inv(U) * evecs
cholB.matrixL().adjoint().template marked<UpperTriangular>().solveTriangularInPlace(m_eivec);
cholB.matrixU().solveInPlace(m_eivec);
for (int i=0; i<m_eivec.cols(); ++i)
m_eivec.col(i) = m_eivec.col(i).normalized();
}