From bb5bf432e59819b932411a00acc1c325a8048199 Mon Sep 17 00:00:00 2001 From: Katie Hyatt Date: Thu, 22 Sep 2016 14:45:40 -0700 Subject: [PATCH 1/2] Tests for cholmod --- test/sparsedir/cholmod.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/sparsedir/cholmod.jl b/test/sparsedir/cholmod.jl index f7b4461911a70..3a247f66fb8a0 100644 --- a/test/sparsedir/cholmod.jl +++ b/test/sparsedir/cholmod.jl @@ -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) @@ -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, From dd51dc3d4ce55277f99286c796a7c646fdb66060 Mon Sep 17 00:00:00 2001 From: Katie Hyatt Date: Thu, 22 Sep 2016 14:45:55 -0700 Subject: [PATCH 2/2] Tests for conj! and spdiagm --- test/sparsedir/sparse.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/sparsedir/sparse.jl b/test/sparsedir/sparse.jl index 42078ee09ff3b..facff2a7b2f0c 100644 --- a/test/sparsedir/sparse.jl +++ b/test/sparsedir/sparse.jl @@ -287,6 +287,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 @@ -401,6 +402,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)