Skip to content

Commit

Permalink
Merge 77fec77 into 7ce4a5c
Browse files Browse the repository at this point in the history
  • Loading branch information
johnczito committed Mar 2, 2020
2 parents 7ce4a5c + 77fec77 commit 4a0c5b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/pdiagmat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function pdadd!(r::Matrix, a::Matrix, b::PDiagMat, c)
end

*(a::PDiagMat, c::T) where {T<:Real} = PDiagMat(a.diag * c)
*(a::PDiagMat, x::StridedVecOrMat) = a.diag .* x
\(a::PDiagMat, x::StridedVecOrMat) = a.inv_diag .* x
*(a::PDiagMat, x::AbstractVecOrMat) = a.diag .* x
\(a::PDiagMat, x::AbstractVecOrMat) = a.inv_diag .* x
Base.kron(A::PDiagMat, B::PDiagMat) = PDiagMat( vcat([A.diag[i] * B.diag for i in 1:dim(A)]...) )

### Algebra
Expand Down Expand Up @@ -84,8 +84,8 @@ unwhiten!(r::StridedMatrix, a::PDiagMat, x::StridedMatrix) =

### quadratic forms

quad(a::PDiagMat, x::StridedVector) = wsumsq(a.diag, x)
invquad(a::PDiagMat, x::StridedVector) = wsumsq(a.inv_diag, x)
quad(a::PDiagMat, x::AbstractVector) = wsumsq(a.diag, x)
invquad(a::PDiagMat, x::AbstractVector) = wsumsq(a.inv_diag, x)

function quad!(r::AbstractArray, a::PDiagMat, x::StridedMatrix)
m, n = size(x)
Expand Down
4 changes: 2 additions & 2 deletions src/scalmat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ end

*(a::ScalMat, c::T) where {T<:Real} = ScalMat(a.dim, a.value * c)
/(a::ScalMat{T}, c::T) where {T<:Real} = ScalMat(a.dim, a.value / c)
*(a::ScalMat, x::StridedVecOrMat) = a.value * x
\(a::ScalMat, x::StridedVecOrMat) = a.inv_value * x
*(a::ScalMat, x::AbstractVecOrMat) = a.value * x
\(a::ScalMat, x::AbstractVecOrMat) = a.inv_value * x
Base.kron(A::ScalMat, B::ScalMat) = ScalMat( dim(A) * dim(B), A.value * B.value )

### Algebra
Expand Down

0 comments on commit 4a0c5b3

Please sign in to comment.