func (s *Store6) Find(sig uint64) []uint64 {

	// empty store
	if len(s.docids) == 0 {
		return nil
	}

	var ids []uint64

	// TODO(dgryski): search in parallel

	t := 0

	var p uint64

	for i := 0; i < 6; i++ {
		p = sig
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff80007fffffffff) | (sig & 0x007f800000000000 >> 8) | (sig & 0x00007f8000000000 << 8)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff807f807fffffff) | (sig & 0x007f800000000000 >> 16) | (sig & 0x0000007f80000000 << 16)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff807fff807fffff) | (sig & 0x007f800000000000 >> 24) | (sig & 0x000000007f800000 << 24)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff807fffff807fff) | (sig & 0x007f800000000000 >> 32) | (sig & 0x00000000007f8000 << 32)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff807fffffff807f) | (sig & 0x007f800000000000 >> 40) | (sig & 0x0000000000007f80 << 40)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff80ffffffffff80) | (sig & 0x007f000000000000 >> 48) | (sig & 0x000000000000007f << 48)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_7, 6), t)...)
		t++
		sig = (sig << 9) | (sig >> (64 - 9))
	}

	p = sig
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc0003fffffffff) | (sig & 0x003fc00000000000 >> 8) | (sig & 0x00003fc000000000 << 8)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc03fc03fffffff) | (sig & 0x003fc00000000000 >> 16) | (sig & 0x0000003fc0000000 << 16)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc03fffc03fffff) | (sig & 0x003fc00000000000 >> 24) | (sig & 0x000000003fc00000 << 24)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc03fffffc03fff) | (sig & 0x003fc00000000000 >> 32) | (sig & 0x00000000003fc000 << 32)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc07fffffffc07f) | (sig & 0x003f800000000000 >> 40) | (sig & 0x0000000000003f80 << 40)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_7, 6), t)...)
	t++
	p = (sig & 0xffc07fffffffff80) | (sig & 0x003f800000000000 >> 47) | (sig & 0x000000000000007f << 47)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_7, 6), t)...)
	t++

	ids = unique(ids)

	var docids []uint64
	for _, v := range ids {
		docids = append(docids, s.docids.find(v)...)
	}

	return docids
}
// Find searches the store for all hashes hamming distance 6 or less from the
// query signature.  It returns the associated list of document ids.
Find searches the store for all hashes hamming distance 6 or less from the
query signature.  It returns the associated list of document ids.
// Find searches the store for all hashes hamming distance 6 or less from the // query signature . It returns the associated list of document ids .
func (s *Store6) Find(sig uint64) []uint64 {
	if len(s.docids) == 0 {
		return nil
	}
	var ids []uint64
	t := 0
	var p uint64
	for i := 0; i < 6; i++ {
		p = sig
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff80007fffffffff) | (sig & 0x007f800000000000 >> 8) | (sig & 0x00007f8000000000 << 8)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff807f807fffffff) | (sig & 0x007f800000000000 >> 16) | (sig & 0x0000007f80000000 << 16)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff807fff807fffff) | (sig & 0x007f800000000000 >> 24) | (sig & 0x000000007f800000 << 24)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff807fffff807fff) | (sig & 0x007f800000000000 >> 32) | (sig & 0x00000000007f8000 << 32)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff807fffffff807f) | (sig & 0x007f800000000000 >> 40) | (sig & 0x0000000000007f80 << 40)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_8, 6), t)...)
		t++
		p = (sig & 0xff80ffffffffff80) | (sig & 0x007f000000000000 >> 48) | (sig & 0x000000000000007f << 48)
		ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_9_7, 6), t)...)
		t++
		sig = (sig << 9) | (sig >> (64 - 9))
	}
	p = sig
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc0003fffffffff) | (sig & 0x003fc00000000000 >> 8) | (sig & 0x00003fc000000000 << 8)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc03fc03fffffff) | (sig & 0x003fc00000000000 >> 16) | (sig & 0x0000003fc0000000 << 16)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc03fffc03fffff) | (sig & 0x003fc00000000000 >> 24) | (sig & 0x000000003fc00000 << 24)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc03fffffc03fff) | (sig & 0x003fc00000000000 >> 32) | (sig & 0x00000000003fc000 << 32)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_8, 6), t)...)
	t++
	p = (sig & 0xffc07fffffffc07f) | (sig & 0x003f800000000000 >> 40) | (sig & 0x0000000000003f80 << 40)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_7, 6), t)...)
	t++
	p = (sig & 0xffc07fffffffff80) | (sig & 0x003f800000000000 >> 47) | (sig & 0x000000000000007f << 47)
	ids = append(ids, s.unshuffleList(s.rhashes[t].find(p, mask6_10_7, 6), t)...)
	t++
	ids = unique(ids)
	var docids []uint64
	for _, v := range ids {
		docids = append(docids, s.docids.find(v)...)
	}
	return docids
}
func ( s * Store6 ) Find ( sig uint64 ) [ ] uint64 { if len ( s . docids ) == 0 { return nil } var ids [ ] uint64 t := 0 var p uint64 for i := 0 ; i < 6 ; i ++ { p = sig ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_9_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xff80007fffffffff ) | ( sig & 0x007f800000000000 >> 8 ) | ( sig & 0x00007f8000000000 << 8 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_9_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xff807f807fffffff ) | ( sig & 0x007f800000000000 >> 16 ) | ( sig & 0x0000007f80000000 << 16 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_9_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xff807fff807fffff ) | ( sig & 0x007f800000000000 >> 24 ) | ( sig & 0x000000007f800000 << 24 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_9_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xff807fffff807fff ) | ( sig & 0x007f800000000000 >> 32 ) | ( sig & 0x00000000007f8000 << 32 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_9_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xff807fffffff807f ) | ( sig & 0x007f800000000000 >> 40 ) | ( sig & 0x0000000000007f80 << 40 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_9_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xff80ffffffffff80 ) | ( sig & 0x007f000000000000 >> 48 ) | ( sig & 0x000000000000007f << 48 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_9_7 , 6 ) , t ) ... ) t ++ sig = ( sig << 9 ) | ( sig >> ( 64 - 9 ) ) } p = sig ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_10_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xffc0003fffffffff ) | ( sig & 0x003fc00000000000 >> 8 ) | ( sig & 0x00003fc000000000 << 8 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_10_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xffc03fc03fffffff ) | ( sig & 0x003fc00000000000 >> 16 ) | ( sig & 0x0000003fc0000000 << 16 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_10_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xffc03fffc03fffff ) | ( sig & 0x003fc00000000000 >> 24 ) | ( sig & 0x000000003fc00000 << 24 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_10_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xffc03fffffc03fff ) | ( sig & 0x003fc00000000000 >> 32 ) | ( sig & 0x00000000003fc000 << 32 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_10_8 , 6 ) , t ) ... ) t ++ p = ( sig & 0xffc07fffffffc07f ) | ( sig & 0x003f800000000000 >> 40 ) | ( sig & 0x0000000000003f80 << 40 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_10_7 , 6 ) , t ) ... ) t ++ p = ( sig & 0xffc07fffffffff80 ) | ( sig & 0x003f800000000000 >> 47 ) | ( sig & 0x000000000000007f << 47 ) ids = append ( ids , s . unshuffleList ( s . rhashes [ t ] . find ( p , mask6_10_7 , 6 ) , t ) ... ) t ++ ids = unique ( ids ) var docids [ ] uint64 for _ , v := range ids { docids = append ( docids , s . docids . find ( v ) ... ) } return docids }
Find searches the store for all hashes hamming distance 6 or less from the
query signature.
Find searches the store for all hashes hamming distance 6 or less from the query signature .
// empty store // TODO(dgryski): search in parallel