From 807330ef6b64d0462a08a4b627fe1abdfacfa07f Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:27:58 +0100 Subject: [PATCH] Add views --- src/decompression.jl | 4 ++-- src/interface.jl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/decompression.jl b/src/decompression.jl index 8fa66f4..6cba735 100644 --- a/src/decompression.jl +++ b/src/decompression.jl @@ -684,10 +684,10 @@ function _join_compressed!(result::BicoloringResult, Br::AbstractMatrix, Bc::Abs fill!(Br_and_Bc, zero(R)) for c in axes(Br_and_Bc, 2) if haskey(row_color_ind, c) # some rows were colored with symmetric color c - @views copyto!(Br_and_Bc[1:n, c], Br[row_color_ind[c], :]) + copyto!(view(Br_and_Bc, 1:n, c), view(Br, row_color_ind[c], :)) end if haskey(col_color_ind, c) # some columns were colored with symmetric c - @views copyto!(Br_and_Bc[(n + 1):(n + m), c], Bc[:, col_color_ind[c]]) + copyto!(view(Br_and_Bc, (n + 1):(n + m), c), view(Bc, :, col_color_ind[c])) end end return Br_and_Bc diff --git a/src/interface.jl b/src/interface.jl index 1b443ac..f2b601f 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -236,7 +236,7 @@ function coloring( A else transpose(A) - end + end # TODO: fuse with next step? A_and_Aᵀ = [ spzeros(T, n, n) SparseMatrixCSC(Aᵀ) SparseMatrixCSC(A) spzeros(T, m, m)