Java Array Max Value argmax(float[] args)

Here you can find the source of argmax(float[] args)

Description

argmax

License

Open Source License

Declaration

public static int argmax(float[] args) 

Method Source Code

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

public class Main {
    public static int argmax(float[] args) {
        int result = 0;
        for (int i = 1; i < args.length; i++) {
            if (Float.compare(args[result], args[i]) < 0)
                result = i;/*from   w w  w .  ja  va  2 s  .  c om*/
        }
        return result;
    }
}

Related

  1. argmax(double[] array, boolean naturalNumbers)
  2. argmax(double[] weights)
  3. argmax(final double[] vec)
  4. argMax(int[] a)
  5. argmax(int[] a)
  6. argmax(int[] array)
  7. argmax(int[] array)