Skip to content

Commit

Permalink
Eliminate uses of full from test/sparse/[spqr|cholmod|sparse].jl. (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacha0 authored and andreasnoack committed Sep 27, 2017
1 parent c240439 commit ed51793
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions test/sparse/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -728,20 +728,20 @@ for F in (cholfact(AtA), cholfact(AtA, perm=1:5), ldltfact(AtA), ldltfact(AtA, p

#Test update
F11 = CHOLMOD.lowrankupdate(F1, C)
@test full(sparse(F11)) AtA+C*C'
@test Array(sparse(F11)) AtA+C*C'
@test F11\ones(5) B
#Make sure we get back the same factor again
F10 = CHOLMOD.lowrankdowndate(F11, C)
@test full(sparse(F10)) AtA
@test Array(sparse(F10)) AtA
@test F10\ones(5) B0

#Test in-place update
CHOLMOD.lowrankupdate!(F1, C)
@test full(sparse(F1)) AtA+C*C'
@test Array(sparse(F1)) AtA+C*C'
@test F1\ones(5) B
#Test in-place downdate
CHOLMOD.lowrankdowndate!(F1, C)
@test full(sparse(F1)) AtA
@test Array(sparse(F1)) AtA
@test F1\ones(5) B0

@test C == Ctest #Make sure C didn't change
Expand Down
2 changes: 1 addition & 1 deletion test/sparse/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ end

@test R == real.(S) == real(S)
@test I == imag.(S) == imag(S)
@test conj(full(S)) == conj.(S) == conj(S)
@test conj(Array(S)) == conj.(S) == conj(S)
@test real.(spR) == R
@test nnz(imag.(spR)) == nnz(imag(spR)) == 0
@test abs.(S) == abs.(D)
Expand Down
4 changes: 2 additions & 2 deletions test/sparse/spqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ nn = 100
@test (eye(m)*Q)*Q' eye(m)

# test that Q'Pl*A*Pr = R
R0 = Q'*full(A[F[:prow], F[:pcol]])
R0 = Q'*Array(A[F[:prow], F[:pcol]])
@test R0[1:n, :] F[:R]
@test norm(R0[n + 1:end, :], 1) < 1e-12

Expand Down Expand Up @@ -70,7 +70,7 @@ end
A = sprandn(m, 5, 0.9)*sprandn(5, n, 0.9)
b = randn(m)
xs = A\b
xd = full(A)\b
xd = Array(A)\b

# check that basic solution has more zeros
@test count(!iszero, xs) < count(!iszero, xd)
Expand Down

0 comments on commit ed51793

Please sign in to comment.