Compare
How two values of a partially ordered type compare: -1, 0 or 1, or NaN when they are incomparable.
Compare(a, b)How two values of a partially ordered type compare: -1, 0 or 1, or NaN when they are incomparable.Typed signatures
| Type | Package | Applies |
|---|---|---|
(any, any) -> unknown | structures | always |
Details
- The
PartialOrderprotocol's member: a type conforms by saying how it compares two of its values. - Reflexive, antisymmetric and transitive; a
LinearOrdernever answers NaN. - Under dominance, and are incomparable: NaN.
- Set partitions of one ground set under refinement (finer is lower): NaN unless one refines the other.
- Permutations of one length under the right weak order, as Sage's
permutohedron_lequal(defaultside="right"): p is below q when every inversion of p, a pair of values a < b with b first, is one of q's. The left order is this one on inverses.
Examples
Properties #
The all-singletons partition refines every partition of its set
live ↗InOut
Known value · Sage SetPartition refinement
Right weak order, as Sage's permutohedron_lequal: the inversion pairs of values lie inside
InOut
Known value · Sage permutohedron_lequal
About
| Examples | 7 |
|---|
See also: Min, Max, GreatestLowerBound