Java Array Min Value minLocation(double[] list)

Here you can find the source of minLocation(double[] list)

Description

This method finds the location of the first minimum of list

License

Open Source License

Parameter

Parameter Description
list a list of doubles

Return

the location of the first occurence of the minimum element

Declaration

public static int minLocation(double[] list) 

Method Source Code

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

public class Main {
    /**/*from   www  .  ja va  2 s.com*/
     * This method finds the location of the first minimum of list
     * @param list a list of doubles
     * @return the location of the first occurence of the minimum element
     */
    public static int minLocation(double[] list) {
        int location = 0;
        for (int i = 1; i < list.length; ++i)
            if (list[i] < list[location])
                location = i;

        return location;
    }
}

Related

  1. minInRowIndex(double[][] M, int row)
  2. minInt(int... values)
  3. minkowskiDistance(double[] coord1, double[] coord2)
  4. minLengthCheck(final byte[] buffer, final byte length)
  5. minList(int[] listA, int[] listB)
  6. minmax(double[] a)
  7. minMax(float... values)
  8. minMax(float[] array)
  9. minmax(int[] values)