func (b *OpenBitSet) ensureCapacityWords(numWords int) {
	if len(b.bits) < numWords {
		arr := make([]int64, numWords)
		copy(arr, b.bits)
		b.bits = arr
	}
	b.wlen = numWords
	if n := int64(numWords) << 6; n > b.numBits {
		b.numBits = n
	}
}
/* Expand the []int64 with the size given as a number of words (64 bits long).
package util
import (
	"bytes"
	"fmt"
)
type OpenBitSet struct {
	bits    []int64
	wlen    int    
	numBits int64  
}
func NewOpenBitSetOf(numBits int64) *OpenBitSet {
	assert(numBits > 0)
	bits := make([]int64, bits2words(numBits))
	return &OpenBitSet{
		numBits: numBits,
		bits:    bits,
		wlen:    len(bits),
	}
}
func NewOpenBitSet() *OpenBitSet {
	return NewOpenBitSetOf(64)
}
func (b *OpenBitSet) IsEmpty() bool {
	return b.Cardinality() == 0
}
func (b *OpenBitSet) Get(index int64) bool {
	i := int(index >> 6)  
	if i >= len(b.bits) {
		return false
	}
	bitmask := int64(1) << uint(index&0x3f)
	return (b.bits[i] & bitmask) != 0
}
func (b *OpenBitSet) Set(index int64) {
	wordNum := b.expandingWordNum(index)
	bitmask := int64(1) << uint64(index&0x3f)
	b.bits[wordNum] |= bitmask
}
func (b *OpenBitSet) expandingWordNum(index int64) int {
	wordNum := int(index >> 6)
	if wordNum >= b.wlen {
		b.ensureCapacity(index + 1)
	}
	return wordNum
}
func (b *OpenBitSet) Clear(index int64) {
	wordNum := int(index >> 6)  
	if wordNum >= b.wlen {
		return
	}
	bitmask := int64(1) << uint64(index)
	b.bits[wordNum] &= ^bitmask
}
func (b *OpenBitSet) Cardinality() int64 {
	return int64(pop_array(b.bits[:b.wlen]))
}
func (b *OpenBitSet) NextSetBit(index int64) int64 {
	assert(index >= 0)
	i := int(uint64(index) >> 6)
	if i >= b.wlen {
		return -1
	}
	subIndex := int(index & 0x3f)                       
	word := int64(uint64(b.bits[i]) >> uint(subIndex))  
	if word != 0 {
		return (int64(i) << 6) + int64(subIndex) + int64(NumberOfTrailingZeros(word))
	}
	for i++; i < b.wlen; i++ {
		word = b.bits[i]
		if word != 0 {
			return (int64(i) << 6) + int64(NumberOfTrailingZeros(word))
		}
	}
	return -1
}
func bits2words(numBits int64) int {
	return int((uint64(numBits-1) >> 6) + 1)
}
func (b *OpenBitSet) intersect(other *OpenBitSet) {
	newLen := b.wlen
	if other.wlen < newLen {
		newLen = other.wlen
	}
	thisArr := b.bits
	otherArr := other.bits
	for pos := newLen - 1; pos >= 0; pos-- {
		thisArr[pos] &= otherArr[pos]
	}
	if b.wlen > newLen {
		for i := newLen; i < b.wlen; i++ {
			b.bits[i] = 0
		}
	}
	b.wlen = newLen
}
func (b *OpenBitSet) remove(other *OpenBitSet) {
	idx := b.wlen
	if other.wlen < idx {
		idx = other.wlen
	}
	thisArr := b.bits
	otherArr := other.bits
	for pos := idx - 1; pos >= 0; pos-- {
		thisArr[pos] &= ^otherArr[pos]
	}
}
func (b *OpenBitSet) And(other *OpenBitSet) {
	b.intersect(other)
}
func (b *OpenBitSet) AndNot(other *OpenBitSet) {
	b.remove(other)
}