Java Array Min Value minDoubleArray(double[] data)

Here you can find the source of minDoubleArray(double[] data)

Description

Get the minimum from a double array.

License

Apache License

Parameter

Parameter Description
data the array.

Return

the minimum.

Declaration

private static int minDoubleArray(double[] data) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//from  w w w.  ja v  a2s  .co m
     * Get the minimum from a double array.
     * 
     * @param data
     *            the array.
     * @return the minimum.
     */
    private static int minDoubleArray(double[] data) {
        double minimum = data[0];
        int minIndex = 0;
        for (int i = 1; i < data.length; i++) {
            if (data[i] < minimum) {
                minimum = data[i];
                minIndex = i;
            }
        }
        return minIndex;
    }
}

Related

  1. minDiff(int... offs)
  2. minDist(double[] q, double[] c, double[][] distMatrix, int orig_n)
  3. minDistance(int[][] colors, int len, int[] color)
  4. minDouble(double a, double... others)
  5. minDouble(double... values)
  6. minElement(int[] array)
  7. minFastSort(double x[], int idx[], int n, int m)
  8. minFastSort(double[] x, int[] idx, int size)
  9. minIdx(int[] in)