Skip to content

Commit bab1fd1

Browse files
authored
Merge pull request #145 from st--/st/deprecate_CholType
deprecate CholType
2 parents dfcf96c + 09d96ab commit bab1fd1

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/chol.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
CholType{T,S<:AbstractMatrix} = Cholesky{T,S}
21
chol_lower(a::Matrix) = cholesky(a).L
32

43
# always use the stored cholesky factor, not a copy
5-
chol_lower(a::CholType) = a.uplo === 'L' ? a.L : a.U'
6-
chol_upper(a::CholType) = a.uplo === 'U' ? a.U : a.L'
4+
chol_lower(a::Cholesky) = a.uplo === 'L' ? a.L : a.U'
5+
chol_upper(a::Cholesky) = a.uplo === 'U' ? a.U : a.L'
76

87
if HAVE_CHOLMOD
98
CholTypeSparse{T} = SuiteSparse.CHOLMOD.Factor{T}

src/deprecates.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ using Base: @deprecate
99
@deprecate add_scal(a::Matrix, b::AbstractPDMat, c::Real) pdadd(a, b, c)
1010

1111
@deprecate full(x::AbstractPDMat) Matrix(x)
12+
13+
@deprecate CholType Cholesky

src/pdmat.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Full positive definite matrix together with a Cholesky factorization object.
44
struct PDMat{T<:Real,S<:AbstractMatrix} <: AbstractPDMat{T}
55
dim::Int
66
mat::S
7-
chol::CholType{T,S}
7+
chol::Cholesky{T,S}
88

9-
PDMat{T,S}(d::Int,m::AbstractMatrix{T},c::CholType{T,S}) where {T,S} = new{T,S}(d,m,c)
9+
PDMat{T,S}(d::Int,m::AbstractMatrix{T},c::Cholesky{T,S}) where {T,S} = new{T,S}(d,m,c)
1010
end
1111

12-
function PDMat(mat::AbstractMatrix,chol::CholType{T,S}) where {T,S}
12+
function PDMat(mat::AbstractMatrix,chol::Cholesky{T,S}) where {T,S}
1313
d = size(mat, 1)
1414
size(chol, 1) == d ||
1515
throw(DimensionMismatch("Dimensions of mat and chol are inconsistent."))
@@ -18,7 +18,7 @@ end
1818

1919
PDMat(mat::Matrix) = PDMat(mat, cholesky(mat))
2020
PDMat(mat::Symmetric) = PDMat(Matrix(mat))
21-
PDMat(fac::CholType) = PDMat(Matrix(fac), fac)
21+
PDMat(fac::Cholesky) = PDMat(Matrix(fac), fac)
2222

2323
### Conversion
2424
Base.convert(::Type{PDMat{T}}, a::PDMat) where {T<:Real} = PDMat(convert(AbstractArray{T}, a.mat))

0 commit comments

Comments
 (0)