The bit-set Module¶
- <bit-set> Primary Class¶
- Superclasses:
- Init-Keywords:
all-members-from – If this is a non-negative integer then the set created will be infinite. All integers greater than or equal to the one supplied will be members of the set. The default is
#f
.member-vector –
members – If supplied, this gives the initial elements of the set as a sequence of integers.
pad –
upper-bound-hint – An integer which indicates that all the elements of the set are expected to below this value. This is merely an aid to the implementation when allocating the set, and integers which are greater than or equal to this number can be added at any time. The default is zero.
- Discussion:
Represents finite sets and some infinite sets over the non-negative integers in an efficient manner using a
<bit-vector>
. The infinite sets which can be represented are those which are the complement of a finite set.
- copy-bit-set! Function¶
- empty-bit-set! Function¶
- Signature:
empty-bit-set! set => ()
- Parameters:
set – An instance of
<bit-set>
.
- Discussion:
Destructively modifies
set
by removing all its elements.
- infinite? Sealed Generic function¶
- member? Sealed Generic function¶
- set-add Sealed Generic function¶
- set-add! Sealed Generic function¶
- set-complement Sealed Generic function¶
- set-complement! Sealed Generic function¶
- set-difference Sealed Generic function¶
- Signature:
set-difference set1 set2 => new-set
- Parameters:
- Values:
new-set – An instance of
<bit-set>
.
- Discussion:
Returns a new bit-set whose elements are determined by removing elements from
set1
which are also members ofset2
. Neitherset1
orset2
will be altered.
- set-difference! Sealed Generic function¶
- set-intersection Sealed Generic function¶
- Signature:
set-intersection set1 set2 => new-set
- Parameters:
- Values:
new-set – An instance of
<bit-set>
.
- Discussion:
Returns a new bit-set containing only elements which appear in both
set1
andset2
. Neitherset1
orset2
will be altered.
- set-intersection! Sealed Generic function¶
- set-remove Sealed Generic function¶
- set-remove! Sealed Generic function¶
- Signature:
set-remove! set element => new-set
- Parameters:
- Values:
new-set – An instance of
<bit-set>
.
- Discussion:
Modifies
set
so that it no longer containselement
. The returned set,new-set == set
.element
must be a non-negative integer.
- set-union Sealed Generic function¶
- set-union! Sealed Generic function¶
- size Sealed Generic function¶