@Override protected UpperLowerIndices calculateUpperLower() { int[] upper = Arrays.copyOfRange(data, 0, firstLower); int[] lower = Arrays.copyOfRange(data, firstLower, data.length); return new UpperLowerIndices(upper, lower); }
@Override protected UpperLowerIndices calculateUpperLower() { int upperCount = 0; for (int index : data) if ((index & 0x80000000) == 0x80000000) upperCount++; int[] lower = new int[data.length - upperCount]; int[] upper = new int[upperCount]; int ui = 0, li = 0; for (int index : data) if ((index & 0x80000000) == 0x80000000) upper[ui++] = index; else lower[li++] = index; return new UpperLowerIndices(upper, lower); }
@Override public SimpleIndices getLower() { UpperLowerIndices ul = getUpperLowerIndices(); if (ul.lower.length == 0) return EmptySimpleIndices.EMPTY_SIMPLE_INDICES_INSTANCE; return UnsafeIndicesFactory.createIsolatedUnsafeWithoutSort0(null, ul.lower, new UpperLowerIndices(new int[0], ul.lower)); }
@Override public SimpleIndices getUpper() { UpperLowerIndices ul = getUpperLowerIndices(); if (ul.upper.length == 0) return EmptySimpleIndices.EMPTY_SIMPLE_INDICES_INSTANCE; return UnsafeIndicesFactory.createIsolatedUnsafeWithoutSort0(null, ul.upper, new UpperLowerIndices(ul.upper, new int[0])); }
@Override public Indices getUpper() { UpperLowerIndices ul = getUpperLowerIndices(); if (ul.upper.length == 0) return EmptyIndices.EMPTY_INDICES_INSTANCE; return new SortedIndices(ul.upper, ul.upper.length, new UpperLowerIndices(ul.upper, new int[0])); }
@Override public Indices getLower() { UpperLowerIndices ul = getUpperLowerIndices(); if (ul.lower.length == 0) return EmptyIndices.EMPTY_INDICES_INSTANCE; return new SortedIndices(ul.lower, 0, new UpperLowerIndices(new int[0], ul.lower)); }