mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
669 B
42 lines
669 B
7 years ago
|
package roaring
|
||
|
|
||
|
func popcntSliceGo(s []uint64) uint64 {
|
||
|
cnt := uint64(0)
|
||
|
for _, x := range s {
|
||
|
cnt += popcount(x)
|
||
|
}
|
||
|
return cnt
|
||
|
}
|
||
|
|
||
|
func popcntMaskSliceGo(s, m []uint64) uint64 {
|
||
|
cnt := uint64(0)
|
||
|
for i := range s {
|
||
|
cnt += popcount(s[i] &^ m[i])
|
||
|
}
|
||
|
return cnt
|
||
|
}
|
||
|
|
||
|
func popcntAndSliceGo(s, m []uint64) uint64 {
|
||
|
cnt := uint64(0)
|
||
|
for i := range s {
|
||
|
cnt += popcount(s[i] & m[i])
|
||
|
}
|
||
|
return cnt
|
||
|
}
|
||
|
|
||
|
func popcntOrSliceGo(s, m []uint64) uint64 {
|
||
|
cnt := uint64(0)
|
||
|
for i := range s {
|
||
|
cnt += popcount(s[i] | m[i])
|
||
|
}
|
||
|
return cnt
|
||
|
}
|
||
|
|
||
|
func popcntXorSliceGo(s, m []uint64) uint64 {
|
||
|
cnt := uint64(0)
|
||
|
for i := range s {
|
||
|
cnt += popcount(s[i] ^ m[i])
|
||
|
}
|
||
|
return cnt
|
||
|
}
|