Skip to content

Commit

Permalink
Merge pull request #18640 from JuliaLang/ksh/smallsparse2
Browse files Browse the repository at this point in the history
Even more tests for sparse
  • Loading branch information
kshyatt authored Sep 23, 2016
2 parents 1c514e7 + dd51dc3 commit 98e29ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/sparsedir/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ chma = ldltfact(A) # LDL' form
x = chma\B
@test x ones(size(x))
@test nnz(ldltfact(A, perm=1:size(A,1))) > nnz(chma)
@test size(chma) == size(A)
chmal = CHOLMOD.FactorComponent(chma, :L)
@test size(chmal) == size(A)
@test size(chmal, 1) == size(A, 1)

chma = cholfact(A) # LL' form
@test CHOLMOD.isvalid(chma)
Expand All @@ -115,6 +119,10 @@ x = chma\B
@test x ones(size(x))
@test nnz(chma) == 489
@test nnz(cholfact(A, perm=1:size(A,1))) > nnz(chma)
@test size(chma) == size(A)
chmal = CHOLMOD.FactorComponent(chma, :L)
@test size(chmal) == size(A)
@test size(chmal, 1) == size(A, 1)

#lp_afiro example
afiro = CHOLMOD.Sparse(27, 51,
Expand Down
2 changes: 2 additions & 0 deletions test/sparsedir/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ end
# conj
cA = sprandn(5,5,0.2) + im*sprandn(5,5,0.2)
@test full(conj.(cA)) == conj(full(cA))
@test full(conj!(copy(cA))) == conj(full(cA))

# Test SparseMatrixCSC [c]transpose[!] and permute[!] methods
let smalldim = 5, largedim = 10, nzprob = 0.4
Expand Down Expand Up @@ -403,6 +404,7 @@ end
# spdiagm
@test full(spdiagm((ones(2), ones(2)), (0, -1), 3, 3)) ==
[1.0 0.0 0.0; 1.0 1.0 0.0; 0.0 1.0 0.0]
@test full(spdiagm(ones(2), -1, 3, 3)) == diagm(ones(2), -1)

# issue #4986, reinterpret
sfe22 = speye(Float64, 2)
Expand Down

0 comments on commit 98e29ed

Please sign in to comment.