| 160 | } |
| 161 | |
| 162 | func TestMatrixEmptyRowsAndColumns(t *testing.T) { |
| 163 | // Create an empty matrix |
| 164 | emptyMatrix := matrix.New(0, 0, 0) |
| 165 | |
| 166 | // Check the number of rows and columns for an empty matrix |
| 167 | rows := emptyMatrix.Rows() |
| 168 | columns := emptyMatrix.Columns() |
| 169 | |
| 170 | if rows != 0 { |
| 171 | t.Errorf("Expected 0 rows for an empty matrix, but got %d", rows) |
| 172 | } |
| 173 | |
| 174 | if columns != 0 { |
| 175 | t.Errorf("Expected 0 columns for an empty matrix, but got %d", columns) |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | // BenchmarkNew benchmarks the New function. |
| 180 | func BenchmarkNew(b *testing.B) { |