Skip to content

Commit 3b87284

Browse files
Merge pull request #32 from gridap/adding_sym_sparse_matrix_copy
Adding sym sparse matrix copy
2 parents 94c2c06 + 7d79e87 commit 3b87284

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SparseMatricesCSR"
22
uuid = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1"
33
authors = ["Víctor Sande <[email protected]>", "Francesc Verdugo <[email protected]>"]
4-
version = "0.6.8"
4+
version = "0.6.9"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/SymSparseMatrixCSR.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,7 @@ function Base.convert(
206206
utrian = convert(SparseMatrixCSR{Bi,Tv,Ti},a.uppertrian)
207207
SymSparseMatrixCSR(utrian)
208208
end
209+
210+
function Base.copy(a::SymSparseMatrixCSR{Bi,T,Ti}) where {Bi,T,Ti}
211+
SymSparseMatrixCSR{Bi,T,Ti}(copy(a.uppertrian))
212+
end

test/SymSparseMatrixCSR.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ function test_csr(Bi,Tv,Ti)
2323
@test CSR == CSC
2424
CSR = symsparsecsr(copy(I),copy(J),copy(V);symmetrize=true)
2525
@test CSR == CSC
26+
CSR = copy(symsparsecsr(copy(I),copy(J),copy(V);symmetrize=true))
27+
@test CSR == CSC
2628
end
2729

2830
CSR = symsparsecsr(Val(Bi),I_up,J_up,V_up)

0 commit comments

Comments
 (0)