Benchmark a 3 by 3 matrix for computational throughput
(b *testing.B)
| 115 | |
| 116 | // Benchmark a 3 by 3 matrix for computational throughput |
| 117 | func BenchmarkSmallMatrixDeterminant(b *testing.B) { |
| 118 | // Create a 3 by 3 matrix for benchmarking |
| 119 | rows := 3 |
| 120 | columns := 3 |
| 121 | initialValue := 0 |
| 122 | matrix := matrix.New(rows, columns, initialValue) |
| 123 | |
| 124 | for i := 0; i < b.N; i++ { |
| 125 | _, _ = matrix.Determinant() |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | // Benchmark a 10 by 10 matrix for computational throughput. |
| 130 | func BenchmarkMatrixDeterminant(b *testing.B) { |
nothing calls this directly
no test coverage detected