@@ -5,25 +5,25 @@ AbstractPDMat(A::AbstractPDMat) = A
55AbstractPDMat (A:: AbstractMatrix ) = PDMat (A)
66
77# # convert
8- Base. convert (:: Type{AbstractMatrix{T}} , a:: AbstractPDMat ) where {T<: Real } = convert (AbstractPDMat{T}, a)
9- Base. convert (:: Type{AbstractArray{T}} , a:: AbstractPDMat ) where {T<: Real } = convert (AbstractMatrix{T}, a)
8+ Base. convert (:: Type{AbstractMatrix{T}} , a:: AbstractPDMat ) where {T <: Real } = convert (AbstractPDMat{T}, a)
9+ Base. convert (:: Type{AbstractArray{T}} , a:: AbstractPDMat ) where {T <: Real } = convert (AbstractMatrix{T}, a)
1010
1111# # arithmetics
1212
13- pdadd! (r:: Matrix , a:: Matrix , b:: AbstractPDMat{T} ) where {T<: Real } = pdadd! (r, a, b, one (T))
13+ pdadd! (r:: Matrix , a:: Matrix , b:: AbstractPDMat{T} ) where {T <: Real } = pdadd! (r, a, b, one (T))
1414
1515pdadd! (a:: Matrix , b:: AbstractPDMat , c) = pdadd! (a, a, b, c)
16- pdadd! (a:: Matrix , b:: AbstractPDMat{T} ) where {T<: Real } = pdadd! (a, a, b, one (T))
16+ pdadd! (a:: Matrix , b:: AbstractPDMat{T} ) where {T <: Real } = pdadd! (a, a, b, one (T))
1717
18- pdadd (a:: Matrix{T} , b:: AbstractPDMat{S} , c:: R ) where {T<: Real , S<: Real , R<: Real } = pdadd! (similar (a, promote_type (T, S, R)), a, b, c)
19- pdadd (a:: Matrix{T} , b:: AbstractPDMat{S} ) where {T<: Real , S<: Real } = pdadd! (similar (a, promote_type (T, S)), a, b, one (T))
18+ pdadd (a:: Matrix{T} , b:: AbstractPDMat{S} , c:: R ) where {T <: Real , S <: Real , R <: Real } = pdadd! (similar (a, promote_type (T, S, R)), a, b, c)
19+ pdadd (a:: Matrix{T} , b:: AbstractPDMat{S} ) where {T <: Real , S <: Real } = pdadd! (similar (a, promote_type (T, S)), a, b, one (T))
2020
2121+ (a:: Matrix , b:: AbstractPDMat ) = pdadd (a, b)
2222+ (a:: AbstractPDMat , b:: Matrix ) = pdadd (b, a)
2323
24- * (a:: AbstractPDMat , c:: T ) where {T<: Real } = a * c
25- * (c:: T , a:: AbstractPDMat ) where {T<: Real } = a * c
26- / (a:: AbstractPDMat , c:: T ) where {T<: Real } = a * inv (c)
24+ * (a:: AbstractPDMat , c:: T ) where {T <: Real } = a * c
25+ * (c:: T , a:: AbstractPDMat ) where {T <: Real } = a * c
26+ / (a:: AbstractPDMat , c:: T ) where {T <: Real } = a * inv (c)
2727Base. kron (A:: AbstractPDMat , B:: AbstractPDMat ) = PDMat (kron (Matrix (A), Matrix (B)))
2828
2929# LinearAlgebra
@@ -140,4 +140,3 @@ Overwrite `r` with the value of the quadratic form defined by `inv(a)` applied c
140140function invquad! (r:: AbstractArray , a:: AbstractMatrix{<:Real} , x:: AbstractMatrix )
141141 return invquad! (r, AbstractPDMat (a), x)
142142end
143-
0 commit comments