Java Array Max Value maxIndex(double[] value)

Here you can find the source of maxIndex(double[] value)

Description

returns the index of the greatest element from the given array

License

Open Source License

Declaration

public static double maxIndex(double[] value) 

Method Source Code

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

public class Main {
    /**/*w  w w  .  j  a va 2 s .  c  om*/
     * returns the index of the greatest element from the given array
     */
    public static double maxIndex(double[] value) {
        double result = Double.NEGATIVE_INFINITY;
        int index = 0;
        for (int i = 0; i < value.length; i++) {
            if (value[i] > result)
                result = value[i];
            index = i;
        }
        return index;
    }
}

Related

  1. maxIndex(double[] arrays)
  2. maxIndex(double[] doubles)
  3. maxIndex(double[] doubles)
  4. maxIndex(double[] doubles, int begin, int end)
  5. maxIndex(double[] v)
  6. maxIndex(double[] x, int length)
  7. maxIndex(final double[] a)
  8. maxIndex(final double[] values)
  9. maxIndex(float[] arr)