Documentation ¶
Overview ¶
package partialord allows one to define partial orderings, and derive a total ordering
Index ¶
- type PartialOrdering
- func (ord *PartialOrdering) After(A string, B string)
- func (ord *PartialOrdering) Before(A string, B string)
- func (ord *PartialOrdering) FirstElements(elems ...string)
- func (ord *PartialOrdering) LastElements(elems ...string)
- func (ord *PartialOrdering) Sequence(seq ...string)
- func (ord *PartialOrdering) TotalOrdering() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PartialOrdering ¶
type PartialOrdering struct {
// contains filtered or unexported fields
}
func NewPartialOrdering ¶
func NewPartialOrdering(elements []string) PartialOrdering
NewPartialOrdering creates a new partial ordering over the set of provided elements.
func (*PartialOrdering) After ¶
func (ord *PartialOrdering) After(A string, B string)
After marks that A should come after B
func (*PartialOrdering) Before ¶
func (ord *PartialOrdering) Before(A string, B string)
After marks that A should come before B
func (*PartialOrdering) FirstElements ¶
func (ord *PartialOrdering) FirstElements(elems ...string)
Sets elems to be the first elements in the ordering. So if were making an ordering over {A, B, C, D, E}, and elems provided is {D, B, A} then we are guaranteed that the total ordering will begin with {D, B, A}
func (*PartialOrdering) LastElements ¶
func (ord *PartialOrdering) LastElements(elems ...string)
Sets elems to be the last elements in the ordering. So if were making an ordering over {A, B, C, D, E}, and elems provided is {D, B, A} then we are guaranteed that the total ordering will end with {D, B, A}
func (*PartialOrdering) Sequence ¶
func (ord *PartialOrdering) Sequence(seq ...string)
Sequence sets a sequence of ordering constraints. So if were making an ordering over {A, B, C, D, E}, and elems provided is {D, B, A} then we are guaranteed that the total ordering will have D comes before B comes before A. (They're may be elements interspersed, e.g. {D, C, E, B, A} is a valid ordering)
func (*PartialOrdering) TotalOrdering ¶
func (ord *PartialOrdering) TotalOrdering() []string
TotalOrdering returns a deterministically chosen total ordering that satisfies all specified partial ordering constraints.
Panics if no total ordering exists.