axpy

Constant times a vector plus a vector.

void
axpy
(
CR
V1 : Series!(I1, T1)
I1
T1
V2
)
(
in CR alpha
,
V1 x
,
V2 y
)
if (
isDynamicArray!V2 ||
isSlice!V2
)

Parameters

x V1

sparse vector

y V2

dense vector

alpha CR

scalar

Return Value

Type: void

y = alpha * x + y

Examples

import mir.series;
auto x = series([0, 3, 5, 9, 10], [1.0, 3, 4, 9, 13]);
auto y = [0.0, 1.0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
axpy(2.0, x, y);
assert(y == [2.0, 1.0, 2, 9, 4, 13, 6, 7, 8, 27, 36, 11, 12]);

Meta