public void CanSplitMatrixColumnsWhenColumnCountEquals() { var result = Matrix3By6.SplitColumns(6); result.Count.ShouldEqual(1); result[0].AsColumnMajorArray().ShouldArrayEqualWithinError(Matrix3By6.AsColumnMajorArray()); }
public void CanSplitMatrixColumns() { var result = Matrix3By6.SplitColumns(2); result.Count.ShouldEqual(3); for (int i = 0; i < result.Count; i++) { result[i].AsColumnMajorArray().ShouldArrayEqualWithinError(Matrix3By6.SubMatrix(0, Matrix3By6.RowCount, i * 2, 2).AsColumnMajorArray()); } }
public void CantSplitMatrixColumnsWhenInvalidColumnCount() { Trap.Exception(() => Matrix3By6.SplitColumns(7)).ShouldBeInstanceOf <ArgumentOutOfRangeException>(); Trap.Exception(() => Matrix3By6.SplitColumns(5)).ShouldBeInstanceOf <ArgumentOutOfRangeException>(); }