mtimes

Vector-vector multiplication (dot product).

  1. Slice!(BlasType!(IteratorA, IteratorB)*, 2) mtimes(Slice!(IteratorA, 2, kindA) a, Slice!(IteratorB, 2, kindB) b)
  2. Slice!(BlasType!(IteratorA, IteratorB)*) mtimes(Slice!(IteratorA, 2, kindA) a, Slice!(IteratorB, 1, kindB) b)
  3. Slice!(BlasType!(IteratorA, IteratorB)*) mtimes(Slice!(IteratorB, 1, kindB) a, Slice!(IteratorA, 2, kindA) b)
  4. CommonType!(BlasType!IteratorA, BlasType!IteratorB) mtimes(Slice!(IteratorB, 1, kindB) a, Slice!(IteratorA, 1, kindA) b)
    CommonType!(BlasType!IteratorA, BlasType!IteratorB)
    mtimes
    (
    IteratorA
    SliceKind kindA
    IteratorB
    SliceKind kindB
    )
    (
    Slice!(IteratorB, 1, kindB) a
    ,
    Slice!(IteratorA, 1, kindA) b
    )

Parameters

a Slice!(IteratorB, 1, kindB)

1(rows) x k(cols) vector

b Slice!(IteratorA, 1, kindA)

k(rows) x 1(cols) matrix Result: scalar

Examples

import mir.ndslice;

auto a = [1, 2, 4].sliced;
auto b = [3, 4, 2].sliced;
assert(a.mtimes(b) == 19);

Meta