You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return the indices `(k, c)` such that `A[i, j] = B[k, c]`, where `A` is the uncompressed symmetric matrix and `B` is the column-compressed matrix.
211
219
212
-
The first version corresponds to algorithm `DirectRecover1` in the paper, the second to `DirectRecover2`.
220
+
This function corresponds to algorithm `DirectRecover2` in the paper.
213
221
214
222
# References
215
223
216
-
> [_Efficient Computation of Sparse Hessians Using Coloring and Automatic Differentiation_](https://pubsonline.informs.org/doi/abs/10.1287/ijoc.1080.0286), Gebremedhin et al. (2009), Figures 2 and 3
224
+
> [_Efficient Computation of Sparse Hessians Using Coloring and Automatic Differentiation_](https://pubsonline.informs.org/doi/abs/10.1287/ijoc.1080.0286), Gebremedhin et al. (2009), Figure 3
functiondecompress(B::AbstractMatrix{R}, result::AbstractColoringResult) where {R<:Real}
119
-
S=get_matrix(result)
119
+
@compat (; S)= result
120
120
A =respectful_similar(S, R)
121
121
returndecompress!(A, B, result)
122
122
end
@@ -183,33 +183,84 @@ true
183
183
"""
184
184
function decompress! end
185
185
186
-
## NonSymmetricColoringResult
186
+
"""
187
+
decompress_single_color!(
188
+
A::AbstractMatrix, b::AbstractVector, c::Integer,
189
+
result::AbstractColoringResult,
190
+
)
191
+
192
+
Decompress the vector `b` corresponding to color `c` in-place into `A`, given a coloring `result` of the sparsity pattern of `A`.
193
+
194
+
- If `result` comes from a `:nonsymmetric` structure with `:column` partition, this will update the columns of `A` that share color `c` (whose sum makes up `b`).
195
+
- If `result` comes from a `:nonsymmetric` structure with `:row` partition, this will update the rows of `A` that share color `c` (whose sum makes up `b`).
196
+
- If `result` comes from a `:symmetric` structure with `:column` partition, this will update the coefficients of `A` whose value is deduced from color `c`.
197
+
198
+
!!! warning
199
+
This function will only update some coefficients of `A`, without resetting the rest to zero.
0 commit comments