Refactor suitesparse.h/cc

1. Generalize SuiteSparse::AnalyzeCholesky and
   SuiteSparse::BlockAnalyzeCholesky from just doing AMD to taking
   OrderingType as an argument and using that to determine whether
   AMD & Nested Dissection algorithms are used for computing the
   fill-reducing ordering or a natural ordering when computing
   the symbolic factorization.

2. Remove AnalyzeCholeskyWithNaturalOrdering.

3. Replace and generalize SuiteSparse::BlockAMDOrdering with
   SuiteSparse::BlockOrdering which also takes OrderingType as an
   argument. Same for SuiteSparse::ApproximateMinimumDegreeOrdering
   and SuiteSparse::NestedDissectionOrdering by
   SuiteSparse::Ordering.

4. Remove LinearSolver::Options::use_postordering and replace it
   with LinearSolver::Options::ordering_type.

5. Replace Preconditioner::Options::use_postordering and replace it
   with Preconditioner::Options::ordering_type.

6. Add NESDIS to OrderingType. With the above changes, the linear
   solvers can now use Nested Dissection once this information
   is piped through the nonlinear solver.

Change-Id: Ib8e93fbf34ae2981bf2ac54dcda9e25c7c213790
This commit is contained in:
Sameer Agarwal
2022-05-19 00:47:24 -07:00
parent 12263e2830
commit 41c5fb1e80
16 changed files with 312 additions and 208 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ void OrderingForSparseNormalCholeskyUsingSuiteSparse(
// If the user did not supply a useful ordering, then just use
// regular AMD.
if (parameter_block_ordering.NumGroups() <= 1) {
ss.ApproximateMinimumDegreeOrdering(block_jacobian_transpose, &ordering[0]);
ss.Ordering(block_jacobian_transpose, OrderingType::AMD, &ordering[0]);
} else {
vector<int> constraints;
for (auto* parameter_block : parameter_blocks) {