Skip to content

Commit

Permalink
Migrate full(X) to convert(Array, X) in tests in test/sparse/.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacha0 committed Oct 9, 2016
1 parent 8f724b7 commit c33e7a4
Show file tree
Hide file tree
Showing 5 changed files with 273 additions and 273 deletions.
16 changes: 8 additions & 8 deletions test/sparse/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ for elty in (Float64, Complex{Float64})

# Factor
@test_throws ArgumentError cholfact(A1)
@test_throws Base.LinAlg.PosDefException cholfact(A1 + A1' - 2eigmax(full(A1 + A1'))I)
@test_throws Base.LinAlg.PosDefException cholfact(A1 + A1', shift=-2eigmax(full(A1 + A1')))
@test_throws Base.LinAlg.PosDefException cholfact(A1 + A1' - 2eigmax(Array(A1 + A1'))I)
@test_throws Base.LinAlg.PosDefException cholfact(A1 + A1', shift=-2eigmax(Array(A1 + A1')))
@test_throws ArgumentError ldltfact(A1 + A1' - 2real(A1[1,1])I)
@test_throws ArgumentError ldltfact(A1 + A1', shift=-2real(A1[1,1]))
@test_throws ArgumentError cholfact(A1)
Expand All @@ -379,19 +379,19 @@ for elty in (Float64, Complex{Float64})
@test F\CHOLMOD.Sparse(sparse(ones(elty, 5))) A1pd\ones(5)
@test_throws DimensionMismatch F\CHOLMOD.Dense(ones(elty, 4))
@test_throws DimensionMismatch F\CHOLMOD.Sparse(sparse(ones(elty, 4)))
@test F'\ones(elty, 5) full(A1pd)'\ones(5)
@test F'\sparse(ones(elty, 5)) full(A1pd)'\ones(5)
@test logdet(F) logdet(full(A1pd))
@test F'\ones(elty, 5) Array(A1pd)'\ones(5)
@test F'\sparse(ones(elty, 5)) Array(A1pd)'\ones(5)
@test logdet(F) logdet(Array(A1pd))
@test det(F) == exp(logdet(F))
let # to test supernodal, we must use a larger matrix
Ftmp = sprandn(100,100,0.1)
Ftmp = Ftmp'Ftmp + I
@test logdet(cholfact(Ftmp)) logdet(full(Ftmp))
@test logdet(cholfact(Ftmp)) logdet(Array(Ftmp))
end
@test logdet(ldltfact(A1pd)) logdet(full(A1pd))
@test logdet(ldltfact(A1pd)) logdet(Array(A1pd))
@test isposdef(A1pd)
@test !isposdef(A1)
@test !isposdef(A1 + A1' |> t -> t - 2eigmax(full(t))*I)
@test !isposdef(A1 + A1' |> t -> t - 2eigmax(Array(t))*I)

if elty <: Real
@test CHOLMOD.issymmetric(Sparse(A1pd, 0))
Expand Down
Loading

0 comments on commit c33e7a4

Please sign in to comment.