in Java/core/src/main/java/com/amazon/randomcutforest/tree/NodeStoreLarge.java [47:89]
public NodeStoreLarge(AbstractNodeStore.Builder builder) {
super(builder);
mass = new int[capacity];
Arrays.fill(mass, 0);
if (builder.storeParent) {
parentIndex = new int[capacity];
Arrays.fill(parentIndex, capacity);
} else {
parentIndex = null;
}
if (builder.leftIndex == null) {
leftIndex = new int[capacity];
rightIndex = new int[capacity];
cutDimension = new int[capacity];
Arrays.fill(leftIndex, capacity);
Arrays.fill(rightIndex, capacity);
} else {
leftIndex = Arrays.copyOf(builder.leftIndex, builder.leftIndex.length);
rightIndex = Arrays.copyOf(builder.rightIndex, builder.rightIndex.length);
cutDimension = Arrays.copyOf(builder.cutDimension, builder.cutDimension.length);
BitSet bits = new BitSet(capacity);
if (builder.root != Null) {
bits.set(builder.root);
}
for (int i = 0; i < leftIndex.length; i++) {
if (isInternal(leftIndex[i])) {
bits.set(leftIndex[i]);
if (parentIndex != null) {
parentIndex[leftIndex[i]] = i;
}
}
}
for (int i = 0; i < rightIndex.length; i++) {
if (isInternal(rightIndex[i])) {
bits.set(rightIndex[i]);
if (parentIndex != null) {
parentIndex[rightIndex[i]] = i;
}
}
}
freeNodeManager = new IndexIntervalManager(capacity, capacity, bits);
}
}