dotc

Forms the dot product of two complex vectors. Uses unrolled loops for strides equal to one.

  1. F dotc(Slice!(Iterator1, N, kind1) x, Slice!(Iterator2, N, kind2) y)
    @fastmath
    F
    dotc
    (
    F
    SliceKind kind1
    SliceKind kind2
    size_t N
    Iterator1
    Iterator2
    )
    (
    Slice!(Iterator1, N, kind1) x
    ,
    Slice!(Iterator2, N, kind2) y
    )
    if (
    isComplex!(DeepElementType!(typeof(x))) &&
    isComplex!(DeepElementType!(typeof(y)))
    )
  2. auto dotc(Slice!(Iterator1, N, kind1) x, Slice!(Iterator2, N, kind2) y)

Parameters

F

type for summation (optional template parameter)

x Slice!(Iterator1, N, kind1)

first n-dimensional tensor

y Slice!(Iterator2, N, kind2)

second n-dimensional tensor BLAS: CDOTU, ZDOTU

Return Value

Type: F

dot product xᐪ × y

Examples

CDOTC, ZDOTC

import mir.ndslice.allocation: slice;

auto x = slice!cdouble(2);
auto y = slice!cdouble(2);
x[] = [0 + 1i, 2 + 3i];
y[] = [4 + 5i, 6 + 7i];
version(LDC) // DMD Internal error: backend/cgxmm.c 628
assert(dotc(x, y) == (0 + -1i) * (4 + 5i) + (2 + -3i) * (6 + 7i));

Meta