StackCollections.DigitSet
— TypeDigitSet([itr])
Construct a DigitSet
, an AbstractSet{Int}
which can only contains numbers 0:63. A DigitSet
is stored as a single integer in memory, and is immutable.
See also: StackSet
StackCollections.OneHotVector
— TypeOneHotVector([itr])
Constuct a OneHotVector
, an AbstractVector{Bool}
containing exactly one true
, and all other values false
. The vector is stored in memory as two integers and is immutable.
StackCollections.StackSet
— TypeStackSet([itr])
Construct a StackSet
, an AbstractSet{Int}
which can only contains numbers N:N+63. A Stackset
is stored in memory as a DigitSet
and an integer offset, and is immutable
See also: StackSet
StackCollections.StackVector
— TypeStackVector([itr])
Construct a StackVector
containing up to 64 Bool
values. A StackVector
is stored as an integer in memory and is immutable.
StackCollections.delete
— Functiondelete(s::AbstractStackSet, v::Int)
Return a copy of s
that does not contain without v
.
Examples
julia> s = DigitSet([4, 41, 9]);
julia> delete(s, 1)
DigitSet with 3 elements:
4
9
41
See also: pop
StackCollections.pop
— Functionpop(s::AbstractStackSet, v::Int)
Return a copy of s
without v
. If v
is not in s
, raise an error.
Examples
julia> s = DigitSet([4, 41, 9]);
julia> pop(s, 41)
DigitSet with 2 elements:
4
9
See also: delete
StackCollections.push
— Functionpush(collection, items...)
Return a new collection containing all elements of collection
and of items
. If collection
is ordered, add the new element to the end.
Examples
julia> s = DigitSet([4, 9]);
julia> push(s, 1, 11)
DigitSet with 4 elements:
1
4
9
11
StackCollections.setindex
— Methodsetindex(collection, v, i::Int)
Return a copy of collection
with the value at index i
set to v
.
Examples
julia> x = StackVector([true, false])
2-element StackVector:
1
0
julia> setindex(x, false, 1)
2-element StackVector:
0
0