Skip to content

Commit 3d67e1a

Browse files
committed
Define decompress_csc
1 parent a4ed265 commit 3d67e1a

1 file changed

Lines changed: 34 additions & 6 deletions

File tree

src/decompression.jl

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,23 @@ function decompress!(
585585
return A
586586
end
587587

588-
function decompress!(
589-
A::AbstractSparseMatrixCSC{R},
588+
"""
589+
function decompress_csc!(
590+
nzA::AbstractVector{R},
591+
A_colptr::AbstractVector,
592+
B::AbstractMatrix{R},
593+
result::TreeSetColoringResult,
594+
uplo::Symbol=:F,
595+
) where {R<:Real}
596+
597+
Decompress the values of `B` into the vector of nonzero entries `nzA` of a
598+
sparse matrix with column pointers `colptr`. This function assumes that the
599+
row indices are sorted in increasing order and are the same as those of the
600+
sparse matrix given to the `coloring` function that returned `result`.
601+
"""
602+
function decompress_csc!(
603+
nzA::AbstractVector{R},
604+
A_colptr::AbstractVector{<:Integer},
590605
B::AbstractMatrix{R},
591606
result::TreeSetColoringResult,
592607
uplo::Symbol=:F,
@@ -603,10 +618,6 @@ function decompress!(
603618
upper_triangle_offsets,
604619
buffer,
605620
) = result
606-
(; S) = ag
607-
A_colptr = A.colptr
608-
nzA = nonzeros(A)
609-
check_compatible_pattern(A, ag, uplo)
610621

611622
if eltype(buffer) == R
612623
buffer_right_type = buffer
@@ -696,6 +707,23 @@ function decompress!(
696707
#! format: on
697708
end
698709
end
710+
return
711+
end
712+
713+
function decompress!(
714+
A::AbstractSparseMatrixCSC{R},
715+
B::AbstractMatrix{R},
716+
result::TreeSetColoringResult,
717+
uplo::Symbol=:F,
718+
) where {R<:Real}
719+
check_compatible_pattern(A, result.ag, uplo)
720+
decompress_csc!(
721+
A.colptr,
722+
nonzeros(A),
723+
B,
724+
result,
725+
uplo,
726+
)
699727
return A
700728
end
701729

0 commit comments

Comments
 (0)