2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// $G $F.go && $L $F.$A && ./$A.out
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// Copyright 2009 The Go Authors. All rights reserved.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// Use of this source code is governed by a BSD-style
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// license that can be found in the LICENSE file.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								package main
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								import (
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									"fmt"
							 | 
						
					
						
							
								
									
										
										
										
											2012-01-26 16:25:07 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									"math"
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									"strconv"
							 | 
						
					
						
							
								
									
										
										
										
											2012-01-30 13:41:38 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									"time"
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const count = 100
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-01-20 14:40:40 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								func P(a []string) string {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									s := "{"
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									for i := 0; i < len(a); i++ {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if i > 0 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											s += ","
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										s += `"` + a[i] + `"`
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									s += "}"
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									return s
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								func main() {
							 | 
						
					
						
							
								
									
										
										
										
											2012-01-30 13:41:38 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									testbasic()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									testfloat()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									testnan()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								func testbasic() {
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									// Test a map literal.
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									mlit := map[string]int{"0": 0, "1": 1, "2": 2, "3": 3, "4": 4}
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									for i := 0; i < len(mlit); i++ {
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										s := string([]byte{byte(i) + '0'})
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mlit[s] != i {
							 | 
						
					
						
							
								
									
										
										
										
											2009-01-15 13:48:11 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mlit[%s] = %d\n", s, mlit[s])
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									mib := make(map[int]bool)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									mii := make(map[int]int)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									mfi := make(map[float32]int)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									mif := make(map[int]float32)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									msi := make(map[string]int)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									mis := make(map[int]string)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									mss := make(map[string]string)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									mspa := make(map[string][]string)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// BUG need an interface map both ways too
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									type T struct {
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										i int64 // can't use string here; struct values are only compared at the top level
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										f float32
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									mipT := make(map[int]*T)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									mpTi := make(map[*T]int)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									mit := make(map[int]T)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									//	mti := make(map[T] int)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									type M map[int]int
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									mipM := make(map[int]M)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									var apT [2 * count]*T
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									for i := 0; i < count; i++ {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										s := strconv.Itoa(i)
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										s10 := strconv.Itoa(i * 10)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										f := float32(i)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										t := T{int64(i), f}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										apT[i] = new(T)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										apT[i].i = int64(i)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										apT[i].f = f
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										apT[2*i] = new(T) // need twice as many entries as we use, for the nonexistence check
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										apT[2*i].i = int64(i)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										apT[2*i].f = f
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										m := M{i: i + 1}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										mib[i] = (i != 0)
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										mii[i] = 10 * i
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										mfi[float32(i)] = 10 * i
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										mif[i] = 10.0 * f
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										mis[i] = s
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										msi[s] = i
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										mss[s] = s10
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										mss[s] = s10
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										as := make([]string, 2)
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										as[0] = s10
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										as[1] = s10
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										mspa[s] = as
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										mipT[i] = apT[i]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										mpTi[apT[i]] = i
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										mipM[i] = m
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										mit[i] = t
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										//	mti[t] = i
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// test len
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mib) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mib) = %d\n", len(mib))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mii) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mii) = %d\n", len(mii))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mfi) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mfi) = %d\n", len(mfi))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mif) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mif) = %d\n", len(mif))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(msi) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(msi) = %d\n", len(msi))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mis) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mis) = %d\n", len(mis))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mss) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mss) = %d\n", len(mss))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mspa) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mspa) = %d\n", len(mspa))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mipT) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mipT) = %d\n", len(mipT))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mpTi) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mpTi) = %d\n", len(mpTi))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									//	if len(mti) != count {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									//		fmt.Printf("len(mti) = %d\n", len(mti))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									//	}
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if len(mipM) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mipM) = %d\n", len(mipM))
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									//	if len(mti) != count {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									//		fmt.Printf("len(mti) = %d\n", len(mti))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									//	}
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									if len(mit) != count {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										fmt.Printf("len(mit) = %d\n", len(mit))
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-19 03:05:37 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// test construction directly
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									for i := 0; i < count; i++ {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										s := strconv.Itoa(i)
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										s10 := strconv.Itoa(i * 10)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										f := float32(i)
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										// BUG m := M(i, i+1)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if mib[i] != (i != 0) {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mib[%d] = %t\n", i, mib[i])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mii[i] != 10*i {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mii[%d] = %d\n", i, mii[i])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mfi[f] != 10*i {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mfi[%d] = %d\n", i, mfi[f])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mif[i] != 10.0*f {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mif[%d] = %g\n", i, mif[i])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mis[i] != s {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mis[%d] = %s\n", i, mis[i])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if msi[s] != i {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("msi[%s] = %d\n", s, msi[s])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mss[s] != s10 {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mss[%s] = %g\n", s, mss[s])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2009-10-09 11:18:32 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										for j := 0; j < len(mspa[s]); j++ {
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											if mspa[s][j] != s10 {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("mspa[%s][%d] = %s\n", s, j, mspa[s][j])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mipT[i].i != int64(i) || mipT[i].f != f {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mipT[%d] = %v\n", i, mipT[i])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mpTi[apT[i]] != i {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mpTi[apT[%d]] = %d\n", i, mpTi[apT[i]])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										//	if(mti[t] != i) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//		fmt.Printf("mti[%s] = %s\n", s, mti[t])
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//	}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if mipM[i][i] != i+1 {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mipM[%d][%d] = %d\n", i, i, mipM[i][i])
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										//	if(mti[t] != i) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//		fmt.Printf("mti[%v] = %d\n", t, mti[t])
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//	}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if mit[i].i != int64(i) || mit[i].f != f {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("mit[%d] = {%d %g}\n", i, mit[i].i, mit[i].f)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// test existence with tuple check
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// failed lookups yield a false value for the boolean.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									for i := 0; i < count; i++ {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										s := strconv.Itoa(i)
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										f := float32(i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mib[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mib[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mib[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mib[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mii[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mii[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mii[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mii[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mfi[f]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mfi[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mfi[f]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mfi[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mif[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mif[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mif[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mif[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mis[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mis[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mis[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mis[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := msi[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: msi[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = msi[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: msi[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mss[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mss[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mss[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mss[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mspa[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mspa[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mspa[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mspa[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mipT[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mipT[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mipT[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mipT[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mpTi[apT[i]]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mpTi[apT[%d]]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mpTi[apT[i]]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mpTi[apT[%d]]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mipM[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mipM[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mipM[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mipM[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mit[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence decl: mit[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mit[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											if !b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple existence assign: mit[%d]\n", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										//		{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			_, b := mti[t]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			if !b {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//				fmt.Printf("tuple existence decl: mti[%d]\n", i)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			_, b = mti[t]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			if !b {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//				fmt.Printf("tuple existence assign: mti[%d]\n", i)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//		}
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// test nonexistence with tuple check
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// failed lookups yield a false value for the boolean.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									for i := count; i < 2*count; i++ {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										s := strconv.Itoa(i)
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										f := float32(i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mib[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mib[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mib[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mib[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mii[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mii[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mii[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mii[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mfi[f]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mfi[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mfi[f]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mfi[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mif[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mif[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mif[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mif[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mis[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mis[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mis[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mis[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := msi[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: msi[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = msi[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: msi[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mss[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mss[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mss[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mss[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mspa[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mspa[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mspa[s]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mspa[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mipT[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mipT[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mipT[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mipT[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mpTi[apT[i]]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mpTi[apt[%d]]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mpTi[apT[i]]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mpTi[apT[%d]]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mipM[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mipM[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mipM[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mipM[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										//		{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			_, b := mti[t]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			if b {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//				fmt.Printf("tuple nonexistence decl: mti[%d]", i)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			_, b = mti[t]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			if b {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//				fmt.Printf("tuple nonexistence assign: mti[%d]", i)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//			}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										//		}
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b := mit[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence decl: mit[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											_, b = mit[i]
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											if b {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
												fmt.Printf("tuple nonexistence assign: mit[%d]", i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-19 03:05:37 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// tests for structured map element updates
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									for i := 0; i < count; i++ {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										s := strconv.Itoa(i)
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										mspa[s][i%2] = "deleted"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if mspa[s][i%2] != "deleted" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("update mspa[%s][%d] = %s\n", s, i%2, mspa[s][i%2])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										mipT[i].i += 1
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mipT[i].i != int64(i)+1 {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("update mipT[%d].i = %d\n", i, mipT[i].i)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										mipT[i].f = float32(i + 1)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if mipT[i].f != float32(i+1) {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("update mipT[%d].f = %g\n", i, mipT[i].f)
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-20 16:07:43 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										mipM[i][i]++
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if mipM[i][i] != (i+1)+1 {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("update mipM[%d][%d] = %i\n", i, i, mipM[i][i])
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-15 12:42:24 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-23 18:32:37 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									// test range on nil map
							 | 
						
					
						
							
								
									
										
										
										
											2011-01-19 23:09:00 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									var mnil map[string]int
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-15 12:42:24 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									for _, _ = range mnil {
							 | 
						
					
						
							
								
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										panic("range mnil")
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-23 18:32:37 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2012-01-26 16:25:07 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								func testfloat() {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// Test floating point numbers in maps.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// Two map keys refer to the same entry if the keys are ==.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// The special cases, then, are that +0 == -0 and that NaN != NaN.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										var (
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											pz   = float32(0)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nz   = math.Float32frombits(1 << 31)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nana = float32(math.NaN())
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nanb = math.Float32frombits(math.Float32bits(nana) ^ 2)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m := map[float32]string{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											pz:   "+0",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nana: "NaN",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nanb: "NaN",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if m[pz] != "+0" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float32 map cannot read back m[+0]:", m[pz])
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if m[nz] != "+0" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float32 map does not treat", pz, "and", nz, "as equal for read")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float32 map does not treat -0 and +0 as equal for read")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nz] = "-0"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if m[pz] != "-0" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float32 map does not treat -0 and +0 as equal for write")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if _, ok := m[nana]; ok {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float32 map allows NaN lookup (a)")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if _, ok := m[nanb]; ok {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float32 map allows NaN lookup (b)")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if len(m) != 3 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float32 map should have 3 entries:", m)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nana] = "NaN"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nanb] = "NaN"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if len(m) != 5 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float32 map should have 5 entries:", m)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										var (
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											pz   = float64(0)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nz   = math.Float64frombits(1 << 63)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nana = float64(math.NaN())
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nanb = math.Float64frombits(math.Float64bits(nana) ^ 2)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m := map[float64]string{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											pz:   "+0",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nana: "NaN",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nanb: "NaN",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if m[nz] != "+0" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float64 map does not treat -0 and +0 as equal for read")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nz] = "-0"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if m[pz] != "-0" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float64 map does not treat -0 and +0 as equal for write")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if _, ok := m[nana]; ok {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float64 map allows NaN lookup (a)")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if _, ok := m[nanb]; ok {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float64 map allows NaN lookup (b)")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if len(m) != 3 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float64 map should have 3 entries:", m)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nana] = "NaN"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nanb] = "NaN"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if len(m) != 5 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("float64 map should have 5 entries:", m)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										var (
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											pz   = complex64(0)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nz   = complex(0, math.Float32frombits(1<<31))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nana = complex(5, float32(math.NaN()))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nanb = complex(5, math.Float32frombits(math.Float32bits(float32(math.NaN()))^2))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m := map[complex64]string{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											pz:   "+0",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nana: "NaN",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nanb: "NaN",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if m[nz] != "+0" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex64 map does not treat -0 and +0 as equal for read")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nz] = "-0"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if m[pz] != "-0" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex64 map does not treat -0 and +0 as equal for write")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if _, ok := m[nana]; ok {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex64 map allows NaN lookup (a)")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if _, ok := m[nanb]; ok {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex64 map allows NaN lookup (b)")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if len(m) != 3 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex64 map should have 3 entries:", m)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nana] = "NaN"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nanb] = "NaN"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if len(m) != 5 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex64 map should have 5 entries:", m)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										var (
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											pz   = complex128(0)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nz   = complex(0, math.Float64frombits(1<<63))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nana = complex(5, float64(math.NaN()))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nanb = complex(5, math.Float64frombits(math.Float64bits(float64(math.NaN()))^2))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m := map[complex128]string{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											pz:   "+0",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nana: "NaN",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											nanb: "NaN",
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if m[nz] != "+0" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex128 map does not treat -0 and +0 as equal for read")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nz] = "-0"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if m[pz] != "-0" {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex128 map does not treat -0 and +0 as equal for write")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if _, ok := m[nana]; ok {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex128 map allows NaN lookup (a)")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if _, ok := m[nanb]; ok {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex128 map allows NaN lookup (b)")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if len(m) != 3 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex128 map should have 3 entries:", m)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nana] = "NaN"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m[nanb] = "NaN"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if len(m) != 5 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Println("complex128 map should have 5 entries:", m)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2008-08-11 13:32:13 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							
								
									
										
										
										
											2012-01-30 13:41:38 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								func testnan() {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// Test that NaNs in maps don't go quadratic.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									t := func(n int) time.Duration {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										t0 := time.Now()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										m := map[float64]int{}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										nan := math.NaN()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										for i := 0; i < n; i++ {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											m[nan] = 1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if len(m) != n {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											panic("wrong size map after nan insertion")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										return time.Since(t0)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2012-02-02 11:49:28 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									// Depending on the machine and OS, this test might be too fast
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// to measure with accurate enough granularity. On failure,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// make it run longer, hoping that the timing granularity
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// is eventually sufficient.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									n := 30000 // 0.02 seconds on a MacBook Air
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									fails := 0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									for {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										t1 := t(n)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										t2 := t(2 * n)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										// should be 2x (linear); allow up to 3x
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if t2 < 3*t1 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											return
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										fails++
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if fails == 4 {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											fmt.Printf("too slow: %d inserts: %v; %d inserts: %v\n", n, t1, 2*n, t2)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											return
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										n *= 2
							 | 
						
					
						
							
								
									
										
										
										
											2012-01-30 13:41:38 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 |