| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package f64 |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
func AxpyUnitary(alpha float64, x, y []float64) { |
| 16 |
for i, v := range x { |
| 17 |
y[i] += alpha * v |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
func AxpyUnitaryTo(dst []float64, alpha float64, x, y []float64) { |
| 27 |
for i, v := range x { |
| 28 |
dst[i] = alpha*v + y[i] |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
func AxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) { |
| 40 |
for i := 0; i < int(n); i++ { |
| 41 |
y[iy] += alpha * x[ix] |
| 42 |
ix += incX |
| 43 |
iy += incY |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) { |
| 56 |
for i := 0; i < int(n); i++ { |
| 57 |
dst[idst] = alpha*x[ix] + y[iy] |
| 58 |
ix += incX |
| 59 |
iy += incY |
| 60 |
idst += incDst |
| 61 |
} |
| 62 |
} |