Skip to content

Commit 212d095

Browse files
committed
Prepare version 0.3.0
SymSparseMatrixCSR only stores upper triangle, instead of lower, in order to interact with GridapPardiso package
1 parent d4f5419 commit 212d095

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Project.toml

+1-1
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]>"]
4-
version = "0.2.1"
4+
version = "0.3.0"
55

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

src/SymSparseMatrixCSR.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ end
1414

1515
show(io::IO, A::SymSparseMatrixCSR) = show(io, A.lowertrian)
1616
size(A::SymSparseMatrixCSR) = size(A.lowertrian)
17-
getindex(A::SymSparseMatrixCSR, x::Integer, y::Integer) = getindex(A.lowertrian,min(x,y),max(x,y))
17+
getindex(A::SymSparseMatrixCSR, x::Integer, y::Integer) = getindex(A.lowertrian,max(x,y),min(x,y))
1818

1919
"""
2020
nnz(S::SymSparseMatrixCSR)
@@ -88,9 +88,10 @@ end
8888
function push_coo!(::Type{SymSparseMatrixCSR},I,J,V,ik,jk,vk)
8989
9090
Inserts entries in COO vectors for further building a SymSparseMatrixCSR.
91+
It stores only the upper triangle, ignoring entries with (ik>jk) coordinates.
9192
"""
9293
function push_coo!(::Type{SymSparseMatrixCSR},I::Vector,J::Vector,V::Vector,ik::Integer,jk::Integer,vk::Number)
93-
(ik<jk) && return
94+
(ik>jk) && return
9495
(push!(I, ik), push!(J, jk), push!(V, vk))
9596
end
9697

test/SymSparseMatrixCSR.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
push_coo!(SymSparseMatrixCSR,I,J,V,ik,jk,vk)
1212
end
1313
finalize_coo!(SymSparseMatrixCSR,I,J,V,maxrows, maxcols)
14-
SYMCSC = Symmetric(sparse(I, J, V, maxrows, maxcols),:L)
14+
SYMCSC = Symmetric(sparse(I, J, V, maxrows, maxcols),:U)
1515
SYMCSR = symsparsecsr(I, J, V, maxrows, maxcols)
1616

1717
@test size(SYMCSC)==size(SYMCSR)

0 commit comments

Comments
 (0)