Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Commit 18a0772

Browse files
committed
remove extraneous where and add some tests
1 parent 75b5113 commit 18a0772

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/sparse/array.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ function size(g::CuSparseMatrix, d::Integer)
166166
end
167167
end
168168

169-
issymmetric(M::Union{CuSparseMatrixCSC,CuSparseMatrixCSR})= false
170-
ishermitian(M::Union{CuSparseMatrixCSC,CuSparseMatrixCSR}) where T = false
171-
issymmetric(M::Symmetric{CuSparseMatrixCSC})= true
169+
issymmetric(M::Union{CuSparseMatrixCSC,CuSparseMatrixCSR}) = false
170+
ishermitian(M::Union{CuSparseMatrixCSC,CuSparseMatrixCSR}) = false
171+
issymmetric(M::Symmetric{CuSparseMatrixCSC}) = true
172172
ishermitian(M::Hermitian{CuSparseMatrixCSC}) = true
173173

174174
istriu(M::UpperTriangular{T,S}) where {T<:BlasFloat, S<:AbstractCuSparseMatrix} = true

test/sparse.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ blockdim = 5
4747
y = sprand(n,0.2)
4848
d_y = CuSparseVector(y)
4949
@test_throws ArgumentError copyto!(d_y,d_x)
50+
x = sprand(m,m,0.2)
51+
d_x = Symmetric(CuSparseMatrixCSC(x + transpose(x)))
52+
@test issymmetric(d_x)
53+
x = sprand(ComplexF64, m, m, 0.2)
54+
d_x = Hermitian(CuSparseMatrixCSC(x + x'))
55+
@test ishermitian(d_x)
56+
x = sprand(m,m,0.2)
57+
d_x = UpperTriangular(CuSparseMatrixCSC(x))
58+
@test istriu(d_x)
59+
@test !istril(d_x)
60+
d_x = LowerTriangular(CuSparseMatrixCSC(x))
61+
@test !istriu(d_x)
62+
@test istril(d_x)
5063
end
5164

5265
@testset "char" begin

0 commit comments

Comments
 (0)