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

Function BenchmarkSmallMatrixDeterminant

math/matrix/determinant_test.go:117–127  ·  view source on GitHub ↗

Benchmark a 3 by 3 matrix for computational throughput

(b *testing.B)

Source from the content-addressed store, hash-verified

115
116// Benchmark a 3 by 3 matrix for computational throughput
117func 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.
130func BenchmarkMatrixDeterminant(b *testing.B) {

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
DeterminantMethod · 0.80

Tested by

no test coverage detected