Documentation
¶
Overview ¶
Package index.
Index ¶
- func AllArrays(k int) <-chan Array
- func AllEven(k int) <-chan Array
- func AllOdd(k int) <-chan Array
- func CyclicInequivalent(k int) <-chan Array
- func ReflectionCyclicInequivalent(k int) <-chan Array
- type Array
- func (a Array) AllAntiCycles() <-chan Array
- func (a Array) AllCycles() <-chan Array
- func (a Array) AntiCycle()
- func (a Array) Clone() Array
- func (a Array) Cycle()
- func (a Array) Inversions() int64
- func (a Array) IsEqualTo(b Array) bool
- func (a Array) Len() int
- func (a Array) Reverse()
- func (a Array) Shuffle()
- func (a Array) Sign() int
- func (a Array) Sort() Array
- func (a Array) String() string
- func (a Array) Swap(i, j int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllEven ¶
AllEven function returns a channel receiving all of the index arrays of a given length with an even number of inversions.
func AllOdd ¶
AllOdd function returns a channel receiving all of the index arrays of a given length with an odd number of inversions.
func CyclicInequivalent ¶
CyclicInequivalent function returns a channel that receives all of the cyclic-inequivalent index arrays of a given length.
func ReflectionCyclicInequivalent ¶
ReflectionCyclicInequivalent function returns a channel that receives all of the mirror- and cyclic-inequivalent index arrays of a given length.
Types ¶
type Array ¶
type Array []int
Array type represents an array of distinct integers.
func IdentityArray ¶
IdentityArray function returns an ordered index array of a given length.
func (Array) AllAntiCycles ¶
AllAntiCycles method returns a channel that receives all of the anticycles of a given index array.
func (Array) AllCycles ¶
AllCycles method returns a channel that receives all of the cycles of a given index array.
func (Array) AntiCycle ¶
func (a Array) AntiCycle()
AntiCycle method performs an in-place left cyclic shift on a given index array.
func (Array) Cycle ¶
func (a Array) Cycle()
Cycle method performs an in-place right cyclic shift on a given index array.
func (Array) Inversions ¶
Inversions method returns the number of inversions in a given index array.
func (Array) Reverse ¶
func (a Array) Reverse()
Reverse method performs an in-place mirror reflection on a given index array.
func (Array) Shuffle ¶
func (a Array) Shuffle()
Shuffle method performs an in-place Fisher-Yates shuffle on a given index array.
func (Array) Sign ¶
Sign method returns 1 if a given index array has an even number of inversions, -1 otherwise.