1 // Copyright ©2017 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.
12 func BenchmarkDotUnitary(t *testing.B) {
13 for _, test := range []struct {
15 f func(x, y []complex128) complex128
17 {"DotcUnitary", DotcUnitary},
18 {"DotuUnitary", DotuUnitary},
20 for _, v := range []int64{1, 2, 3, 4, 5, 10, 100, 1e3, 5e3, 1e4, 5e4} {
21 t.Run(fmt.Sprintf("%s-%d", test.name, v), func(b *testing.B) {
24 for i := 0; i < b.N; i++ {
25 benchSink = test.f(x, y)
32 func BenchmarkDotInc(t *testing.B) {
33 for _, test := range []struct {
35 f func(x, y []complex128, n, incX, incY, ix, iy uintptr) complex128
40 for _, ln := range []int{1, 2, 3, 4, 5, 10, 100, 1e3, 5e3, 1e4, 5e4} {
41 for _, inc := range []int{1, 2, 4, 10, -1, -2, -4, -10} {
42 t.Run(fmt.Sprintf("%s-%d-inc%d", test.name, ln, inc), func(b *testing.B) {
43 b.SetBytes(int64(256 * ln))
48 for i := 0; i < b.N; i++ {
49 benchSink = test.f(x, y, uintptr(ln),
50 uintptr(inc), uintptr(inc),
51 uintptr(idx), uintptr(idx))