These operations make use of the ordering of the bag, as determined by its comparison function. They are not defined on CHAMP bags.
If s contains x, returns the rank of x in the ordering defined by the comparison
function of s, and a true second value. If x is not in the bag, the second value is
false, and the first value is the rank that x would have if it were added. Note that if there
are values that are unequal but equivalent to x, an arbitrary order will be imposed on them
for this purpose; but another collection that is equal? but not eq to this one will in
general order them differently. Multiplicities are ignored for this purpose. O(log n).
Returns the element whose rank is rank. rank must be in [0 .. size(m)). Note
that if there are values that are unequal but equivalent in s, an arbitrary order will be
imposed on them for this purpose; but another collection that is equal? but not eq to
this one will in general order them differently. Multiplicities are ignored for this purpose.
O(log n).
If s is nonempty, returns the element at rank 0 and a true second value; otherwise, nil
and false.
If s is nonempty, returns the element with the largest rank and a true second value;
otherwise, nil and false.
Returns the subbag of s with elements greater than or equal to x. O(log n).
Returns the subbag of s with elements strictly greater than x. O(log n) in general;
O(1) if x is the result of (arb s).
Returns the subbag of s with elements less than or equal to x. O(log n).
Returns the subbag of s with elements strictly less than x. O(log n) in general;
O(1) if x is the result of (arb s).