diff --git a/Eigen/src/OrderingMethods/Amd.h b/Eigen/src/OrderingMethods/Amd.h index 63d996cb4..323255e0a 100644 --- a/Eigen/src/OrderingMethods/Amd.h +++ b/Eigen/src/OrderingMethods/Amd.h @@ -150,7 +150,7 @@ void minimum_degree_ordering(SparseMatrix& C, Perm } d = degree[i]; - if(d == 1) /* node i is empty */ + if(d == 1 && has_diag) /* node i is empty */ { elen[i] = -2; /* element i is dead */ nel++; diff --git a/test/sparselu.cpp b/test/sparselu.cpp index c725847d8..78615ff3b 100644 --- a/test/sparselu.cpp +++ b/test/sparselu.cpp @@ -41,9 +41,9 @@ template void test_sparselu_T() SparseLU, AMDOrdering > sparselu_amd; SparseLU, NaturalOrdering > sparselu_natural; - check_sparse_square_solving(sparselu_colamd); - check_sparse_square_solving(sparselu_amd, 300, 2000, !true); // FIXME AMD ordering fails for structurally deficient matrices! - check_sparse_square_solving(sparselu_natural, 300, 2000, true); + check_sparse_square_solving(sparselu_colamd, 300, 100000, true); + check_sparse_square_solving(sparselu_amd, 300, 10000, true); + check_sparse_square_solving(sparselu_natural, 300, 2000, true); check_sparse_square_abs_determinant(sparselu_colamd); check_sparse_square_abs_determinant(sparselu_amd);