fix twisted selfadjoint to selfadjoint (conjugation issue)

This commit is contained in:
Gael Guennebaud 2011-01-27 14:39:01 +01:00
parent f5d0f115b4
commit 9ccd16609c

View File

@ -367,6 +367,7 @@ void permute_symm_to_symm(const MatrixType& mat, SparseMatrix<typename MatrixTyp
typedef SparseMatrix<Scalar,DestOrder,Index> Dest;
Dest& dest(_dest.derived());
typedef Matrix<Index,Dynamic,1> VectorI;
internal::conj_if<SrcUpLo!=DstUpLo> cj;
Index size = mat.rows();
VectorI count(size);
@ -404,7 +405,7 @@ void permute_symm_to_symm(const MatrixType& mat, SparseMatrix<typename MatrixTyp
Index ip = perm? perm[i] : i;
Index k = count[DstUpLo==Lower ? std::min(ip,jp) : std::max(ip,jp)]++;
dest._innerIndexPtr()[k] = DstUpLo==Lower ? std::max(ip,jp) : std::min(ip,jp);
dest._valuePtr()[k] = it.value();
dest._valuePtr()[k] = cj(it.value());
}
}
}