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. 4 5// +build !noasm,!gccgo,!safe 6 7package f32 8 9// AxpyUnitary is 10// for i, v := range x { 11// y[i] += alpha * v 12// } 13func AxpyUnitary(alpha float32, x, y []float32) 14 15// AxpyUnitaryTo is 16// for i, v := range x { 17// dst[i] = alpha*v + y[i] 18// } 19func AxpyUnitaryTo(dst []float32, alpha float32, x, y []float32) 20 21// AxpyInc is 22// for i := 0; i < int(n); i++ { 23// y[iy] += alpha * x[ix] 24// ix += incX 25// iy += incY 26// } 27func AxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) 28 29// AxpyIncTo is 30// for i := 0; i < int(n); i++ { 31// dst[idst] = alpha*x[ix] + y[iy] 32// ix += incX 33// iy += incY 34// idst += incDst 35// } 36func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) 37 38// DdotUnitary is 39// for i, v := range x { 40// sum += float64(y[i]) * float64(v) 41// } 42// return 43func DdotUnitary(x, y []float32) (sum float64) 44 45// DdotInc is 46// for i := 0; i < int(n); i++ { 47// sum += float64(y[iy]) * float64(x[ix]) 48// ix += incX 49// iy += incY 50// } 51// return 52func DdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64) 53 54// DotUnitary is 55// for i, v := range x { 56// sum += y[i] * v 57// } 58// return sum 59func DotUnitary(x, y []float32) (sum float32) 60 61// DotInc is 62// for i := 0; i < int(n); i++ { 63// sum += y[iy] * x[ix] 64// ix += incX 65// iy += incY 66// } 67// return sum 68func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32) 69 70// Sum is 71// var sum float32 72// for _, v := range x { 73// sum += v 74// } 75// return sum 76func Sum(x []float32) float32 77