| 35 | } |
| 36 | |
| 37 | func 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 | |
| 69 | func Scale(ctx File) { |
| 70 | ctx.Func("ScalIncUnitaryTo(dst []$Type, incdst uintptr, alpha $Type, xs []$Type, n, incx uintptr)", |