<p>
Returns the value of the element in the vector that has the largest value.<br>
<br>
Max{ a<sub>i</sub> } for all i<br>
</p>

@param a A vector. Not modified.
@return The max element value of the matrix.
15798
public static double elementMax( DMatrix4 a ) {
        double max = a.a1;
        if( a.a2 > max ) max = a.a2;
        if( a.a3 > max ) max = a.a3;
        if( a.a4 > max ) max = a.a4;

        return max;
    }
1349927
public static double searchMax(int[] intArray) {
        if(intArray.length == 0) {
            throw new IllegalArgumentException("The array you provided does not have any elements");
        }

        int max = intArray[0];

        for(int i = 1; i < intArray.length; i++) {
            if(intArray[i] > max) {
                max = intArray[i];
            }
        }

        return max;
    }
365400
public static double max(double[][] matrix) {
        double m = Double.NEGATIVE_INFINITY;

        for (double[] x : matrix) {
            for (double y : x) {
                if (m < y) {
                    m = y;
                }
            }
        }

        return m;
    }
658928
public static long max(long... numberArray) {
		if (isEmpty(numberArray)) {
			throw new IllegalArgumentException("Number array must not empty !");
		}
		long max = numberArray[0];
		for (int i = 0; i < numberArray.length; i++) {
			if (max < numberArray[i]) {
				max = numberArray[i];
			}
		}
		return max;
	}
639888
public static long max(LongArrayND array)
    {
        return array.stream().parallel().reduce(
            Long.MIN_VALUE, Math::max);
    }
1234985
public static double normP1( DMatrixRMaj A ) {
        if( MatrixFeatures_DDRM.isVector(A)) {
            return CommonOps_DDRM.elementSumAbs(A);
        } else {
            return inducedP1(A);
        }
    }
275094
public static double elementMaxMagnitude2( ZMatrixD1 a ) {
        final int size = a.getDataLength();

        double max = 0;
        for( int i = 0; i < size; ) {
            double real = a.data[i++];
            double imaginary = a.data[i++];

            double m = real*real + imaginary*imaginary;

            if( m > max ) {
                max = m;
            }
        }

        return max;
    }
916249
public static double[] getMax(SpatialComparable box) {
    final int dim = box.getDimensionality();
    double[] max = new double[dim];
    for(int i = 0; i < dim; i++) {
      max[i] = box.getMax(i);
    }
    return max;
  }
960273
public static double[] pairwiseMax (double[] vector1, double[] vector2) {
        // Initialize the return value:
        final double[] retval = new double[vector1.length];

        // Iterate over values and get maxs:
        for (int i = 0; i < retval.length; i++) {
            retval[i] = Math.max(vector1[i], vector2[i]);
        }

        // Done, return:
        return retval;
    }
548827
public static double elementMax( DMatrix6 a ) {
        double max = a.a1;
        if( a.a2 > max ) max = a.a2;
        if( a.a3 > max ) max = a.a3;
        if( a.a4 > max ) max = a.a4;
        if( a.a5 > max ) max = a.a5;
        if( a.a6 > max ) max = a.a6;

        return max;
    }
271395
public static double max(final double a, final double b) {
        if (Double.isNaN(a)) {
            return b;
        } else if (Double.isNaN(b)) {
            return a;
        } else {
            return Math.max(a, b);
        }
    }
1062542
public static double elementMaxReal( ZMatrixD1 a ) {
        final int size = a.getDataLength();

        double max = a.data[0];
        for( int i = 2; i < size; i += 2 ) {
            double val = a.data[i];
            if( val > max ) {
                max = val;
            }
        }

        return max;
    }
1089450
public static double elementMaxAbs( DMatrix3 a ) {
        double max = Math.abs(a.a1);
        double tmp = Math.abs(a.a2); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a2); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a3); if( tmp > max ) max = tmp;

        return max;
    }
847268
public int getMaxIdx() {
        int max = Integer.MIN_VALUE;
        for (int i=0; i<this.top; i++) {
            if (idx[i] > max) {
                max = idx[i];
            }
        }
        return max;
    }
640777
public static int max(int[] x) {
        int m = x[0];

        for (int n : x) {
            if (n > m) {
                m = n;
            }
        }

        return m;
    }
920389
public static int getMaxIndex(DoubleMatrix1D v){
	  	int maxIndex = -1;
	  	double maxValue = -Double.MAX_VALUE;
	  	for(int i=0; i<v.size(); i++){
	  		if(v.getQuick(i)>maxValue){
	  			maxIndex = i;
	  			maxValue = v.getQuick(i); 
	  		}
	  	}
	  	return maxIndex; 
	  }
416846
public AABBf setMax(Vector3fc max) {
        return this.setMax(max.x(), max.y(), max.z());
    }