4.14 Difference

Difference( D, E )

Difference returns the set difference of the domains D and E. Either argument may also be an arbitrary list, in which case Difference silently applies Set (see Set) to it first.

The result of Difference is the set of elements that lie in D but not in E. Note that E need not be a subset of D. The elements of E, however, that are not element of D play no role for the result.

    gap> Difference( D12, [(),(1,2,3,4,5,6),(1,3,5)(2,4,6),
    >                    (1,4)(2,5)(3,6),(1,6,5,4,3,2),(1,5,3)(2,6,4)] );
    [ (2,6)(3,5), (1,2)(3,6)(4,5), (1,3)(4,6), (1,4)(2,3)(5,6),
      (1,5)(2,4), (1,6)(2,5)(3,4) ] 

The default function DomainOps.Difference checks whether D is infinite. If it is it signals an error. Otherwise Difference computes the proper sets of elements of D and E and returns the difference of those sets (see Elements and SubtractSet). This default function is currently not overlaid for any domain.

Previous Up Top Next
Index

GAP 3.4.4
April 1997