Documentation
¶
Overview ¶
Package idxsort provides types and functions for sorting sequences via separate indexes.
Index ¶
- func Sort(index sort.Interface, ascending bool, swapFunc func(i, j int))
- func SortAsc(index sort.Interface, swapFunc func(i, j int))
- func SortDesc(index sort.Interface, swapFunc func(i, j int))
- func SortIntStringMap(m map[int]string, ascending bool) (is []int, ss []string)
- func SortStringFloat64Map(m map[string]float64, ascending bool) (ss []string, fs []float64)
- func SortStringInt64Map(m map[string]int64, ascending bool) (ss []string, is []int64)
- func SortStringIntMap(m map[string]int, ascending bool) (ss []string, is []int)
- func SortStringUint64Map(m map[string]uint64, ascending bool) (ss []string, is []uint64)
- type Int64Slice
- type Sorter
- type Uint64Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortIntStringMap ¶
func SortStringFloat64Map ¶
func SortStringInt64Map ¶
func SortStringIntMap ¶
Types ¶
type Int64Slice ¶
type Int64Slice []int64
Int64Slice attaches the methods of Interface to []int64, sorting in increasing order.
func (Int64Slice) Len ¶
func (s Int64Slice) Len() int
func (Int64Slice) Less ¶
func (s Int64Slice) Less(i, j int) bool
func (Int64Slice) Swap ¶
func (s Int64Slice) Swap(i, j int)
type Sorter ¶
type Sorter struct {
// contains filtered or unexported fields
}
Sorter wraps a sequence implementing the sort.Interface interface, supports ascending and descending sort, and duplicates index swaps to other sequences via a swap function.
Methods of Sorter are not safe for concurrent use. The provided index and/or swap functions may also require explicit locking to prevent concurrent access.
Sorter implements the sort.Interface interface.
type Uint64Slice ¶
type Uint64Slice []uint64
Uint64Slice attaches the methods of Interface to []uint64, sorting in increasing order.
func (Uint64Slice) Len ¶
func (s Uint64Slice) Len() int
func (Uint64Slice) Less ¶
func (s Uint64Slice) Less(i, j int) bool
func (Uint64Slice) Swap ¶
func (s Uint64Slice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.