public void GetCol() { double[][] matrixData1 = { new[] { 1.0, 2.0 }, new[] { 3.0, 4.0 } }; double[][] matrixData2 = { new[] { 2.0 }, new[] { 4.0 } }; var matrix1 = new Matrix(matrixData1); var matrix2 = new Matrix(matrixData2); Matrix matrixCol = matrix1.GetCol(1); Assert.IsTrue(matrixCol.Equals(matrix2)); try { matrix1.GetCol(3); Assert.IsTrue(false); } catch (MatrixError) { Assert.IsTrue(true); } }
public void GetCol() { double[][] matrixData1 = { new[] {1.0, 2.0}, new[] {3.0, 4.0} }; double[][] matrixData2 = { new[] {2.0}, new[] {4.0} }; var matrix1 = new Matrix(matrixData1); var matrix2 = new Matrix(matrixData2); Matrix matrixCol = matrix1.GetCol(1); Assert.IsTrue(matrixCol.Equals(matrix2)); try { matrix1.GetCol(3); Assert.IsTrue(false); } catch (MatrixError) { Assert.IsTrue(true); } }