RemoveColumns() public méthode

Returns a new matrix with all of the specified columns removed
public RemoveColumns ( int passedIndicesOfColumnsToRemove ) : Matrix
passedIndicesOfColumnsToRemove int
Résultat Matrix
        public void Matrix_RemoveColumnsTest()
        {
            Matrix testMatrix = new Matrix(2,5);

            double[] row1 = { 1, 2, 3, 4, 5 };
            double[] row2 = { 1, 2, 3, 4, 5 };

            testMatrix.SetRow(0, row1);
            testMatrix.SetRow(1, row2);
           
            int[] columnsToRemove = { 1, 3, 4 };

            Matrix actualMatrix = testMatrix.RemoveColumns(columnsToRemove);

            Matrix expectedMatrix = new Matrix(2);

            double[] expectedRow1 = { 1, 3};
            double[] expectedRow2 = { 1, 3};

            expectedMatrix.SetRow(0, expectedRow1);
            expectedMatrix.SetRow(1, expectedRow2);

            (actualMatrix == expectedMatrix).Should().BeTrue();
        }