<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.
427353
public static double elementMax( DMatrix2 a ) {
        double max = a.a1;
        if( a.a2 > max ) max = a.a2;

        return max;
    }
909273
public static int max(IntArrayND array)
    {
        return array.stream().parallel().reduce(
            Integer.MIN_VALUE, Math::max);
    }
1255015
public static <T> T max(final T[] a, final Comparator<? super T> cmp) {
        N.checkArgNotNullOrEmpty(a, "The spcified array 'a' can not be null or empty");

        return max(a, 0, a.length, cmp);
    }
147522
public static int whichMax(double[] x) {
        double m = Double.NEGATIVE_INFINITY;
        int which = 0;

        for (int i = 0; i < x.length; i++) {
            if (x[i] > m) {
                m = x[i];
                which = i;
            }
        }

        return which;
    }
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;
	}
1046319
public BoundedAssertion getMax()
    {
    ICondition max = null;
    Iterator<ICondition> conditions = getConditions();
    for( int i = 0; i < 2; i++) max = conditions.next();
    return (BoundedAssertion) max;
    }
663776
public static double elementMax( DMatrix2x2 a ) {
        double max = a.a11;
        if( a.a12 > max ) max = a.a12;
        if( a.a21 > max ) max = a.a21;
        if( a.a22 > max ) max = a.a22;

        return max;
    }
324384
public static double elementMax( DMatrix5 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;

        return max;
    }
10339
public static double elementMinAbs( DMatrixD1 a ) {
        final int size = a.getNumElements();

        double min = Double.MAX_VALUE;
        for( int i = 0; i < size; i++ ) {
            double val = Math.abs(a.get(i));
            if( val < min ) {
                min = val;
            }
        }

        return min;
    }
743178
public static double[] rowMax(double[][] data) {
        double[] x = new double[data.length];

        for (int i = 0; i < x.length; i++) {
            x[i] = max(data[i]);
        }

        return x;
    }
119563
public static double elementMinAbs( ZMatrixRMaj a ) {
        final int size = a.getDataLength();

        double min = Double.MAX_VALUE;
        for( int i = 0; i < size; i += 2 ) {
            double real = a.data[i];
            double imag = a.data[i+1];

            double val = real*real + imag*imag;

            if( val < min ) {
                min = val;
            }
        }

        return Math.sqrt(min);
    }
1139420
public static /*@pure@*/ int maxIndex(int[] ints) {

    int maximum = 0;
    int maxIndex = 0;

    for (int i = 0; i < ints.length; i++) {
      if ((i == 0) || (ints[i] > maximum)) {
	maxIndex = i;
	maximum = ints[i];
      }
    }

    return maxIndex;
  }
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;
    }
518307
public static double normPInf( DMatrixRMaj A ) {
        if( MatrixFeatures_DDRM.isVector(A)) {
            return CommonOps_DDRM.elementMaxAbs(A);
        } else {
            return inducedPInf(A);
        }
    }
230503
public static double elementMaxAbs( DMatrix5x5 a ) {
        double max = Math.abs(a.a11);
        double tmp = Math.abs(a.a12); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a13); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a14); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a15); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a21); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a22); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a23); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a24); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a25); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a31); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a32); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a33); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a34); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a35); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a41); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a42); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a43); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a44); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a45); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a51); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a52); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a53); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a54); if( tmp > max ) max = tmp;
        tmp = Math.abs(a.a55); if( tmp > max ) max = tmp;

        return max;
    }
78061
public static float max(final float a, final float b) {
        if (a > b) {
            return a;
        }
        if (a < b) {
            return b;
        }
        /* if either arg is NaN, return NaN */
        if (a != b) {
            return Float.NaN;
        }
        /* min(+0.0,-0.0) == -0.0 */
        /* 0x80000000 == Float.floatToRawIntBits(-0.0d) */
        int bits = Float.floatToRawIntBits(a);
        if (bits == 0x80000000) {
            return b;
        }
        return 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;
    }