public void ToArray2D() { Matrix22F m = new Matrix22F(1, 2, 3, 4); float[,] array = m.ToArray2D(); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { Assert.AreEqual(i * 2 + j + 1, array[i, j]); } } array = (float[, ])m; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { Assert.AreEqual(i * 2 + j + 1, array[i, j]); } } }
public void ToArray2D() { Matrix22F m = new Matrix22F(1, 2, 3, 4); float[,] array = m.ToArray2D(); for (int i = 0; i < 2; i++) for (int j = 0; j < 2; j++) Assert.AreEqual(i * 2 + j + 1, array[i, j]); array = (float[,]) m; for (int i = 0; i < 2; i++) for (int j = 0; j < 2; j++) Assert.AreEqual(i * 2 + j + 1, array[i, j]); }