Java Array Sort sortPixels(double[] data, int numPixel)

Here you can find the source of sortPixels(double[] data, int numPixel)

Description

Return a 2D array

License

Open Source License

Declaration

public static double[][] sortPixels(double[] data, int numPixel) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//w w w  .  ja v a2 s  . c o m
     * Return a 2D array
     */
    public static double[][] sortPixels(double[] data, int numPixel) {

        int roi = data.length / numPixel;
        double[][] pixels = new double[numPixel][roi];

        for (int pix = 0; pix < numPixel; pix++) {
            for (int slice = 0; slice < roi; slice++) {
                int pixId = pix * roi + slice;
                double value = data[pixId];
                pixels[pix][slice] = value;
            }
        }
        return pixels;
    }
}

Related

  1. sortNames(String[] names)
  2. sortNames(String[] names)
  3. sortNullElements(Object[] array)
  4. sortPerm(final int[] w)
  5. sortPermutation(final int[] A)
  6. sortPopup(Integer[] integers)
  7. sortRetain(long[] a)
  8. sortReverseOrder(String[] strings)
  9. sortStringArray(String array[], boolean inplace)