rand2

package
v0.0.0-...-1f32f52 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2014 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

rand2 is a collection of functions meant to supplement the capabilities provided by the standard "math/rand" package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PickN

func PickN(population []interface{}, n int) (
	picked []interface{}, remaining []interface{}, err error)

Same as 'Sample' except it returns both the 'picked' sample set and the 'remaining' elements.

func Sample

func Sample(population []interface{}, k int) (res []interface{}, err error)

Samples 'k' elements from the given slice

func SampleInts

func SampleInts(n int, k int) (res []int, err error)

Samples 'k' unique ints from the range [0, n)

Types

This section is empty.

Jump to

Keyboard shortcuts

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