JuliaMath / JuliaMath/RealDot.jl
more efficient realdot for arrays
Open
- Dominant language
- Julia
- Stars
- 4
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Right now you use `real(LinearAlgebra.dot(x, y))`, which does twice as much work as necessary for complex arrays.
You could do e.g.
```jl
realdot(x::Vector{Complex{T}}, y::Vector{Complex{T}}) where {T} = dot(reinterpret(T, x), reinterpret(T, y))
```
and similar…
Or you could just write out the loop (two `muladd` calls per complex entry, with `@simd`), since BLAS doesn't have much of an advantage for this type of operation.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.