Java Array Max Value findMaxValueIndex(double[] d)

Here you can find the source of findMaxValueIndex(double[] d)

Description

find Max Value Index

License

Open Source License

Declaration

public static int findMaxValueIndex(double[] d) 

Method Source Code

//package com.java2s;
// License as published by the Free Software Foundation.        //

public class Main {
    public static int findMaxValueIndex(double[] d) {
        int index = 0;
        double maxVal = d[0];
        for (int i = 0; i < d.length; i++) {
            if (d[i] > maxVal) {
                index = i;//from  w  w  w .  j  av a  2  s .  c  o  m
                maxVal = d[i];
            }
        }
        return index;
    }
}

Related

  1. findMaxIndex(final int[] array)
  2. findMaxIndex(int[] a)
  3. findMaxIndex(int[] arr)
  4. findMaxOverlap(final int[] overlapRange, final int[] outputRange, final int[] min, final int[] max)
  5. findMaxValue(int[] array)
  6. max(boolean useInt, int... value)
  7. max(byte[] arr)
  8. max(byte[] array)
  9. max(byte[] array)