Skip to content

Commit

Permalink
Use dot
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan authored Sep 13, 2021
1 parent e9ff084 commit e4a068d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,7 @@ unscaled_covzm(x::AbstractVector{<:Number}) = sum(abs2, x)
unscaled_covzm(x::AbstractVector) = sum(t -> t*t', x)
unscaled_covzm(x::AbstractMatrix, vardim::Int) = (vardim == 1 ? _conj(x'x) : x * x')

unscaled_covzm(x::AbstractVector, y::AbstractVector) =
sum(Broadcast.instantiate(Broadcast.broadcasted((xi, yi) -> conj(yi)*xi, x, y)))
unscaled_covzm(x::AbstractVector, y::AbstractVector) = dot(y, x)
unscaled_covzm(x::AbstractVector, y::AbstractMatrix, vardim::Int) =
(vardim == 1 ? *(transpose(x), _conj(y)) : *(transpose(x), transpose(_conj(y))))
unscaled_covzm(x::AbstractMatrix, y::AbstractVector, vardim::Int) =
Expand Down

0 comments on commit e4a068d

Please sign in to comment.