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

Function BenchmarkIsValid

math/matrix/isvalid_test.go:45–64  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

43}
44
45func BenchmarkIsValid(b *testing.B) {
46 // Create a sample matrix for benchmarking
47 rows := 100
48 columns := 100
49 elements := make([][]int, rows)
50 for i := range elements {
51 elements[i] = make([]int, columns)
52 for j := range elements[i] {
53 elements[i][j] = i*columns + j // Some arbitrary values
54 }
55 }
56
57 // Reset the benchmark timer
58 b.ResetTimer()
59
60 // Run the benchmark
61 for i := 0; i < b.N; i++ {
62 _ = matrix.IsValid(elements)
63 }
64}

Callers

nothing calls this directly

Calls 1

IsValidFunction · 0.92

Tested by

no test coverage detected