public void TestAddColumnValues2() { ObjectMatrix <int> matrix = GetTestMatrix(); int columnCount = matrix.Columns; int rowCount = matrix.Rows; matrix.AddColumn(0, -1, -2); Assert.AreEqual(matrix.Columns, columnCount + 1); Assert.AreEqual(matrix.Rows, rowCount); for (int i = 0; i < rowCount; i++) { for (int j = 0; j < columnCount; j++) { Assert.AreEqual(matrix[i, j], i + j); } } Assert.AreEqual(matrix[0, columnCount], 0); Assert.AreEqual(matrix[1, columnCount], -1); Assert.AreEqual(matrix[2, columnCount], -2); Assert.AreEqual(matrix[3, columnCount], 0); }
public void TestAddColumnValues1() { ObjectMatrix <int> matrix = GetTestMatrix(); int columnCount = matrix.Columns; int rowCount = matrix.Rows; matrix.AddColumn(0, -1, -2, -3, -4, -5, -6, -7, -8, -9); Assert.AreEqual(matrix.Columns, columnCount + 1); Assert.AreEqual(matrix.Rows, rowCount); for (int i = 0; i < rowCount; i++) { for (int j = 0; j < columnCount; j++) { Assert.AreEqual(matrix[i, j], i + j); } } for (int i = 0; i < rowCount; i++) { Assert.AreEqual(matrix[i, columnCount], -1 * i); } }
public void TestAddColumn() { ObjectMatrix <int> matrix = GetTestMatrix(); int columnCount = matrix.Columns; int rowCount = matrix.Rows; matrix.AddColumn(); Assert.AreEqual(matrix.Columns, columnCount + 1); Assert.AreEqual(matrix.Rows, rowCount); for (int i = 0; i < rowCount; i++) { for (int j = 0; j < columnCount; j++) { Assert.AreEqual(matrix[i, j], i + j); } } for (int i = 0; i < rowCount; i++) { Assert.AreEqual(matrix[i, columnCount], default(double)); } }
public void AddColumnExample() { var matrix = new ObjectMatrix<double>(2, 2); matrix[0, 0] = 1; matrix[0, 1] = 2; matrix[1, 0] = 3; matrix[1, 1] = 4; Assert.AreEqual(2, matrix.Columns); Assert.AreEqual(2, matrix.Rows); matrix.AddColumn(); Assert.AreEqual(3, matrix.Columns); Assert.AreEqual(2, matrix.Rows); }
public void AddColumnExample() { var matrix = new ObjectMatrix <double>(2, 2); matrix[0, 0] = 1; matrix[0, 1] = 2; matrix[1, 0] = 3; matrix[1, 1] = 4; Assert.AreEqual(2, matrix.Columns); Assert.AreEqual(2, matrix.Rows); matrix.AddColumn(); Assert.AreEqual(3, matrix.Columns); Assert.AreEqual(2, matrix.Rows); }
public void TestInvalidAddColumnValues2() { ObjectMatrix <int> matrix = GetTestMatrix(); matrix.AddColumn(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }
public void TestInvalidAddColumnValues1() { ObjectMatrix <int> matrix = GetTestMatrix(); matrix.AddColumn((int[])null); }