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

Function BenchmarkSubtract

math/matrix/subtract_test.go:40–50  ·  view source on GitHub ↗

BenchmarkSubtract benchmarks the Subtract function.

(b *testing.B)

Source from the content-addressed store, hash-verified

38
39// BenchmarkSubtract benchmarks the Subtract function.
40func BenchmarkSubtract(b *testing.B) {
41 // Create sample matrices for benchmarking
42 rows := 100
43 columns := 100
44 m1 := matrix.New(rows, columns, 2) // Replace with appropriate values
45 m2 := matrix.New(rows, columns, 3) // Replace with appropriate values
46
47 for i := 0; i < b.N; i++ {
48 _, _ = m1.Subtract(m2)
49 }
50}

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
SubtractMethod · 0.80

Tested by

no test coverage detected