MCPcopy Create free account
hub / github.com/egonelbre/exp / RandomTree

Function RandomTree

physicscompress/optimizer.go:59–74  ·  view source on GitHub ↗
(nbits uint)

Source from the content-addressed store, hash-verified

57}
58
59func RandomTree(nbits uint) (m1 arith.Model, desc string) {
60 x1 := arith.Shift2{
61 P0: arith.P(rand.Intn(arith.MaxP / 2)),
62 I0: byte(rand.Intn(8) + 1),
63 P1: arith.P(rand.Intn(arith.MaxP / 2)),
64 I1: byte(rand.Intn(8) + 1),
65 }
66
67 m1 = arith.NewTree(nbits, func() arith.Model {
68 x := x1
69 return &x
70 })
71
72 desc = fmt.Sprintf("%#v", x1)
73 return
74}
75
76func main() {
77 flag.Parse()

Callers 1

mainFunction · 0.70

Calls 2

PTypeAlias · 0.92
NewTreeFunction · 0.92

Tested by

no test coverage detected