Documentation
¶
Overview ¶
The alias package picks items from a discrete distribution efficiently using the alias method.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alias ¶
type Alias struct {
// contains filtered or unexported fields
}
func New ¶
Create a new alias object. For example,
var v = alias.New([]float64{8,10,2})
creates an alias that returns 0 40% of the time, 1 50% of the time, and 2 10% of the time.
func (*Alias) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaller.
func (*Alias) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaller.
Click to show internal directories.
Click to hide internal directories.