/** * Compute corresponding gray code as v XOR (v >>> 1) * * @param v Value * @return Gray code */ public static long[] grayI(long[] v) { // TODO: copy less long[] t = copy(v); shiftRightI(t, 1); xorI(v, t); return v; }
/** * Cycle a bitstring to the right. * * @param v Bit string * @param shift Number of steps to cycle * @param len Length */ public static long[] cycleRightI(long[] v, int shift, int len) { long[] t = copy(v, len, len - shift); truncateI(t, len); shiftRightI(v, shift); orI(v, t); return v; }
/** * Cycle a bitstring to the right. * * @param v Bit string * @param shift Number of steps to cycle * @param len Length */ public static long[] cycleLeftI(long[] v, int shift, int len) { long[] t = copy(v, len, shift); truncateI(t, len); shiftRightI(v, len - shift); orI(v, t); return v; }
@Override public <N extends AbstractRStarTreeNode<N, E>, E extends SpatialEntry> boolean handleOverflow(AbstractRStarTree<N, E, ?> tree, N node, IndexTreePath<E> path) { final int depthm1 = path.getPathCount() - 1; // No reinsertions at root level if(depthm1 == 0) { return false; } // Earlier reinsertions at the same level if(BitsUtil.capacity(reinsertions) < depthm1) { reinsertions = BitsUtil.copy(reinsertions, depthm1); } if(BitsUtil.get(reinsertions, depthm1)) { return false; } BitsUtil.setI(reinsertions, depthm1); final E entry = path.getEntry(); assert (!entry.isLeafEntry()) : "Unexpected leaf entry"; int[] cands = reinsertStrategy.computeReinserts(node, NodeArrayAdapter.STATIC, entry); if(cands == null || cands.length == 0) { return false; } tree.reInsert(node, path, cands); return true; }
final long[] bits = BitsUtil.copy(hist); BitsUtil.xorI(bits, refl); BitsUtil.cycleRightI(bits, rotation, numdim);
final long[] bits = BitsUtil.copy(hist); BitsUtil.xorI(bits, refl); BitsUtil.cycleRightI(bits, rotation, numdim);
final long[] bits = BitsUtil.copy(hist); BitsUtil.xorI(bits, refl); BitsUtil.cycleRightI(bits, rotation, numdim);
final long[] bits = BitsUtil.copy(hist); BitsUtil.xorI(bits, refl); BitsUtil.cycleRightI(bits, rotation, numdim);