(nbits uint)
| 57 | } |
| 58 | |
| 59 | func 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 | |
| 76 | func main() { |
| 77 | flag.Parse() |