Skip to content

Commit b597af1

Browse files
authored
Merge pull request #115 from JuliaStats/an/noarpack
Remove eigmin and eigmax definitions for PDSparseMat and thereby
2 parents 2c58168 + a32d050 commit b597af1

File tree

7 files changed

+10
-19
lines changed

7 files changed

+10
-19
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ os:
55
- osx
66

77
julia:
8-
- 0.7
98
- 1.0
9+
- 1
1010
- nightly
1111

1212
notifications:

Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ uuid = "90014a1f-27ba-587c-ab20-58faa44d9150"
33
version = "0.9.12"
44

55
[deps]
6-
Arpack = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97"
76
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
87
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
98
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
109
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1110

1211
[compat]
13-
Arpack = ">=0.2"
14-
julia = "0.7, 1"
12+
julia = "1"

src/PDMats.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ module PDMats
5858
include("generics.jl")
5959
include("addition.jl")
6060

61-
include("testutils.jl")
62-
6361
include("deprecates.jl")
6462

6563
end # module

src/pdsparsemat.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Arpack
2-
31
"""
42
Sparse positive definite matrix together with a Cholesky factorization object.
53
"""
@@ -55,9 +53,6 @@ end
5553

5654
Base.inv(a::PDSparseMat{T}) where {T<:Real} = PDMat( a\eye(T,a.dim) )
5755
LinearAlgebra.logdet(a::PDSparseMat) = logdet(a.chol)
58-
LinearAlgebra.eigmax(a::PDSparseMat{T}) where {T<:Real} = convert(T,eigs(convert(SparseMatrixCSC{Float64,Int},a.mat), which=:LM, nev=1, ritzvec=false)[1][1]) #to avoid type instability issues in eigs, see e.g., julia issue #13929
59-
LinearAlgebra.eigmin(a::PDSparseMat{T}) where {T<:Real} = convert(T,eigs(convert(SparseMatrixCSC{Float64,Int},a.mat), which=:SM, nev=1, ritzvec=false)[1][1]) #to avoid type instability issues in eigs, see e.g., julia issue #13929
60-
6156

6257
### whiten and unwhiten
6358

test/pdmtypes.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
using LinearAlgebra, PDMats, SparseArrays, SuiteSparse
33
using Test
44

5-
call_test_pdmat(p::AbstractPDMat,m::Matrix) = test_pdmat(p,m,cmat_eq=true,verbose=1)
6-
75
for T in [Float64, Float32]
86
#test that all external constructors are accessible
97
m = Matrix{T}(I, 2, 2)
@@ -20,10 +18,10 @@ for T in [Float64, Float32]
2018
V = convert(Array{T,1}, [1.5, 2.5, 2.0])
2119
X = convert(T,2.0)
2220

23-
call_test_pdmat(PDMat(M), M) #tests of PDMat
24-
call_test_pdmat(PDiagMat(V), Matrix(Diagonal(V))) #tests of PDiagMat
25-
call_test_pdmat(ScalMat(3,x), x*Matrix{T}(I, 3, 3)) #tests of ScalMat
26-
call_test_pdmat(PDSparseMat(sparse(M)), M)
21+
test_pdmat(PDMat(M), M, cmat_eq=true, verbose=1) #tests of PDMat
22+
test_pdmat(PDiagMat(V), Matrix(Diagonal(V)), cmat_eq=true, verbose=1) #tests of PDiagMat
23+
test_pdmat(ScalMat(3,x), x*Matrix{T}(I, 3, 3), cmat_eq=true, verbose=1) #tests of ScalMat
24+
test_pdmat(PDSparseMat(sparse(M)), M, cmat_eq=true, verbose=1, t_eig=false)
2725
end
2826

2927
m = Matrix{Float32}(I, 2, 2)

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include("testutils.jl")
12
tests = ["pdmtypes", "addition", "generics", "kron"]
23
println("Running tests ...")
34

src/testutils.jl renamed to test/testutils.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
# the implementation of a subtype of AbstractPDMat
55
#
66

7-
using Test: @test
7+
using PDMats, SuiteSparse, Test
88

9+
const HAVE_CHOLMOD = isdefined(SuiteSparse, :CHOLMOD)
910
const PDMatType = HAVE_CHOLMOD ? Union{PDMat, PDSparseMat, PDiagMat} : Union{PDMat, PDiagMat}
1011

1112
## driver function
@@ -244,7 +245,7 @@ end
244245

245246

246247
function pdtest_whiten(C::AbstractPDMat, Cmat::Matrix, verbose::Int)
247-
Y = chol_lower(Cmat)
248+
Y = PDMats.chol_lower(Cmat)
248249
Q = qr(convert(Array{eltype(C),2},randn(size(Cmat)))).Q
249250
Y = Y * Q' # generate a matrix Y such that Y * Y' = C
250251
@test Y * Y' Cmat

0 commit comments

Comments
 (0)