Пример #1
0
func Test_AgainstTriple(t *testing.T) {
	m := make(map[Triple]Triple)
	for i := byte(0); i < 64; i++ {
		t := Triple{i}
		tc := t.ToCanonical()
		gc := FromDenseGraph(t.ToDenseGraph().ToCanonical())
		if val, ok := m[tc]; ok {
			if val != gc {
				p(t, tc, gc, val)
			}
		} else {
			m[tc] = gc
		}
	}
	for k, v := range m {
		if k != v {
			p(k, v)
		}
	}
}
Пример #2
0
func Test_triple(t *testing.T) {
	tcnt := make(map[Triple]int)
	for i := byte(0); i < 64; i++ {
		t := Triple{i}
		tcnt[t.ToCanonical()]++
		if t != t.ToCanonical() {
			//p(t, t.ToCanonical())
		}
	}
	s := make(TripleSlice, 0, len(tcnt))
	cs := make([]int, 0, len(tcnt))
	for t, c := range tcnt {
		s = append(s, t)
		cs = append(cs, c)
	}
	sort.Sort(s)
	/*
		for i := range s {
			p(s[i], cs[i])
		}
		p(len(s))
	*/
}