Small sets

SmallCollections.SmallSetType
SmallSet{N,T} <: AbstractSmallSet{N,T}

SmallSet{N,T}()
SmallSet{N,T}(itr; unique = itr isa AbstractSet)

An immutable set with element type T that can store up to N entries. All entries come from the iterator itr provided at construction time.

If the element type is omitted, it will be inferred from the iterator, if possible. If unique is set to true, then the elements of itr are assumed to be distinct.

See also AbstractSmallSet, MutableSmallSet.

source
SmallCollections.MutableSmallSetType
MutableSmallSet{N,T} <: AbstractSmallSet{N,T}

MutableSmallSet{N,T}()
MutableSmallSet{N,T}(itr; unique = itr isa AbstractSet)

A set with element type T that can store up to N entries. The set is mutable and implements Julia's set interface.

If the element type is omitted, it will be inferred from the iterator, if possible. If unique is set to true, then the elements of itr are assumed to be distinct.

See also AbstractSmallSet, SmallSet.

source
SmallCollections.capacityMethod
capacity(::Type{<:AbstractSmallSet}) -> Int
capacity(d::AbstractSmallSet) -> Int

Return the largest number of elements the given dictionary type can hold.

source
Base.emptyMethod
empty(d::AbstractSmallDict{N,K,V}) where {N,K,V,W} -> AbstractSmallVector{N,K,V}
empty(d::AbstractSmallDict{N,K,V}, W::Type) where {N,K,V,W} -> AbstractSmallVector{N,K,W}
empty(d::AbstractSmallDict{N,K,V}, L::Type, W::Type) where {N,K,V,L,W} -> AbstractSmallVector{N,L,W}

Return an empty AbstractSmallDictionary with the same capacity as d, and with valtype changed to W and keytype changed to L if so specified. The resulting dictionary is mutable if and only if d is so.

source
Base.valuesMethod
values(s::AbstractSmallSet{N,T}) where {N,T} -> SmallVector{N,T}

Return the values of the set s as a SmallVector.

source
SmallCollections.pushMethod
push(s::AbstractSmallSet{N,T}, xs...) where {N,T} -> Tuple{SmallSet{N,T}, T}

Return the set that is obtained from s by adding the elements given as arguments.

See also Base.push!.

source
SmallCollections.popMethod
pop(s::AbstractSmallSet{N,T}) where {N,T} -> Tuple{SmallSet{N,T}, T}

Remove an element x from s and return the new set together with x. The set s must not be empty.

See also Base.pop!.

source
SmallCollections.popMethod
pop(s::AbstractSmallSet{N,T}, x) where {N,T} -> Tuple{SmallSet{N,T}, T}

Remove the element x from s and return the new set together with the stored element equal to x.

See also Base.pop!, delete.

source
SmallCollections.popMethod
pop(s::AbstractSmallSet{N,T}, x, default::U) where {N,T,U} -> Tuple{SmallSet{N,T}, Union{T,U}}

If s has the element x, remove it and return the new set together with the stored element equal to x. Otherwise return the tuple (SmallSet(d), default).

See also Base.pop!.

source
SmallCollections.deleteMethod
delete(s::AbstractSmallSet{N,T}, x) where {N,T} -> SmallSet{N,T}

Remove the element x from s (if it exists) and return the new set.

See also Base.delete!, pop.

source
SmallCollections.sum_fastMethod
sum_fast(s::AbstractSmallSet{N,T}) where {N,T}

Return the @fastmath sum of the elements of s. Unlike for sum, the return value always is of the element type of s, even for small bit integers.

See also Base.sum, Base.@fastmath.

source
SmallCollections.extrema_fastMethod
extrema_fast(s::AbstractSmallSet; [init])

Return the @fastmath minimum and maximum of the elements of s. The init keyword argument may not be used.

See also Base.extrema, Base.@fastmath.

source
Base.filterMethod
filter(f, v::AbstractSmallSet; [style::MapStyle])
filter!(f, v::MutableSmallSet; [style::MapStyle])

With an AbstractSmallSet s as second argument, these functions accept the additional keyword argument style. If it equals LazyStyle(), then the function f is only evaluated until the result has been determined. For any other value of style, f is evaluated on all elements of s as well as on the default values used for padding. This is often faster for simple functions.

As discussed under MapStyle, the default value for style is based on a list of known functions.

See also SmallCollections.default, SmallCollections.MapStyle.

source