Documentation
¶
Index ¶
- func Flatten[E any](s [][]E) []E
- type WeightedSlice
- func (s *WeightedSlice[O, W]) Append(object O, weight W)
- func (s *WeightedSlice[O, W]) Len() int
- func (s *WeightedSlice[O, W]) Less(i int, j int) bool
- func (s *WeightedSlice[O, W]) Slice() []O
- func (s *WeightedSlice[O, W]) SortFunc(sortFn func(p sort.Interface)) *WeightedSlice[O, W]
- func (s *WeightedSlice[O, W]) Swap(i int, j int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WeightedSlice ¶
func NewWeightedSlice ¶
func NewWeightedSlice[O any, W cmp.Ordered](objects []O, weights []W) *WeightedSlice[O, W]
func (*WeightedSlice[O, W]) Append ¶
func (s *WeightedSlice[O, W]) Append(object O, weight W)
func (*WeightedSlice[O, W]) Len ¶
func (s *WeightedSlice[O, W]) Len() int
func (*WeightedSlice[O, W]) Slice ¶
func (s *WeightedSlice[O, W]) Slice() []O
func (*WeightedSlice[O, W]) SortFunc ¶
func (s *WeightedSlice[O, W]) SortFunc(sortFn func(p sort.Interface)) *WeightedSlice[O, W]
func (*WeightedSlice[O, W]) Swap ¶
func (s *WeightedSlice[O, W]) Swap(i int, j int)
Click to show internal directories.
Click to hide internal directories.