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
Fix star decompression into SparseMatrixCSC triangle (#90)
* Fix star decompression into `SparseMatrixCSC` triangle
* Test with `triu`
* Fix
* Check that if I remove l tests fail
* Document
* Add assertion
* Precise error
* Test throws
* Revert to assert
Copy file name to clipboardExpand all lines: src/decompression.jl
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -130,13 +130,14 @@ end
130
130
Decompress `B` in-place into `A`, given a coloring `result` of the sparsity pattern of `A`.
131
131
The out-of-place alternative is [`decompress`](@ref).
132
132
133
+
!!! note
134
+
In-place decompression is faster when `A isa SparseMatrixCSC`.
135
+
133
136
Compression means summing either the columns or the rows of `A` which share the same color.
134
137
It is done by calling [`compress`](@ref).
135
138
136
139
For `:symmetric` coloring results (and for those only), an optional positional argument `uplo in (:U, :L, :F)` can be passed to specify which part of the matrix `A` should be updated: the Upper triangle, the Lower triangle, or the Full matrix.
137
-
138
-
!!! note
139
-
In-place decompression is faster when `A isa SparseMatrixCSC`.
140
+
When `A isa SparseMatrixCSC`, using the `uplo` argument requires a target matrix which only stores the relevant triangle(s).
140
141
141
142
# Example
142
143
@@ -197,11 +198,12 @@ Decompress the vector `b` corresponding to color `c` in-place into `A`, given a
197
198
- 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`).
198
199
- If `result` comes from a `:symmetric` structure with `:column` partition, this will update the coefficients of `A` whose value is deduced from color `c`.
199
200
200
-
For `:symmetric` coloring results (and for those only), an optional positional argument `uplo in (:U, :L, :F)` can be passed to specify which part of the matrix `A` should be updated: the Upper triangle, the Lower triangle, or the Full matrix.
201
-
202
201
!!! warning
203
202
This function will only update some coefficients of `A`, without resetting the rest to zero.
204
203
204
+
For `:symmetric` coloring results (and for those only), an optional positional argument `uplo in (:U, :L, :F)` can be passed to specify which part of the matrix `A` should be updated: the Upper triangle, the Lower triangle, or the Full matrix.
205
+
When `A isa SparseMatrixCSC`, using the `uplo` argument requires a target matrix which only stores the relevant triangle(s).
206
+
205
207
# Example
206
208
207
209
```jldoctest
@@ -448,16 +450,19 @@ function decompress!(
448
450
) where {R<:Real}
449
451
@compat (; S, compressed_indices) = result
450
452
uplo ==:F&&check_same_pattern(A, S)
451
-
rvA=rowvals(A)
453
+
rvS=rowvals(S)
452
454
nzA =nonzeros(A)
455
+
l =0# assume A has the same pattern as the triangle
0 commit comments