| 130 | } |
| 131 | |
| 132 | func TestMatrixRows(t *testing.T) { |
| 133 | // Create a sample matrix |
| 134 | data := [][]int{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} |
| 135 | matrix, err := matrix.NewFromElements(data) |
| 136 | if err != nil { |
| 137 | t.Fatalf("Failed to copy matrix: %v", err) |
| 138 | } |
| 139 | // Check the number of rows |
| 140 | expectedRows := len(data) |
| 141 | rows := matrix.Rows() |
| 142 | if rows != expectedRows { |
| 143 | t.Errorf("Expected %d rows, but got %d", expectedRows, rows) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func TestMatrixColumns(t *testing.T) { |
| 148 | // Create a sample matrix |