func (b *Bitmap) Set(pos, circPos bi.PosType, colIdx uint32) {
	row := b.Row(circPos)
	colWordIdx := colIdx / BitsPerWord
	curWord := row[colWordIdx]
	if curWord == 0 {
		b.wordPops[circPos]++
	}
	row[colWordIdx] = curWord | (uintptr(1) << (colIdx % BitsPerWord))
	if b.firstPos > pos {
		b.firstPos = pos
	}
	if b.lastPos < pos {
		b.lastPos = pos
	}
}
Set sets a single bit of the bitmap.  (Nothing bad happens if the bit was
already set.)
package circular
import (
	"github.com/grailbio/base/bitset"
	"github.com/grailbio/base/log"
	"github.com/grailbio/base/simd"
	bi "github.com/grailbio/bio/interval"
)
const BitsPerWord = simd.BitsPerWord
func indexNonzeroRev(arr []byte, start, stop int) int {
	nCirc := len(arr)
	mask := nCirc - 1
	offset := start &^ mask
	circPos := start & mask
	circStop := stop & mask
	circPause := circStop
	if circStop > circPos {
		circPause = 0
	}
	for ; ; circPos-- {
		if arr[circPos] != 0 {
			return circPos + offset
		}
		if circPos == circPause {
			if circPos == circStop {
				return stop
			}
			circPos = nCirc
			offset -= nCirc
		}
	}
}
const FirstPosEmpty = bi.PosTypeMax
type Bitmap struct {
	bits []uintptr
	wordPops []byte
	firstPos bi.PosType
	lastPos bi.PosType
	rowWidth bi.PosType
}
func NewBitmap(nCirc, rowWidth bi.PosType) (b Bitmap) {
	if rowWidth > 255 {
		log.Panicf("circular.Bitmap does not support rowWidth > 255")
	}
	if (nCirc & (nCirc - 1)) != 0 {
		log.Panicf("circular.Bitmap requires nCirc to be a power of two")
	}
	b.bits = make([]uintptr, nCirc*rowWidth)
	capacity := nCirc
	if capacity < bi.PosType(simd.BytesPerVec()) {
		capacity = bi.PosType(simd.BytesPerVec())
	}
	b.wordPops = make([]byte, nCirc, capacity)
	b.firstPos = FirstPosEmpty
	b.lastPos = -1
	b.rowWidth = rowWidth
	return
}
func (b *Bitmap) NCirc() bi.PosType {
	return bi.PosType(len(b.wordPops))
}
func (b *Bitmap) FirstPos() bi.PosType {
	return b.firstPos
}
func (b *Bitmap) Row(circPos bi.PosType) []uintptr {
	base := circPos * b.rowWidth
	return b.bits[base : base+b.rowWidth]
}