MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / BenchmarkAddSmallMatrix

Function BenchmarkAddSmallMatrix

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

Source from the content-addressed store, hash-verified

37}
38
39func BenchmarkAddSmallMatrix(b *testing.B) {
40 m1 := matrix.New(10, 10, 0) // Create a 10x10 matrix with all zeros
41 m2 := matrix.New(10, 10, 1) // Create a 10x10 matrix with all ones
42
43 for i := 0; i < b.N; i++ {
44 _, _ = m1.Add(m2)
45 }
46}
47
48func BenchmarkAddLargeMatrix(b *testing.B) {
49 size := 1000 // Choose an appropriate size for your large matrix

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
AddMethod · 0.65

Tested by

no test coverage detected