You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementations of the improved dot_product kernels work like a charm for real vectors but return erroneous results for complex ones. It seems like the complex versions are missing a complex-conjugate operation. See the following code snippet for reproducibility.
program main
use stdlib_linalg_constants
use stdlib_intrinsics
implicit noneinteger(ilp), parameter:: n =128complex(dp), dimension(n) :: x, y
real(dp), dimension(n, 2) :: z
callrandom_number(z); x%re = z(:, 1); x%im = z(:, 2)
callrandom_number(z); y%re = z(:, 1); y%im = z(:, 2)
print*, dot_product(x, y)
print*, stdlib_dot_product(x, y)
print*, stdlib_dot_product_kahan(x, y)
end program main
Expected Behaviour
Results between stdlib_dot_product, stdlib_dot_product_kahan and the Fortran intrinsic dot_product should be identical (up to a multiple of the machine precision).