BenchmarkSubMatrix benchmarks the SubMatrix function.
(b *testing.B)
| 72 | |
| 73 | // BenchmarkSubMatrix benchmarks the SubMatrix function. |
| 74 | func 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 | } |