srand

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get[E ~[]T, T any, U typ.Integer](arr E, index U) (ret T, ok bool)

func GetFunc

func GetFunc[E ~[]T, T any](arr E, f func(T) bool) (ret T, ok bool)

func GetPointer

func GetPointer[E ~[]T, T any, U typ.Integer](arr E, index U) *T

func GetPointerFunc

func GetPointerFunc[E ~[]T, T any](arr E, f func(T) bool) *T

func RandN

func RandN[E ~[]T, T any](arr E, num int) []T

func RandOne

func RandOne[E ~[]T, T any](arr E) T

func RandWeight

func RandWeight[E ~[]T, T typ.Integer](weights E) int

func RandWeightFunc

func RandWeightFunc[E ~[]U, U any, T typ.Integer](arr E, getWeight func(i int) T) int

func Shuffle

func Shuffle[E ~[]T, T any](arr E)

func Sum

func Sum[E ~[]T, T typ.Number](arr E) T

func SumFunc

func SumFunc[E ~[]V, V any, T typ.Number](arr E, getValue func(i int) T) T

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL