question: public static CompactSketch intersect ( CompactSketch skA , CompactSketch skB ) { final short seedHash = checkOrderedAndSeedHash ( skA , skB ) ; long thetaLong = Math . min ( skA . getThetaLong ( ) , skB . getThetaLong ( ) ) ; int indexA = 0 ; int indexB = 0 ; int outCount = 0 ; long [ ] cacheA = skA . getCache ( ) ; long [ ] cacheB = skB . getCache ( ) ; long [ ] outCache = new long [ Math . min ( cacheA . length , cacheB . length ) ] ; while ( ( indexA < cacheA . length ) && ( indexB < cacheB . length ) ) { long hashA = cacheA [ indexA ] ; long hashB = cacheB [ indexB ] ; if ( hashA >= thetaLong || hashB >= thetaLong ) { break ; } if ( hashA == hashB ) { outCache [ outCount ++ ] = hashA ; ++ indexA ; ++ indexB ; } else if ( hashA < hashB ) { ++ indexA ; } else { ++ indexB ; } } boolean empty = skA . isEmpty ( ) || skB . isEmpty ( ) ; return new HeapCompactOrderedSketch ( Arrays . copyOf ( outCache , outCount ) , empty , seedHash , outCount , thetaLong ) ; }
target:  This implements a stateless, pair-wise intersection operation on ordered, CompactSketches that are either Heap-based or Direct.