Struct sets::RankedSet [−][src]
Expand description
Struct holding an unordered set and a vector of its ranks (ascending or descending).
Fields
ascending: bool
v: Vec<T>
i: Vec<usize>
Implementations
Initialiser, ranks an unordered slice
Initialiser, ranks an unordered Set
From Ordered - the index will be trivial
Converts sort index to ranks
Trait Implementations
Display implemented for struct IndexedSet.
The primitive functions from indxvec
all expect indexed sets,
so for now we convert from ranks to sort indices using .invindex()
.
Even though that is a simple operation, for lots of set operations,
it will be slightly quicker to work in IndexedSet(s)
and only to rank the final result.
deletes repetitions.
Intersection of two IndexedSets
Complement of s in self (i.e. self-s)
For lots of set operations, it is probably better to work in IndexedSet(s) and then only to rank the final result.
switches between ascending and descending ranks, which is what is logically expected here but it is not the same as a literal reversal of the ranks!
Finds minimum, minimum’s first index, maximum, maximum’s first index
Union of two RankedSets. Returns an OrderedSet
Intersection of two RankedSets.
Via OrderedSet for convenience, for now.
Todo: Probably should use intersect_indexed as in union
above.
Complement of s in self (i.e. self-s)