Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sampler ¶
type Sampler struct {
// contains filtered or unexported fields
}
Sampler is a sampler that randomly generates test samples of the parity function. this is to be used together with the FunBool type to generate a function to see how well the SPSO optimisers perform when searching for a boolean dag to represent the the parity checker.
func NewSampler ¶
NewSampler creates an instance of the parity sampler for inputSize bits.
Example ¶
p := NewSampler(4) x := big.NewInt(0) y := big.NewInt(0) fmt.Printf("About:\n%s\n", p.About()) rnd := rand.New(rand.NewSource(3142)) for i := 0; i < 16; i++ { p.Sample(x, y, rnd) fmt.Printf("%b => %b\n", x, y) }
Output:
func (*Sampler) OutputSize ¶
OutputSize gives the output size in bits, which in this case is 1.
Click to show internal directories.
Click to hide internal directories.