Skip to content

Commit 987faf8

Browse files
committed
PDMat: convert Matrix type to the same Cholesky type
1 parent 00804c3 commit 987faf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pdmat.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ struct PDMat{T<:Real,S<:AbstractMatrix} <: AbstractPDMat{T}
99
PDMat{T,S}(d::Int,m::AbstractMatrix{T},c::CholType{T,S}) where {T,S} = new{T,S}(d,m,c)
1010
end
1111

12-
function PDMat(mat::AbstractMatrix,chol::CholType)
12+
function PDMat(mat::AbstractMatrix,chol::CholType{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."))
16-
PDMat{eltype(mat),typeof(mat)}(d, mat, chol)
16+
PDMat{T,S}(d, convert(S, mat), chol)
1717
end
1818

1919
PDMat(mat::Matrix) = PDMat(mat, cholesky(mat))

0 commit comments

Comments
 (0)