Package scalaSci.math.array.util

Examples of scalaSci.math.array.util.Sorting


   * @return Sorted version of input array.
   */
  public static double[] sort(double[] values) {
    double[] sorted_values = new double[values.length];
    System.arraycopy(values, 0, sorted_values, 0, values.length);
    new Sorting(sorted_values, false);
    return sorted_values;
  }
View Full Code Here


   * @param column Index of column to be used as the sorting key.
   * @return Matrix whose rows have been shuffled around.
   */
  public static double[][] sort(double[][] values, int column) {
    double[][] sorted_values = new double[values.length][values[0].length];
    Sorting s = new Sorting(getColumnCopy(values, column), false);
    for (int i = 0; i < sorted_values.length; i++)
      System.arraycopy(values[s.getIndex(i)], 0, sorted_values[i], 0, values[s.getIndex(i)].length);

    return sorted_values;
  }
View Full Code Here

TOP

Related Classes of scalaSci.math.array.util.Sorting

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.