scale parameter
first n-dimensional tensor
second n-dimensional tensor BLAS: SAXPY, DAXPY, CAXPY, ZAXPY
SAXPY, DAXPY
import mir.ndslice.allocation: slice; auto x = slice!double(4); auto y = slice!double(4); x[] = [0, 1, 2, 3]; y[] = [4, 5, 6, 7]; axpy(2.0, x, y); assert(y == [4, 7, 10, 13]);
SAXPY, DAXPY
import mir.ndslice.allocation: slice; auto a = 3 + 4i; auto x = slice!cdouble(2); auto y = slice!cdouble(2); x[] = [0 + 1i, 2 + 3i]; y[] = [4 + 5i, 6 + 7i]; axpy(a, x, y); assert(y == [a * (0 + 1i) + (4 + 5i), a * (2 + 3i) + (6 + 7i)]);
Constant times a vector plus a vector. Uses unrolled loops for strides equal to one.