mirror of
https://github.com/gonum/gonum.git
synced 2025-10-16 12:10:37 +08:00
mat: add benchmarks for Sum with Dense, SymDense, TriDense and VecDense
This commit is contained in:

committed by
Dan Kortschak

parent
30fedc02ce
commit
48323a4c88
@@ -2093,3 +2093,15 @@ func denseMulTransSymBench(b *testing.B, size int, rho float64) {
|
||||
wd = &n
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkDenseSum1000(b *testing.B) { denseSumBench(b, 1000) }
|
||||
|
||||
var denseSumForBench float64
|
||||
|
||||
func denseSumBench(b *testing.B, size int) {
|
||||
a, _ := randDense(size, 1.0, rand.NormFloat64)
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
denseSumForBench = Sum(a)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user