internal/asm/f{32,64}: rename L1Norm => L1NormUnitary for consistency
diff --git a/blas/gonum/level1float32.go b/blas/gonum/level1float32.go
index 143a437..3c67a3f 100644
--- a/blas/gonum/level1float32.go
+++ b/blas/gonum/level1float32.go
@@ -69,7 +69,7 @@
}
if incX == 1 {
x = x[:n]
- return f32.L1Norm(x)
+ return f32.L1NormUnitary(x)
}
return f32.L1NormInc(x, n, incX)
}
diff --git a/blas/gonum/level1float64.go b/blas/gonum/level1float64.go
index 967976f..87707bb 100644
--- a/blas/gonum/level1float64.go
+++ b/blas/gonum/level1float64.go
@@ -63,7 +63,7 @@
}
if incX == 1 {
x = x[:n]
- return f64.L1Norm(x)
+ return f64.L1NormUnitary(x)
}
return f64.L1NormInc(x, n, incX)
}
diff --git a/blas/gonum/single_precision.bash b/blas/gonum/single_precision.bash
index eace054..77fdab5 100755
--- a/blas/gonum/single_precision.bash
+++ b/blas/gonum/single_precision.bash
@@ -25,7 +25,7 @@
| gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \
| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \
| gofmt -r 'f64.L1NormInc -> f32.L1NormInc' \
-| gofmt -r 'f64.L1Norm -> f32.L1Norm' \
+| gofmt -r 'f64.L1NormUnitary -> f32.L1NormUnitary' \
| gofmt -r 'f64.L2NormInc -> f32.L2NormInc' \
| gofmt -r 'f64.L2NormUnitary -> f32.L2NormUnitary' \
| gofmt -r 'f64.ScalInc -> f32.ScalInc' \
diff --git a/floats/floats.go b/floats/floats.go
index 8300640..b8d6f50 100644
--- a/floats/floats.go
+++ b/floats/floats.go
@@ -605,7 +605,7 @@
}
var norm float64
if L == 1 {
- return f64.L1Norm(s)
+ return f64.L1NormUnitary(s)
}
if math.IsInf(L, 1) {
for _, val := range s {
diff --git a/internal/asm/f32/stubs_amd64.go b/internal/asm/f32/stubs_amd64.go
index 2fcbef1..dc6cf50 100644
--- a/internal/asm/f32/stubs_amd64.go
+++ b/internal/asm/f32/stubs_amd64.go
@@ -78,13 +78,13 @@
// return sum
func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32)
-// L1Norm is
+// L1NormUnitary is
//
// for _, v := range x {
// sum += math.Abs(v)
// }
// return sum
-func L1Norm(x []float32) (sum float32) {
+func L1NormUnitary(x []float32) (sum float32) {
for _, v := range x {
sum += math32.Abs(v)
}
diff --git a/internal/asm/f32/stubs_noasm.go b/internal/asm/f32/stubs_noasm.go
index 495738d..10bebdf 100644
--- a/internal/asm/f32/stubs_noasm.go
+++ b/internal/asm/f32/stubs_noasm.go
@@ -123,13 +123,13 @@
return
}
-// L1Norm is
+// L1NormUnitary is
//
// for _, v := range x {
// sum += math.Abs(v)
// }
// return sum
-func L1Norm(x []float32) (sum float32) {
+func L1NormUnitary(x []float32) (sum float32) {
for _, v := range x {
sum += math32.Abs(v)
}
diff --git a/internal/asm/f64/abssum_amd64.s b/internal/asm/f64/abssum_amd64.s
index df63dc0..0b0280a 100644
--- a/internal/asm/f64/abssum_amd64.s
+++ b/internal/asm/f64/abssum_amd64.s
@@ -6,8 +6,8 @@
#include "textflag.h"
-// func L1Norm(x []float64) float64
-TEXT ·L1Norm(SB), NOSPLIT, $0
+// func L1NormUnitary(x []float64) float64
+TEXT ·L1NormUnitary(SB), NOSPLIT, $0
MOVQ x_base+0(FP), SI // SI = &x
MOVQ x_len+8(FP), CX // CX = len(x)
XORQ AX, AX // i = 0
diff --git a/internal/asm/f64/bench_other_test.go b/internal/asm/f64/bench_other_test.go
index 5704381..8c9f1ba 100644
--- a/internal/asm/f64/bench_other_test.go
+++ b/internal/asm/f64/bench_other_test.go
@@ -25,17 +25,17 @@
return sum
}
-func BenchmarkL1Norm1(t *testing.B) { benchL1Norm(L1Norm, 1, t) }
-func BenchmarkL1Norm2(t *testing.B) { benchL1Norm(L1Norm, 2, t) }
-func BenchmarkL1Norm3(t *testing.B) { benchL1Norm(L1Norm, 3, t) }
-func BenchmarkL1Norm4(t *testing.B) { benchL1Norm(L1Norm, 4, t) }
-func BenchmarkL1Norm5(t *testing.B) { benchL1Norm(L1Norm, 5, t) }
-func BenchmarkL1Norm10(t *testing.B) { benchL1Norm(L1Norm, 10, t) }
-func BenchmarkL1Norm100(t *testing.B) { benchL1Norm(L1Norm, 100, t) }
-func BenchmarkL1Norm1000(t *testing.B) { benchL1Norm(L1Norm, 1000, t) }
-func BenchmarkL1Norm10000(t *testing.B) { benchL1Norm(L1Norm, 10000, t) }
-func BenchmarkL1Norm100000(t *testing.B) { benchL1Norm(L1Norm, 100000, t) }
-func BenchmarkL1Norm500000(t *testing.B) { benchL1Norm(L1Norm, 500000, t) }
+func BenchmarkL1Norm1(t *testing.B) { benchL1Norm(L1NormUnitary, 1, t) }
+func BenchmarkL1Norm2(t *testing.B) { benchL1Norm(L1NormUnitary, 2, t) }
+func BenchmarkL1Norm3(t *testing.B) { benchL1Norm(L1NormUnitary, 3, t) }
+func BenchmarkL1Norm4(t *testing.B) { benchL1Norm(L1NormUnitary, 4, t) }
+func BenchmarkL1Norm5(t *testing.B) { benchL1Norm(L1NormUnitary, 5, t) }
+func BenchmarkL1Norm10(t *testing.B) { benchL1Norm(L1NormUnitary, 10, t) }
+func BenchmarkL1Norm100(t *testing.B) { benchL1Norm(L1NormUnitary, 100, t) }
+func BenchmarkL1Norm1000(t *testing.B) { benchL1Norm(L1NormUnitary, 1000, t) }
+func BenchmarkL1Norm10000(t *testing.B) { benchL1Norm(L1NormUnitary, 10000, t) }
+func BenchmarkL1Norm100000(t *testing.B) { benchL1Norm(L1NormUnitary, 100000, t) }
+func BenchmarkL1Norm500000(t *testing.B) { benchL1Norm(L1NormUnitary, 500000, t) }
func BenchmarkLL1Norm1(t *testing.B) { benchL1Norm(naiveL1Norm, 1, t) }
func BenchmarkLL1Norm2(t *testing.B) { benchL1Norm(naiveL1Norm, 2, t) }
diff --git a/internal/asm/f64/stubs_amd64.go b/internal/asm/f64/stubs_amd64.go
index 7139bed..ca32581 100644
--- a/internal/asm/f64/stubs_amd64.go
+++ b/internal/asm/f64/stubs_amd64.go
@@ -7,13 +7,13 @@
package f64
-// L1Norm is
+// L1NormUnitary is
//
// for _, v := range x {
// sum += math.Abs(v)
// }
// return sum
-func L1Norm(x []float64) (sum float64)
+func L1NormUnitary(x []float64) (sum float64)
// L1NormInc is
//
diff --git a/internal/asm/f64/stubs_noasm.go b/internal/asm/f64/stubs_noasm.go
index f066379..427d11b 100644
--- a/internal/asm/f64/stubs_noasm.go
+++ b/internal/asm/f64/stubs_noasm.go
@@ -9,13 +9,13 @@
import "math"
-// L1Norm is
+// L1NormUnitary is
//
// for _, v := range x {
// sum += math.Abs(v)
// }
// return sum
-func L1Norm(x []float64) (sum float64) {
+func L1NormUnitary(x []float64) (sum float64) {
for _, v := range x {
sum += math.Abs(v)
}
diff --git a/internal/asm/f64/stubs_test.go b/internal/asm/f64/stubs_test.go
index 89b30aa..a0a031b 100644
--- a/internal/asm/f64/stubs_test.go
+++ b/internal/asm/f64/stubs_test.go
@@ -28,7 +28,7 @@
g_ln := 4 + j%2
v.x = guardVector(v.x, src_gd, g_ln)
src := v.x[g_ln : len(v.x)-g_ln]
- ret := L1Norm(src)
+ ret := L1NormUnitary(src)
if !scalar.Same(ret, v.want) {
t.Errorf("Test %d L1Norm error Got: %f Expected: %f", j, ret, v.want)
}
diff --git a/lapack/gonum/dlangb.go b/lapack/gonum/dlangb.go
index 4b7b449..a67a68e 100644
--- a/lapack/gonum/dlangb.go
+++ b/lapack/gonum/dlangb.go
@@ -57,7 +57,7 @@
for i := 0; i < min(m, n+kl); i++ {
l := max(0, kl-i)
u := min(n+kl-i, ncol)
- sum := f64.L1Norm(ab[i*ldab+l : i*ldab+u])
+ sum := f64.L1NormUnitary(ab[i*ldab+l : i*ldab+u])
if sum > value || math.IsNaN(sum) {
value = sum
}