@@ -9,30 +9,30 @@ Notation wise we are trying to solve for `x` such that `nlfunc(x) = 0`.
9
9
## Big Table for Determining Sparsity Detection and Coloring Algorithms
10
10
11
11
| ` 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()) ` |
17
17
| - | - | - | - | - |
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 ` | 🔴 | 🔴 |
23
23
| - | - | - | - | - |
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.
36
36
37
37
## Case I: Sparse Jacobian Prototype is Provided
38
38
@@ -55,7 +55,7 @@ prob = NonlinearProblem(
55
55
If the ` colorvec ` is not provided, then it is computed on demand.
56
56
57
57
!!! note
58
-
58
+
59
59
One thing to be careful about in this case is that ` colorvec ` is dependent on the
60
60
autodiff backend used. ` ADTypes.mode(ad) isa ADTypes.ForwardMode ` will assume that the
61
61
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.
80
80
## Case III: Sparse AD Type is being Used
81
81
82
82
!!! warning
83
-
83
+
84
84
This is now deprecated. Please use the previous two cases instead.
85
85
86
86
If you constructed a Nonlinear Solver with a sparse AD type, for example
0 commit comments