MCPcopy Create free account
hub / github.com/egonelbre/exp / Axpy

Function Axpy

vector/generate/example.go:37–67  ·  view source on GitHub ↗
(ctx File)

Source from the content-addressed store, hash-verified

35}
36
37func Axpy(ctx File) {
38 ctx.Func("AxpyUnitary(alpha $Type, xs, ys []$Type)",
39 Iterate{
40 Ranges: []It{
41 Slice("ys", 0, 1),
42 Slice("xs", 0, 1),
43 },
44 For: "$ys += alpha * $xs",
45 })
46
47 ctx.Func("AxpyUnitaryTo(dst []$Type, alpha $Type, xs, ys []$Type)",
48 Iterate{
49 Ranges: []It{
50 Slice("dst", 0, 1),
51 Slice("ys", 0, 1),
52 Slice("xs", 0, 1),
53 },
54 For: "$dst = $ys + alpha * $xs",
55 })
56
57 ctx.Func("AxpyIncTo(dst []$Type, incDst, idst uintptr, alpha $Type, xs, ys []$Type, n, incx, incy, ix, iy uintptr)",
58 Iterate{
59 Ranges: []It{
60 Range("i", 0, "n"),
61 Slice("dst", "idst", "incDst"),
62 Slice("xs", "ix", "incx"),
63 Slice("ys", "iy", "incy"),
64 },
65 For: "$dst = $ys + alpha * $xs",
66 })
67}
68
69func Scale(ctx File) {
70 ctx.Func("ScalIncUnitaryTo(dst []$Type, incdst uintptr, alpha $Type, xs []$Type, n, incx uintptr)",

Callers 1

AllFunction · 0.70

Calls 3

SliceFunction · 0.85
RangeFunction · 0.85
FuncMethod · 0.65

Tested by

no test coverage detected