weka.core.Utils.initialIndex()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(82)

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

Utils.initialIndex介绍

[英]Initial index, filled with values from 0 to size - 1.
[中]初始索引,填充从0到大小-1的值。

代码示例

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns the kth-smallest value in the array
 * 
 * @param array the array of double
 * @param k the value of k
 * @return the kth-smallest value
 */
public static double kthSmallestValue(double[] array, int k) {
 int[] index = initialIndex(array.length);
 return array[index[select(array, index, 0, array.length - 1, k)]];
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns the kth-smallest value in the array.
 * 
 * @param array the array of integers
 * @param k the value of k
 * @return the kth-smallest value
 */
public static int kthSmallestValue(int[] array, int k) {
 int[] index = initialIndex(array.length);
 return array[index[select(array, index, 0, array.length - 1, k)]];
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Returns the kth-smallest value in the array
 * 
 * @param array the array of double
 * @param k the value of k
 * @return the kth-smallest value
 */
public static double kthSmallestValue(double[] array, int k) {
 int[] index = initialIndex(array.length);
 return array[index[select(array, index, 0, array.length - 1, k)]];
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Returns the kth-smallest value in the array.
 * 
 * @param array the array of integers
 * @param k the value of k
 * @return the kth-smallest value
 */
public static int kthSmallestValue(int[] array, int k) {
 int[] index = initialIndex(array.length);
 return array[index[select(array, index, 0, array.length - 1, k)]];
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Sorts a given array of doubles in ascending order and returns an array of
 * integers with the positions of the elements of the original array in the
 * sorted array. Missing values in the given array are replaced by
 * Double.MAX_VALUE, so the array is modified in that case!
 * 
 * @param array the array to be sorted, which is modified if it has missing
 *          values
 * @return an array of integers with the positions in the sorted array.
 */
public static/* @pure@ */int[] sortWithNoMissingValues(
/* @non_null@ */double[] array) {
 int[] index = initialIndex(array.length);
 if (array.length > 1) {
  quickSort(array, index, 0, array.length - 1);
 }
 return index;
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Sorts a given array of doubles in ascending order and returns an array of
 * integers with the positions of the elements of the original array in the
 * sorted array. Missing values in the given array are replaced by
 * Double.MAX_VALUE, so the array is modified in that case!
 * 
 * @param array the array to be sorted, which is modified if it has missing
 *          values
 * @return an array of integers with the positions in the sorted array.
 */
public static/* @pure@ */int[] sortWithNoMissingValues(
/* @non_null@ */double[] array) {
 int[] index = initialIndex(array.length);
 if (array.length > 1) {
  quickSort(array, index, 0, array.length - 1);
 }
 return index;
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

int[] index = initialIndex(array.length);
int[] newIndex = new int[array.length];
int[] helpIndex;

代码示例来源:origin: Waikato/weka-trunk

int[] index = initialIndex(array.length);
int[] newIndex = new int[array.length];
int[] helpIndex;

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Sorts a given array of doubles in ascending order and returns an array of
 * integers with the positions of the elements of the original array in the
 * sorted array. NOTE THESE CHANGES: the sort is no longer stable and it
 * doesn't use safe floating-point comparisons anymore. Occurrences of
 * Double.NaN are treated as Double.MAX_VALUE.
 * 
 * @param array this array is not changed by the method!
 * @return an array of integers with the positions in the sorted array.
 */
public static/* @pure@ */int[] sort(/* @non_null@ */double[] array) {
 int[] index = initialIndex(array.length);
 if (array.length > 1) {
  array = array.clone();
  replaceMissingWithMAX_VALUE(array);
  quickSort(array, index, 0, array.length - 1);
 }
 return index;
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Sorts a given array of doubles in ascending order and returns an array of
 * integers with the positions of the elements of the original array in the
 * sorted array. NOTE THESE CHANGES: the sort is no longer stable and it
 * doesn't use safe floating-point comparisons anymore. Occurrences of
 * Double.NaN are treated as Double.MAX_VALUE.
 * 
 * @param array this array is not changed by the method!
 * @return an array of integers with the positions in the sorted array.
 */
public static/* @pure@ */int[] sort(/* @non_null@ */double[] array) {
 int[] index = initialIndex(array.length);
 if (array.length > 1) {
  array = array.clone();
  replaceMissingWithMAX_VALUE(array);
  quickSort(array, index, 0, array.length - 1);
 }
 return index;
}

代码示例来源:origin: Waikato/weka-trunk

int[] index = initialIndex(array.length);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

int[] index = initialIndex(array.length);

相关文章

微信公众号

最新文章

更多