1 // Copyright ©2015 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 !noasm,!appengine
10 // for _, v := range x {
14 func L1Norm(x []float64) (sum float64)
17 // for i := 0; i < n*incX; i += incX {
18 // sum += math.Abs(x[i])
21 func L1NormInc(x []float64, n, incX int) (sum float64)
27 func AddConst(alpha float64, x []float64)
30 // for i, v := range s {
33 func Add(dst, s []float64)
36 // for i, v := range x {
39 func AxpyUnitary(alpha float64, x, y []float64)
42 // for i, v := range x {
43 // dst[i] = alpha*v + y[i]
45 func AxpyUnitaryTo(dst []float64, alpha float64, x, y []float64)
48 // for i := 0; i < int(n); i++ {
49 // y[iy] += alpha * x[ix]
53 func AxpyInc(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]
62 func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr)
69 // for i, v := range s[1:] {
70 // dst[i+1] = dst[i] + v
73 func CumSum(dst, s []float64) []float64
80 // for i, v := range s[1:] {
81 // dst[i+1] = dst[i] * v
84 func CumProd(dst, s []float64) []float64
87 // for i, v := range s {
90 func Div(dst, s []float64)
93 // for i, v := range s {
97 func DivTo(dst, x, y []float64) []float64
100 // for i, v := range x {
104 func DotUnitary(x, y []float64) (sum float64)
107 // for i := 0; i < int(n); i++ {
108 // sum += y[iy] * x[ix]
113 func DotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64)
117 // for i, v := range s {
118 // norm += math.Abs(t[i] - v)
121 func L1Dist(s, t []float64) float64
128 // norm = math.Abs(t[0] - s[0])
129 // for i, v := range s[1:] {
130 // absDiff := math.Abs(t[i+1] - v)
131 // if absDiff > norm || math.IsNaN(norm) {
136 func LinfDist(s, t []float64) float64
139 // for i := range x {
142 func ScalUnitary(alpha float64, x []float64)
145 // for i, v := range x {
146 // dst[i] = alpha * v
148 func ScalUnitaryTo(dst []float64, alpha float64, x []float64)
152 // for i := 0; i < int(n); i++ {
156 func ScalInc(alpha float64, x []float64, n, incX uintptr)
159 // var idst, ix uintptr
160 // for i := 0; i < int(n); i++ {
161 // dst[idst] = alpha * x[ix]
165 func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr)