Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ SparseMatrixColorings.TreeSetColoringResult
SparseMatrixColorings.LinearSystemColoringResult
SparseMatrixColorings.BicoloringResult
SparseMatrixColorings.remap_colors
SparseMatrixColorings.decompress_csc!
```

## Testing
Expand Down
34 changes: 28 additions & 6 deletions src/decompression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,23 @@ function decompress!(
return A
end

function decompress!(
A::SparseMatrixCSC{R},
"""
decompress_csc!(
nzA::AbstractVector{R},
A_colptr::AbstractVector,
B::AbstractMatrix{R},
result::TreeSetColoringResult,
uplo::Symbol=:F,
) where {R<:Real}

Decompress the values of `B` into the vector of nonzero entries `nzA` of a
sparse matrix with column pointers `colptr`. This function assumes that the
row indices are sorted in increasing order and are the same as those of the
sparse matrix given to the `coloring` function that returned `result`.
"""
function decompress_csc!(
nzA::AbstractVector{R},
A_colptr::AbstractVector{<:Integer},
B::AbstractMatrix{R},
result::TreeSetColoringResult,
uplo::Symbol=:F,
Expand All @@ -603,10 +618,6 @@ function decompress!(
upper_triangle_offsets,
buffer,
) = result
(; S) = ag
A_colptr = A.colptr
nzA = nonzeros(A)
check_compatible_pattern(A, ag, uplo)

if eltype(buffer) == R
buffer_right_type = buffer
Expand Down Expand Up @@ -696,6 +707,17 @@ function decompress!(
#! format: on
end
end
return nothing
end

function decompress!(
A::SparseMatrixCSC{R},
B::AbstractMatrix{R},
result::TreeSetColoringResult,
uplo::Symbol=:F,
) where {R<:Real}
check_compatible_pattern(A, result.ag, uplo)
decompress_csc!(nonzeros(A), A.colptr, B, result, uplo)
return A
end

Expand Down
Loading