enable some tests that have been commented out

This commit is contained in:
Gael Guennebaud
2011-02-18 18:08:58 +01:00
parent 434817164e
commit 3c00e3da03
2 changed files with 35 additions and 42 deletions

View File

@@ -44,7 +44,6 @@ template<typename Scalar> void sparse_lu(int rows, int cols)
std::vector<Vector2i> zeroCoords;
std::vector<Vector2i> nonzeroCoords;
static int count = 0;
SparseMatrix<Scalar> m2(rows, cols);
DenseMatrix refMat2(rows, cols);
@@ -61,6 +60,21 @@ template<typename Scalar> void sparse_lu(int rows, int cols)
x.setZero();
// // SparseLU<SparseMatrix<Scalar> > (m2).solve(b,&x);
// // VERIFY(refX.isApprox(x,test_precision<Scalar>()) && "LU: default");
#ifdef EIGEN_UMFPACK_SUPPORT
{
// check solve
x.setZero();
SparseLU<SparseMatrix<Scalar>,UmfPack> lu(m2);
VERIFY(lu.succeeded() && "umfpack LU decomposition failed");
VERIFY(lu.solve(b,&x) && "umfpack LU solving failed");
VERIFY(refX.isApprox(x,test_precision<Scalar>()) && "LU: umfpack");
VERIFY_IS_APPROX(refDet,lu.determinant());
// TODO check the extracted data
//std::cerr << slu.matrixL() << "\n";
}
#endif
#ifdef EIGEN_SUPERLU_SUPPORT
{
x.setZero();
@@ -85,24 +99,7 @@ template<typename Scalar> void sparse_lu(int rows, int cols)
}
}
#endif
#ifdef EIGEN_UMFPACK_SUPPORT
// {
// // check solve
// x.setZero();
// SparseLU<SparseMatrix<Scalar>,UmfPack> slu(m2);
// if (slu.succeeded()) {
// if (slu.solve(b,&x)) {
// if (count==0) {
// VERIFY(refX.isApprox(x,test_precision<Scalar>()) && "LU: umfpack"); // FIXME solve is not very stable for complex
// }
// }
// VERIFY_IS_APPROX(refDet,slu.determinant());
// // TODO check the extracted data
// //std::cerr << slu.matrixL() << "\n";
// }
// }
#endif
count++;
}
void test_sparse_lu()