complement!

..  complement!(s)

Mutates :obj:`IntSet` ``s`` into its set-complement.

Examples

julia> foo = IntSet([5:100]);
julia> m = maximum(foo);    # = 100

julia> complement!(foo);

julia> for i in foo
        if(i <= m)
            println(i);
        else
            break;
        end
    end
0
1
2
3
4

In the Julia programming language, the function complement!(s) mutates an IntSet s into its set-complement.

julia> s = IntSet([1, 2, 3, 4, 5]);
julia> complement!(s)
IntSet([6, 7, 8, 9, 10])

This example demonstrates how the complement! function mutates the IntSet s by converting it into its set-complement. The resulting IntSet contains all integers not present in the original set.

See Also

complement, complement!, intersect, intersect!, issubset, selectperm, selectperm!, Set, setdiff, setdiff!, symdiff, union, union!,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: