Set(S)
sets.spad line 1
[edit on github]
A set over a domain S
models the usual mathematical notion of a finite set of elements from S
. Sets are unordered collections of distinct elements (that is, order and duplication does not matter). The notation set [a, b, c]
can be used to create a set and the usual operations such as union and intersection are available to form new sets. If S
has OrderdSet, FriCAS maintains the entries in sorted order. Specifically, the parts function returns the entries as a list in ascending order and the extract! operation returns the maximum entry. Given two sets s
and t
where #s = m
and #t = n
, the complexity of s = t
is O(min(n, m))
s < t
is O(max(n, m))
union(s, t)
, intersect(s, t)
, minus(s, t)
, symmetricDifference(s, t)
is O(max(n, m))
member?(x, t)
is O(n log n)
insert!(x, t)
and remove!(x, t)
is O(n)
- # : % -> NonNegativeInteger
- from Aggregate
- < : (%, %) -> Boolean
- from PartialOrder
- <= : (%, %) -> Boolean
- from PartialOrder
- = : (%, %) -> Boolean
- from BasicType
- > : (%, %) -> Boolean
- from PartialOrder
- >= : (%, %) -> Boolean
- from PartialOrder
- any? : (Mapping(Boolean, S), %) -> Boolean
- from HomogeneousAggregate(S)
- cardinality : % -> NonNegativeInteger
- from FiniteSetAggregate(S)
- coerce : % -> OutputForm
- from CoercibleTo(OutputForm)
- complement : % -> % if S has Finite
- from FiniteSetAggregate(S)
- construct : List(S) -> %
- from Collection(S)
- convert : % -> InputForm if S has ConvertibleTo(InputForm)
- from ConvertibleTo(InputForm)
- copy : % -> %
- from Aggregate
- count : (S, %) -> NonNegativeInteger
- from HomogeneousAggregate(S)
- count : (Mapping(Boolean, S), %) -> NonNegativeInteger
- from HomogeneousAggregate(S)
- dictionary : () -> %
- from DictionaryOperations(S)
- dictionary : List(S) -> %
- from DictionaryOperations(S)
- difference : (%, %) -> %
- from SetAggregate(S)
- difference : (%, S) -> %
- from SetAggregate(S)
- empty : () -> %
- from Aggregate
- empty? : % -> Boolean
- from Aggregate
- enumerate : () -> List(%) if S has Finite
- from Finite
- eq? : (%, %) -> Boolean
- from Aggregate
- eval : (%, S, S) -> % if S has Evalable(S)
- from InnerEvalable(S, S)
- eval : (%, Equation(S)) -> % if S has Evalable(S)
- from Evalable(S)
- eval : (%, List(S), List(S)) -> % if S has Evalable(S)
- from InnerEvalable(S, S)
- eval : (%, List(Equation(S))) -> % if S has Evalable(S)
- from Evalable(S)
- every? : (Mapping(Boolean, S), %) -> Boolean
- from HomogeneousAggregate(S)
- extract! : % -> S
- from BagAggregate(S)
- find : (Mapping(Boolean, S), %) -> Union(S, "failed")
- from Collection(S)
- hash : % -> SingleInteger if S has Finite
- from Hashable
- hashUpdate! : (HashState, %) -> HashState if S has Finite
- from Hashable
- index : PositiveInteger -> % if S has Finite
- from Finite
- insert! : (S, %) -> %
- from BagAggregate(S)
- inspect : % -> S
- from BagAggregate(S)
- intersect : (%, %) -> %
- from SetAggregate(S)
- latex : % -> String
- from SetCategory
- less? : (%, NonNegativeInteger) -> Boolean
- from Aggregate
- lookup : % -> PositiveInteger if S has Finite
- from Finite
- map : (Mapping(S, S), %) -> %
- from HomogeneousAggregate(S)
- map! : (Mapping(S, S), %) -> %
- from HomogeneousAggregate(S)
- max : % -> S if S has OrderedSet
- from HomogeneousAggregate(S)
- max : (Mapping(Boolean, S, S), %) -> S
- from HomogeneousAggregate(S)
- member? : (S, %) -> Boolean
- from HomogeneousAggregate(S)
- members : % -> List(S)
- from HomogeneousAggregate(S)
- min : % -> S if S has OrderedSet
- from HomogeneousAggregate(S)
- more? : (%, NonNegativeInteger) -> Boolean
- from Aggregate
- parts : % -> List(S)
- from HomogeneousAggregate(S)
- random : () -> % if S has Finite
- from Finite
- reduce : (Mapping(S, S, S), %) -> S
- from Collection(S)
- reduce : (Mapping(S, S, S), %, S) -> S
- from Collection(S)
- reduce : (Mapping(S, S, S), %, S, S) -> S
- from Collection(S)
- remove : (S, %) -> %
- from Collection(S)
- remove : (Mapping(Boolean, S), %) -> %
- from Collection(S)
- remove! : (S, %) -> %
- from DictionaryOperations(S)
- remove! : (Mapping(Boolean, S), %) -> %
- from DictionaryOperations(S)
- removeDuplicates : % -> %
- from Collection(S)
- sample : () -> %
- from Aggregate
- select : (Mapping(Boolean, S), %) -> %
- from Collection(S)
- select! : (Mapping(Boolean, S), %) -> %
- from DictionaryOperations(S)
- set : () -> %
- from SetAggregate(S)
- set : List(S) -> %
- from SetAggregate(S)
- size : () -> NonNegativeInteger if S has Finite
- from Finite
- size? : (%, NonNegativeInteger) -> Boolean
- from Aggregate
- smaller? : (%, %) -> Boolean if S has Comparable
- from Comparable
- subset? : (%, %) -> Boolean
- from SetAggregate(S)
- symmetricDifference : (%, %) -> %
- from SetAggregate(S)
- union : (%, %) -> %
- from SetAggregate(S)
- union : (%, S) -> %
- from SetAggregate(S)
- union : (S, %) -> %
- from SetAggregate(S)
- universe : () -> % if S has Finite
- from FiniteSetAggregate(S)
- ~= : (%, %) -> Boolean
- from BasicType
Comparable
ConvertibleTo(InputForm)
InnerEvalable(S, S)
Aggregate
FiniteSetAggregate(S)
BasicType
DictionaryOperations(S)
PartialOrder
Dictionary(S)
SetCategory
Evalable(S)
HomogeneousAggregate(S)
BagAggregate(S)
Collection(S)
CoercibleTo(OutputForm)
SetAggregate(S)
finiteAggregate
shallowlyMutable
Hashable
Finite