MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / BenchmarkAddLargeMatrix

Function BenchmarkAddLargeMatrix

math/matrix/add_test.go:48–58  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

46}
47
48func BenchmarkAddLargeMatrix(b *testing.B) {
49 size := 1000 // Choose an appropriate size for your large matrix
50 m1 := MakeRandomMatrix[int](size, size)
51 m2 := MakeRandomMatrix[int](size, size)
52
53 b.ResetTimer() // Reset the timer to exclude setup time
54
55 for i := 0; i < b.N; i++ {
56 _, _ = m1.Add(m2)
57 }
58}

Callers

nothing calls this directly

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected