4.8 Membership Test for Domains

elm in D

in returns true if the element elm, which may be an object of any type, lies in the domain D, and false otherwise.

    gap> 13 in GaussianIntegers;
    true
    gap> GaussianIntegers in GaussianIntegers;
    false
    gap> (1,2) in D12;
    false
    gap> (1,2)(3,6)(4,5) in D12;
    true 

The default function for domain membership tests is DomainOps.'in', which computes the set of elements of the domain with the function Elements (see Elements) and tests whether elm lies in this set. Special domains usually overlay this function with more efficient membership tests.

Previous Up Top Next
Index

GAP 3.4.4
April 1997