@Override public SimpleIndices getOfType(IndexType type) { int type_ = type.getType() << 24; int i = 0; for (; i < data.length && (data[i] & 0x7F000000) != type_; ++i) ; int start = i; for (; i < data.length && (data[i] & 0x7F000000) == type_; ++i) ; int[] newData; if (start == 0 && i == data.length) newData = data; else newData = Arrays.copyOfRange(data, start, i); return UnsafeIndicesFactory.createIsolatedUnsafeWithoutSort(null, newData); }
@Override public SimpleIndices getFree() { IntArrayList dataList = new IntArrayList(); boolean y; for (int i = 0; i < data.length; i++) { y = true; for (int j = 0; j < data.length; j++) if (i != j && (data[i] ^ data[j]) == 0x80000000) { y = false; break; } if (y) dataList.add(data[i]); } return UnsafeIndicesFactory.createIsolatedUnsafeWithoutSort(null, dataList.toArray()); }
indices[j] = setRawState(getRawStateInt(var.getIndices().get(j)), ig.generate(getType(var.getIndices().get(j)))); varIndices = UnsafeIndicesFactory.createIsolatedUnsafeWithoutSort(null, indices); var = Tensors.setIndices(var, varIndices); __from = Tensors.fieldDerivative(__from, varIndices.getInverted(), i);