Java Matrix Max Value max(float a[][][])

Here you can find the source of max(float a[][][])

Description

Find maximum value in a 3D matrix

License

CeCILL license

Parameter

Parameter Description
a a parameter

Return

the maximum value in the matrix

Declaration

public static float max(float a[][][]) 

Method Source Code

//package com.java2s;
//License from project: CeCILL license 

public class Main {
    /**//  w ww .  ja  v a 2s. c  om
     * Find maximum value in a 3D matrix
     * 
     * @param a
     * @return the maximum value in the matrix
     */
    public static float max(float a[][][]) {
        float max = a[0][0][0];
        for (int i = 0; i < a.length; i++)
            for (int j = 0; j < a[i].length; j++)
                for (int k = 0; k < a[i][j].length; k++)
                    max = (a[i][j][k] > max ? a[i][j][k] : max);
        return max;
    }
}

Related

  1. max(double[][] x)
  2. max(float[][] a)
  3. max(float[][] originalValues, float[][] newValues, int[] indexArray, float value)
  4. max_abs(double[][] matrix)
  5. maxDifffer(double[][] pos)