org.apache.commons.math3.stat.descriptive.rank.Percentile.copyOf()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.apache.commons.math3.stat.descriptive.rank.Percentile.copyOf()方法的一些代码示例,展示了Percentile.copyOf()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Percentile.copyOf()方法的具体详情如下:
包路径:org.apache.commons.math3.stat.descriptive.rank.Percentile
类名称:Percentile
方法名:copyOf

Percentile.copyOf介绍

[英]Make a copy of the array for the slice defined by array part from [begin, begin+length)
[中]从[begin,begin+length]为array part定义的切片制作数组副本

代码示例

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Replace every occurrence of a given value with a replacement value in a
 * copied slice of array defined by array part from [begin, begin+length).
 * @param values the input array
 * @param begin start index of the array to include
 * @param length number of elements to include from begin
 * @param original the value to be replaced with
 * @param replacement the value to be used for replacement
 * @return the copy of sliced array with replaced values
 */
private static double[] replaceAndSlice(final double[] values,
                    final int begin, final int length,
                    final double original,
                    final double replacement) {
  final double[] temp = copyOf(values, begin, length);
  for(int i = 0; i < length; i++) {
    temp[i] = Precision.equalsIncludingNaN(original, temp[i]) ?
         replacement : temp[i];
  }
  return temp;
}

代码示例来源:origin: org.apache.commons/commons-math3

temp = copyOf(values, begin, length); // Nothing removed, just copy
} else if(bits.cardinality() == length){
  temp = new double[0];                 // All removed, just empty

代码示例来源:origin: org.apache.commons/commons-math3

break;
case FAILED:// just throw exception as NaN is un-acceptable
  work = copyOf(values, begin, length);
  MathArrays.checkNotNaN(work);
  break;
default: //FIXED
  work = copyOf(values,begin,length);
  break;

代码示例来源:origin: geogebra/geogebra

/**
 * Replace every occurrence of a given value with a replacement value in a
 * copied slice of array defined by array part from [begin, begin+length).
 * @param values the input array
 * @param begin start index of the array to include
 * @param length number of elements to include from begin
 * @param original the value to be replaced with
 * @param replacement the value to be used for replacement
 * @return the copy of sliced array with replaced values
 */
private static double[] replaceAndSlice(final double[] values,
                    final int begin, final int length,
                    final double original,
                    final double replacement) {
  final double[] temp = copyOf(values, begin, length);
  for(int i = 0; i < length; i++) {
    temp[i] = Precision.equalsIncludingNaN(original, temp[i]) ?
         replacement : temp[i];
  }
  return temp;
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Replace every occurrence of a given value with a replacement value in a
 * copied slice of array defined by array part from [begin, begin+length).
 * @param values the input array
 * @param begin start index of the array to include
 * @param length number of elements to include from begin
 * @param original the value to be replaced with
 * @param replacement the value to be used for replacement
 * @return the copy of sliced array with replaced values
 */
private static double[] replaceAndSlice(final double[] values,
                    final int begin, final int length,
                    final double original,
                    final double replacement) {
  final double[] temp = copyOf(values, begin, length);
  for(int i = 0; i < length; i++) {
    temp[i] = Precision.equalsIncludingNaN(original, temp[i]) ?
         replacement : temp[i];
  }
  return temp;
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

temp = copyOf(values, begin, length); // Nothing removed, just copy
} else if(bits.cardinality() == length){
  temp = new double[0];                 // All removed, just empty

代码示例来源:origin: geogebra/geogebra

temp = copyOf(values, begin, length); // Nothing removed, just copy
} else if(bits.cardinality() == length){
  temp = new double[0];                 // All removed, just empty

代码示例来源:origin: geogebra/geogebra

break;
case FAILED:// just throw exception as NaN is un-acceptable
  work = copyOf(values, begin, length);
  MathArrays.checkNotNaN(work);
  break;
default: //FIXED
  work = copyOf(values,begin,length);
  break;

代码示例来源:origin: io.virtdata/virtdata-lib-realer

break;
case FAILED:// just throw exception as NaN is un-acceptable
  work = copyOf(values, begin, length);
  MathArrays.checkNotNaN(work);
  break;
default: //FIXED
  work = copyOf(values,begin,length);
  break;

相关文章