Documentation ¶
Index ¶
- func Get[E ~[]T, T any, U typ.Integer](arr E, index U) (ret T, ok bool)
- func GetFunc[E ~[]T, T any](arr E, f func(T) bool) (ret T, ok bool)
- func GetPointer[E ~[]T, T any, U typ.Integer](arr E, index U) *T
- func GetPointerFunc[E ~[]T, T any](arr E, f func(T) bool) *T
- func RandN[E ~[]T, T any](arr E, num int) []T
- func RandOne[E ~[]T, T any](arr E) T
- func RandWeight[E ~[]T, T typ.Integer](weights E) int
- func RandWeightFunc[E ~[]U, U any, T typ.Integer](arr E, getWeight func(i int) T) int
- func Shuffle[E ~[]T, T any](arr E)
- func Sum[E ~[]T, T typ.Number](arr E) T
- func SumFunc[E ~[]V, V any, T typ.Number](arr E, getValue func(i int) T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPointer ¶
func GetPointerFunc ¶
func RandWeight ¶
func RandWeightFunc ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.