计算偏移位置
@param numLabels 标记个数
328592
public void calc(int numLabels){
		//计算最大阶
		int numTemplets = size();
		this.orders = new int[numTemplets];
		for(int j=0; j<numTemplets; j++) {
			Templet t = get(j);
			this.orders[j] = t.getOrder();
			if (orders[j] > maxOrder)
				maxOrder = orders[j];
		}
		
		base = new int[maxOrder+2];
		base[0]=1;
		for(int i=1; i<base.length; i++) {
			base[i]=base[i-1]*numLabels;
		}
		this.numStates = base[maxOrder+1];
		offset = new int[numTemplets][numStates];
		
		for(int t=0; t<numTemplets; t++) {
			Templet tpl =  this.get(t);
			int[] vars = tpl.getVars();
			/**
			 * 记录每一阶的状态
			 */
			int[] bits = new int[maxOrder+1];
			int v;
			for(int s=0; s<numStates; s++) {
				int d = s;
				//对于一个n阶状态组合，计算每个成员状态
				for(int i=0; i<maxOrder+1; i++) {
					bits[i] = d%numLabels;
					d = d/numLabels;
				}
				//对于一个n阶状态组合，记录一个特征模板映射到特征空间中到基地址的偏移
				//TODO 是否可以和上面合并简化
				v = 0;						
				for(int i=0; i<vars.length; i++) {
					v = v*numLabels + bits[-vars[i]];
				}
				offset[t][s] = v;
			}
		}
	}
314681
static final void validateValues(final float[] values) {
    for (int i = 0; i < values.length ; i++) {
      if (Float.isNaN(values[i])) {
        throw new SketchesArgumentException("Values must not be NaN");
      }
      if ((i < (values.length - 1)) && (values[i] >= values[i + 1])) {
        throw new SketchesArgumentException(
          "Values must be unique and monotonically increasing");
      }
    }
  }
143660
@NullSafe
  public static int sum(final int... numbers) {
    int sum = 0;

    if (numbers != null) {
      for (int number : numbers) {
        sum += number;
      }
    }

    return sum;
  }
549346
public void setDelHints(String delHints) {
    if (delHints == null || delHints.isEmpty()) {
      throw new IllegalArgumentException("DelHints is empty");
    }
    this.delHints = delHints;
  }
1364433
public void setArrayValues(java.util.Collection<Value> arrayValues) {
        if (arrayValues == null) {
            this.arrayValues = null;
            return;
        }

        this.arrayValues = new java.util.ArrayList<Value>(arrayValues);
    }
1364239
@Pure
	public static int min(int... values) {
		if (values == null || values.length == 0) {
			return 0;
		}
		int min = values[0];
		for (final int v : values) {
			if (v < min) {
				min = v;
			}
		}
		return min;
	}
756496
protected void doSetAllValues( Map<? extends String, ?> values ) {
        if (values != null) {
            document.putAll(Utility.unwrapValues(values));
        }
    }
966239
public void addAll(O... objects) throws ParameterException {
		Validate.notNull(objects);
		for (O o : objects) {
			incMultiplicity(o);
		}
	}
1285744
public void defineInputs(int numInputs) {
        Preconditions.checkArgument(numInputs > 0, "Number of inputs must be > 0: Got %s", numInputs);
        String[] inputNames = new String[numInputs];
        for (int i = 0; i < numInputs; i++) {
            inputNames[i] = "input_" + i;
        }
    }
297159
function(values) {
    var max = Number.MIN_VALUE,
        min = Number.MAX_VALUE,
        val,
        cc,
        attrs = {};

    if (!(this.scale instanceof jvm.OrdinalScale) && !(this.scale instanceof jvm.SimpleScale)) {
      if (!this.params.min || !this.params.max) {
        for (cc in values) {
          val = parseFloat(values[cc]);
          if (val > max) max = values[cc];
          if (val < min) min = val;
        }
        if (!this.params.min) {
          this.scale.setMin(min);
        }
        if (!this.params.max) {
          this.scale.setMax(max);
        }
        this.params.min = min;
        this.params.max = max;
      }
      for (cc in values) {
        val = parseFloat(values[cc]);
        if (!isNaN(val)) {
          attrs[cc] = this.scale.getValue(val);
        } else {
          attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute];
        }
      }
    } else {
      for (cc in values) {
        if (values[cc]) {
          attrs[cc] = this.scale.getValue(values[cc]);
        } else {
          attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute];
        }
      }
    }

    this.setAttributes(attrs);
    jvm.$.extend(this.values, values);
  }
430255
public void set(Object... nameValues) {
        if (nameValues.length % 2 != 0) {
            throw new IllegalArgumentException("Names and values must be in pairs");
        }
        for (int i = 0; i < nameValues.length; i += 2) {
            set((String)nameValues[i], nameValues[i + 1]);
        }
    }
979293
public static void setNumberOfThreads(int numThreads) {
		if (numThreads < 1)
			throw new IllegalStateException("Number of threads must be a positive integer.");
		
		if (threadPool.size() > numThreads)
			throw new IllegalStateException("You cannot set a numThreads smaller than the current size of the threads pool.");
		
		if (threadPool.size() < numThreads) {
			for (int i=threadPool.size(); i<numThreads; i++) {
				threadPool.add(Executors.newSingleThreadExecutor());
			}
		}
	}
834855
public void setPhoneNumberIds(java.util.Collection<String> phoneNumberIds) {
        if (phoneNumberIds == null) {
            this.phoneNumberIds = null;
            return;
        }

        this.phoneNumberIds = new java.util.ArrayList<String>(phoneNumberIds);
    }
859926
public List<NumericColumn<?>> numericColumns(int... columnIndices) {
        List<NumericColumn<?>> cols = new ArrayList<>();
        for (int i : columnIndices) {
            cols.add(numberColumn(i));
        }

        return cols;
    }
389684
private int readCorner2(int numRows, int numColumns) {
    int currentByte = 0;
    if (readModule(numRows - 3, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 2, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 1, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 4, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 3, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 2, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(1, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    return currentByte;
  }
32334
public static void notNull(Object... objects) {
        notNull((Object) objects);
        for (Object object : objects) {
            notNull(object);
        }
    }
1014711
public static void heapSort(int[] arrays) {
        // 将待排序的序列构建成一个大顶堆
        for (int i = arrays.length / ValueConsts.TWO_INT; i >= 0; i--) {
            heapAdjust(arrays, i, arrays.length);
        }
        // 逐步将每个最大值的根节点与末尾元素交换，并且再调整二叉树，使其成为大顶堆
        for (int i = arrays.length - 1; i > 0; i--) {
            // 将堆顶记录和当前未经排序子序列的最后一个记录交换
            switchNumber(arrays, 0, i);
            // 交换之后，需要重新检查堆是否符合大顶堆，不符合则要调整
            heapAdjust(arrays, 0, i);
        }
    }