Struct sets::IndexedSet[][src]

pub struct IndexedSet<T> {
    pub ascending: bool,
    pub v: Vec<T>,
    pub i: Vec<usize>,
}
Expand description

Struct holding an unordered set and its sort index. Thus it is an index ordered set (ascending or descending).

Fields

ascending: boolv: Vec<T>i: Vec<usize>

Implementations

Initialiser, indexsorts an unordered slice

Initialiser, indexsorts an unordered Set

From Oredered, the sort index will be trivial

Converts ranks to sort index

Trait Implementations

Display implemented for struct IndexedSet.

Formats the value using the given formatter. Read more

These are generally better than OrderedSet(s) for bulky end types, as there is not so much of moving them around.

just reverse the index

deletes repetitions.

Union of two IndexedSets reassigned to self.
self will be ascending ordered

Intersection of two IndexedSets

Complement of s in self (i.e. self-s)

These are generally better than OrderedSet(s) for bulky end types, as there is not so much of moving them around.

just reverse the index

Deletes repetitions.

Finds minimum, minimum’s first index, maximum, maximum’s first index

True if m is a member of the set

Search a Set for m. Returns index of the first m.

Union of two IndexedSets. Returns an OrderedSet.

Intersection of two sets of the same type. Via OrderedSet for convenience, for now. Probably should use intersect_indexed as in union above.

Complement of s in self (i.e. self-s)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.