SetOfMIntegersInOneToN(m, n)¶
lodof.spad line 1 [edit on github]
SetOfMIntegersInOneToN implements the subsets of M
integers in the interval [1..n]
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- convert: % -> InputForm
from ConvertibleTo InputForm
- delta: (%, PositiveInteger, PositiveInteger) -> NonNegativeInteger
delta(S, k, p)
returns the number of elements ofS
which are strictly betweenp
and thek^
{th} element ofS
.
- elements: % -> List PositiveInteger
elements(S)
returns the list of the elements ofS
in increasing order.
- enumerate: () -> Vector %
enumerate()
returns a vector of all the sets ofM
integers in1..n
.
- hash: % -> SingleInteger
from Hashable
- hashUpdate!: (HashState, %) -> HashState
from Hashable
- incrementKthElement: (%, PositiveInteger) -> Union(%, failed)
incrementKthElement(S, k)
increments thek^
{th} element ofS
, and returns “failed” if the result is not a set ofM
integers in1..n
any more.
- index: PositiveInteger -> %
from Finite
- latex: % -> String
from SetCategory
- lookup: % -> PositiveInteger
from Finite
- member?: (PositiveInteger, %) -> Boolean
member?(p, s)
returnstrue
isp
is ins
,false
otherwise.
- replaceKthElement: (%, PositiveInteger, PositiveInteger) -> Union(%, failed)
replaceKthElement(S, k, p)
replaces thek^
{th} element ofS
byp
, and returns “failed” if the result is not a set ofM
integers in1..n
any more.
- setOfMinN: List PositiveInteger -> %
setOfMinN([a_1, ..., a_m])
returns the set {a_1
, …, a_m}. Error if {a_1
, …, a_m} is not a set ofM
integers in1..n
.
- size: () -> NonNegativeInteger
from Finite
- smaller?: (%, %) -> Boolean
from Comparable