RemoveColumn() 공개 메소드

Removes a column, and fills the gap by decrementing all occurrences of higher column IDs by one
public RemoveColumn ( int y ) : void
y int the column ID
리턴 void
        public void TestRemoveColumns()
        {
            var matrix = new SparseBooleanMatrix();
            for (int i = 0; i < 7; i++)
                if(i != 2 && i != 4)
                {
                    matrix[i, 1]= true;
                    matrix[i, 4]= true;
                }
            matrix[2, 2] = true;
            matrix[2, 5] = true;
            matrix[4, 3] = true;
            int[] delete_columns = {2, 4};
            matrix.RemoveColumn(delete_columns);

            // test the new columns
            Assert.IsTrue(matrix[4, 2]);
            Assert.IsTrue(matrix[2, 3]);
            Assert.IsFalse(matrix[1, 3]);
            Assert.IsFalse(matrix[4, 3]);
        }
        public void TestRemoveColumn()
        {
            var matrix = new SparseBooleanMatrix();
            for (int i = 0; i < 5; i++)
                if (i != 2 && i != 4)
                {
                    matrix[i, 1]= true;
                    matrix[i, 4]= true;
                }
            matrix[2, 2] = true;

            matrix.RemoveColumn(2);

            Assert.IsTrue(matrix[0, 3]);
            Assert.IsTrue(matrix[1, 3]);
            Assert.IsTrue(matrix[3, 3]);
            Assert.IsTrue(matrix[1, 1]);
        }