public ArrayVariable(string name, StackFrame stackFrame, TargetArrayObject obj) { this.name = name; this.stackFrame = stackFrame; this.obj = obj; universalSubset = new ArraySubsetVariable(stackFrame, obj, new int[0]); }
AbstractVariable[] GetChildNodes() { long childCount = (long)endIndex - (long)startIndex + 1; if (childCount <= SubsetMaximalSize) { // Return array of all childs AbstractVariable[] childs = new AbstractVariable[childCount]; for (int i = 0; i < childCount; i++) { childs[i] = GetChildNode(startIndex + i); } return(childs); } else { // Subdivide to smaller groups long groupSize = SubsetOptimalSize; // The number of groups must not be too big either // Increase groupSize if necessary long groupCount; while (true) { groupCount = ((childCount - 1) / groupSize) + 1; // Round up if (groupCount <= SubsetMaximalSize) { break; } else { groupSize *= SubsetOptimalSize; } } // Return the smaller groups AbstractVariable[] childs = new AbstractVariable[groupCount]; for (int i = 0; i < groupCount; i++) { long start = startIndex + i * groupSize; long end = System.Math.Min(upperBound, start + groupSize - 1); childs[i] = new ArraySubsetVariable(stackFrame, obj, indicesPefix, (int)start, (int)end); } return(childs); } }
AbstractVariable[] GetChildNodes() { long childCount = (long)endIndex - (long)startIndex + 1; if (childCount <= SubsetMaximalSize) { // Return array of all childs AbstractVariable[] childs = new AbstractVariable[childCount]; for(int i = 0; i < childCount; i++) { childs[i] = GetChildNode(startIndex + i); } return childs; } else { // Subdivide to smaller groups long groupSize = SubsetOptimalSize; // The number of groups must not be too big either // Increase groupSize if necessary long groupCount; while(true) { groupCount = ((childCount - 1) / groupSize) + 1; // Round up if (groupCount <= SubsetMaximalSize) { break; } else { groupSize *= SubsetOptimalSize; } } // Return the smaller groups AbstractVariable[] childs = new AbstractVariable[groupCount]; for(int i = 0; i < groupCount; i++) { long start = startIndex + i * groupSize; long end = System.Math.Min(upperBound, start + groupSize - 1); childs[i] = new ArraySubsetVariable(stackFrame, obj, indicesPefix, (int)start, (int)end); } return childs; } }