Skip to content

Commit 9a2a386

Browse files
chore: apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 435aecb commit 9a2a386

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

docs/src/basics/sparsity_detection.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@ Notation wise we are trying to solve for `x` such that `nlfunc(x) = 0`.
99
## Big Table for Determining Sparsity Detection and Coloring Algorithms
1010

1111
| `f.sparsity` | `f.jac_prototype` | `f.colorvec` | Sparsity Detection | Coloring Algorithm |
12-
| :------------------------- | :---------------- | :----------- | :----------------------------------------------- | :---------------------------------------- |
13-
||| `Any` | `NoSparsityDetector()` | `NoColoringAlgorithm()` |
14-
|| Not Structured | `Any` | `NoSparsityDetector()` | `NoColoringAlgorithm()` |
15-
|| Structured || `KnownJacobianSparsityDetector(f.jac_prototype)` | `GreedyColoringAlgorithm(LargestFirst())` |
16-
|| Structured || `KnownJacobianSparsityDetector(f.jac_prototype)` | `GreedyColoringAlgorithm(LargestFirst())` |
12+
|:-------------------------- |:----------------- |:------------ |:------------------------------------------------ |:----------------------------------------- |
13+
| | | `Any` | `NoSparsityDetector()` | `NoColoringAlgorithm()` |
14+
| | Not Structured | `Any` | `NoSparsityDetector()` | `NoColoringAlgorithm()` |
15+
| | Structured | | `KnownJacobianSparsityDetector(f.jac_prototype)` | `GreedyColoringAlgorithm(LargestFirst())` |
16+
| | Structured | | `KnownJacobianSparsityDetector(f.jac_prototype)` | `GreedyColoringAlgorithm(LargestFirst())` |
1717
| - | - | - | - | - |
18-
| `AbstractMatrix` ||| `KnownJacobianSparsityDetector(f.sparsity)` | `ConstantColoringAlgorithm(f.colorvec)` |
19-
| `AbstractMatrix` ||| `KnownJacobianSparsityDetector(f.sparsity)` | `GreedyColoringAlgorithm(LargestFirst())` |
20-
| `AbstractMatrix` | Not Structured || `KnownJacobianSparsityDetector(f.sparsity)` | `ConstantColoringAlgorithm(f.colorvec)` |
21-
| `AbstractMatrix` | Not Structured || `KnownJacobianSparsityDetector(f.sparsity)` | `GreedyColoringAlgorithm(LargestFirst())` |
22-
| `AbstractMatrix` | Structured | `Any` | 🔴 | 🔴 |
18+
| `AbstractMatrix` | | | `KnownJacobianSparsityDetector(f.sparsity)` | `ConstantColoringAlgorithm(f.colorvec)` |
19+
| `AbstractMatrix` | | | `KnownJacobianSparsityDetector(f.sparsity)` | `GreedyColoringAlgorithm(LargestFirst())` |
20+
| `AbstractMatrix` | Not Structured | | `KnownJacobianSparsityDetector(f.sparsity)` | `ConstantColoringAlgorithm(f.colorvec)` |
21+
| `AbstractMatrix` | Not Structured | | `KnownJacobianSparsityDetector(f.sparsity)` | `GreedyColoringAlgorithm(LargestFirst())` |
22+
| `AbstractMatrix` | Structured | `Any` | 🔴 | 🔴 |
2323
| - | - | - | - | - |
24-
| `AbstractSparsityDetector` || `Any` | `f.sparsity` | `GreedyColoringAlgorithm(LargestFirst())` |
25-
| `AbstractSparsityDetector` | Not Structured || `f.sparsity` | `ConstantColoringAlgorithm(f.colorvec)` |
26-
| `AbstractSparsityDetector` | Not Structured || `f.sparsity` | `GreedyColoringAlgorithm(LargestFirst())` |
27-
| `AbstractSparsityDetector` | Structured || `KnownJacobianSparsityDetector(f.jac_prototype)` | `ConstantColoringAlgorithm(f.colorvec)` |
28-
| `AbstractSparsityDetector` | Structured || `KnownJacobianSparsityDetector(f.jac_prototype)` | `GreedyColoringAlgorithm(LargestFirst())` |
29-
30-
1. `Structured` means either a `AbstractSparseMatrix` or `ArrayInterface.isstructured(x)` is true.
31-
2. ❌ means not provided (default)
32-
3. ✅ means provided
33-
4. 🔴 means an error will be thrown
34-
5. Providing a colorvec without specifying either sparsity or jac_prototype with a sparse or structured matrix will cause us to ignore the colorvec.
35-
6. The function calls demonstrated above are simply pseudo-code to show the general idea.
24+
| `AbstractSparsityDetector` | | `Any` | `f.sparsity` | `GreedyColoringAlgorithm(LargestFirst())` |
25+
| `AbstractSparsityDetector` | Not Structured | | `f.sparsity` | `ConstantColoringAlgorithm(f.colorvec)` |
26+
| `AbstractSparsityDetector` | Not Structured | | `f.sparsity` | `GreedyColoringAlgorithm(LargestFirst())` |
27+
| `AbstractSparsityDetector` | Structured | | `KnownJacobianSparsityDetector(f.jac_prototype)` | `ConstantColoringAlgorithm(f.colorvec)` |
28+
| `AbstractSparsityDetector` | Structured | | `KnownJacobianSparsityDetector(f.jac_prototype)` | `GreedyColoringAlgorithm(LargestFirst())` |
29+
30+
1. `Structured` means either a `AbstractSparseMatrix` or `ArrayInterface.isstructured(x)` is true.
31+
2. ❌ means not provided (default)
32+
3. ✅ means provided
33+
4. 🔴 means an error will be thrown
34+
5. Providing a colorvec without specifying either sparsity or jac_prototype with a sparse or structured matrix will cause us to ignore the colorvec.
35+
6. The function calls demonstrated above are simply pseudo-code to show the general idea.
3636

3737
## Case I: Sparse Jacobian Prototype is Provided
3838

@@ -55,7 +55,7 @@ prob = NonlinearProblem(
5555
If the `colorvec` is not provided, then it is computed on demand.
5656

5757
!!! note
58-
58+
5959
One thing to be careful about in this case is that `colorvec` is dependent on the
6060
autodiff backend used. `ADTypes.mode(ad) isa ADTypes.ForwardMode` will assume that the
6161
colorvec is the column colorvec, otherwise we will assume that the colorvec is the
@@ -80,7 +80,7 @@ for more information on sparsity detection algorithms.
8080
## Case III: Sparse AD Type is being Used
8181

8282
!!! warning
83-
83+
8484
This is now deprecated. Please use the previous two cases instead.
8585

8686
If you constructed a Nonlinear Solver with a sparse AD type, for example

0 commit comments

Comments
 (0)