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

Function BenchmarkSubMatrix

math/matrix/submatrix_test.go:74–88  ·  view source on GitHub ↗

BenchmarkSubMatrix benchmarks the SubMatrix function.

(b *testing.B)

Source from the content-addressed store, hash-verified

72
73// BenchmarkSubMatrix benchmarks the SubMatrix function.
74func BenchmarkSubMatrix(b *testing.B) {
75 // Create a sample matrix for benchmarking
76 rows := 100
77 columns := 100
78 matrix := matrix.New(rows, columns, 2) // Replace with appropriate values
79
80 rowStart := 10
81 colStart := 10
82 numRows := 20
83 numCols := 20
84
85 for i := 0; i < b.N; i++ {
86 _, _ = matrix.SubMatrix(rowStart, colStart, numRows, numCols)
87 }
88}

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
SubMatrixMethod · 0.80

Tested by

no test coverage detected