Skip to content

Commit 2f7ba0c

Browse files
authored
Merge pull request #77 from JuliaStats/db/LinAlgnames
Update to cholesky name and accessors
2 parents abd8fa4 + 7d4660b commit 2f7ba0c

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
julia 0.7.0-DEV.3449
1+
julia 0.7.0-DEV.5190 # for cholesky function
22
Compat 0.61.0

src/chol.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CholType{T,S<:AbstractMatrix} = Cholesky{T,S}
2-
chol_lower(a::Matrix) = chol(a)'
2+
chol_lower(a::Matrix) = cholesky(a).L
33

44
if HAVE_CHOLMOD
55
CholTypeSparse{T} = SuiteSparse.CHOLMOD.Factor{T}

src/pdmat.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function PDMat(mat::AbstractMatrix,chol::CholType)
1313
PDMat{eltype(mat),typeof(mat)}(d, mat, chol)
1414
end
1515

16-
PDMat(mat::Matrix) = PDMat(mat, cholfact(mat))
16+
PDMat(mat::Matrix) = PDMat(mat, cholesky(mat))
1717
PDMat(mat::Symmetric) = PDMat(Matrix(mat))
1818
PDMat(fac::CholType) = PDMat(Matrix(fac), fac)
1919

src/pdsparsemat.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function PDSparseMat(mat::AbstractSparseMatrix,chol::CholTypeSparse)
1313
PDSparseMat{eltype(mat),typeof(mat)}(d, mat, chol)
1414
end
1515

16-
PDSparseMat(mat::SparseMatrixCSC) = PDSparseMat(mat, cholfact(mat))
16+
PDSparseMat(mat::SparseMatrixCSC) = PDSparseMat(mat, cholesky(mat))
1717
PDSparseMat(fac::CholTypeSparse) = PDSparseMat(sparse(fac) |> x -> x*x', fac)
1818

1919
### Conversion

src/testutils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ end
222222

223223
function pdtest_whiten(C::AbstractPDMat, Cmat::Matrix, verbose::Int)
224224
Y = chol_lower(Cmat)
225-
Q = qr(convert(Array{eltype(C),2},randn(size(Cmat))))[1]
225+
Q = qr(convert(Array{eltype(C),2},randn(size(Cmat)))).Q
226226
Y = Y * Q' # generate a matrix Y such that Y * Y' = C
227227
@test Y * Y' Cmat
228228
d = dim(C)

test/pdmtypes.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ call_test_pdmat(p::AbstractPDMat,m::Matrix) = test_pdmat(p,m,cmat_eq=true,verbos
77
for T in [Float64, Float32]
88
#test that all external constructors are accessible
99
m = Matrix{T}(I, 2, 2)
10-
@test PDMat(m, cholfact(m)).mat == PDMat(Symmetric(m)).mat == PDMat(m).mat == PDMat(cholfact(m)).mat
10+
@test PDMat(m, cholesky(m)).mat == PDMat(Symmetric(m)).mat == PDMat(m).mat == PDMat(cholesky(m)).mat
1111
d = ones(T,2)
1212
@test PDiagMat(d,d).inv_diag == PDiagMat(d).inv_diag
1313
x = one(T)
1414
@test ScalMat(2,x,x).inv_value == ScalMat(2,x).inv_value
1515
s = SparseMatrixCSC{T}(I, 2, 2)
16-
@test PDSparseMat(s, cholfact(s)).mat == PDSparseMat(s).mat == PDSparseMat(cholfact(s)).mat
16+
@test PDSparseMat(s, cholesky(s)).mat == PDSparseMat(s).mat == PDSparseMat(cholesky(s)).mat
1717

1818
#test the functionality
1919
M = convert(Array{T,2}, [4. -2. -1.; -2. 5. -1.; -1. -1. 6.])

0 commit comments

Comments
 (0)