Follow BLAS.dot pattern to replace intersect, diff with while-loop.