1 // Copyright ©2016 The Gonum Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 //+build !amd64 noasm appengine
10 // for i, v := range x {
13 func AxpyUnitary(alpha float32, x, y []float32) {
20 // for i, v := range x {
21 // dst[i] = alpha*v + y[i]
23 func AxpyUnitaryTo(dst []float32, alpha float32, x, y []float32) {
25 dst[i] = alpha*v + y[i]
30 // for i := 0; i < int(n); i++ {
31 // y[iy] += alpha * x[ix]
35 func AxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) {
36 for i := 0; i < int(n); i++ {
37 y[iy] += alpha * x[ix]
44 // for i := 0; i < int(n); i++ {
45 // dst[idst] = alpha*x[ix] + y[iy]
50 func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) {
51 for i := 0; i < int(n); i++ {
52 dst[idst] = alpha*x[ix] + y[iy]
60 // for i, v := range x {
64 func DotUnitary(x, y []float32) (sum float32) {
72 // for i := 0; i < int(n); i++ {
73 // sum += y[iy] * x[ix]
78 func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32) {
79 for i := 0; i < int(n); i++ {
88 // for i, v := range x {
89 // sum += float64(y[i]) * float64(v)
92 func DdotUnitary(x, y []float32) (sum float64) {
94 sum += float64(y[i]) * float64(v)
100 // for i := 0; i < int(n); i++ {
101 // sum += float64(y[iy]) * float64(x[ix])
106 func DdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64) {
107 for i := 0; i < int(n); i++ {
108 sum += float64(y[iy]) * float64(x[ix])