Skip to content

Commit 87aa60b

Browse files
author
Andy Ferris
committed
Fixed issue with complex numbers and dot, vecdot
1 parent 20dba29 commit 87aa60b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/linalg.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ end
302302

303303
@generated function dot(a::StaticVector, b::StaticVector)
304304
if length(a) == length(b)
305-
expr = :(a[1] * b[1])
305+
expr = :(conj(a[1]) * b[1])
306306
for j = 2:length(a)
307307
expr = :($expr + conj(a[$j]) * b[$j])
308308
end
@@ -318,9 +318,9 @@ end
318318

319319
@generated function vecdot(a::StaticArray, b::StaticArray)
320320
if length(a) == length(b)
321-
expr = :(a[1] * b[1])
321+
expr = :(conj(a[1]) * b[1])
322322
for j = 2:length(a)
323-
expr = :($expr + a[$j] * b[$j])
323+
expr = :($expr + conj(a[$j]) * b[$j])
324324
end
325325

326326
return quote

0 commit comments

Comments
 (0)