public void ToMatrix22DException2() { MatrixD m = new MatrixD(3, 2); Matrix22D m22 = m.ToMatrix22D(); }
public void ToMatrix22DException3() { MatrixD m = new MatrixD(2, 3); Matrix22D m22 = m.ToMatrix22D(); }
public void ToMatrix22D() { double[] values = new double[] { 1.0, 2.0, 3.0, 4.0 }; MatrixD m = new MatrixD(2, 2, values, MatrixOrder.RowMajor); Matrix22D m22 = m.ToMatrix22D(); for (int i = 0; i < 2; i++) for (int j = 0; j < 2; j++) Assert.AreEqual(i * 2 + j + 1, m22[i, j]); m22 = (Matrix22D) m; for (int i = 0; i < 2; i++) for (int j = 0; j < 2; j++) Assert.AreEqual(i * 2 + j + 1, m22[i, j]); }