| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package f32 |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
ᵀ |
| 13 |
|
| 14 |
. |
| 15 |
func Ger(m, n uintptr, alpha float32, x []float32, incX uintptr, y []float32, incY uintptr, a []float32, lda uintptr) { |
| 16 |
|
| 17 |
if incX == 1 && incY == 1 { |
| 18 |
x = x[:m] |
| 19 |
y = y[:n] |
| 20 |
for i, xv := range x { |
| 21 |
AxpyUnitary(alpha*xv, y, a[uintptr(i)*lda:uintptr(i)*lda+n]) |
| 22 |
} |
| 23 |
return |
| 24 |
} |
| 25 |
|
| 26 |
var ky, kx uintptr |
| 27 |
if int(incY) < 0 { |
| 28 |
ky = uintptr(-int(n-1) * int(incY)) |
| 29 |
} |
| 30 |
if int(incX) < 0 { |
| 31 |
kx = uintptr(-int(m-1) * int(incX)) |
| 32 |
} |
| 33 |
|
| 34 |
ix := kx |
| 35 |
for i := 0; i < int(m); i++ { |
| 36 |
AxpyInc(alpha*x[ix], y, a[uintptr(i)*lda:uintptr(i)*lda+n], uintptr(n), uintptr(incY), 1, uintptr(ky), 0) |
| 37 |
ix += incX |
| 38 |
} |
| 39 |
} |