Computes a vector as the max of respective pairs from two arrays.

@param vector1 The first vector.
@param vector2 The second vector.
@return Maxs of two vectors.
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;
    }
1239534
@Override
  public Long max11(Long arg1, Long arg2) {
    if (arg1 == null || arg2 == null) {
      return null;
    } else {
      return Math.max(arg1, arg2);
    }
  }
326065
public static int max(int[][] matrix) {
        int m = matrix[0][0];

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

        return m;
    }
657404
public static double elementMax( DMatrix3x3 a ) {
        double max = a.a11;
        if( a.a12 > max ) max = a.a12;
        if( a.a13 > max ) max = a.a13;
        if( a.a21 > max ) max = a.a21;
        if( a.a22 > max ) max = a.a22;
        if( a.a23 > max ) max = a.a23;
        if( a.a31 > max ) max = a.a31;
        if( a.a32 > max ) max = a.a32;
        if( a.a33 > max ) max = a.a33;

        return max;
    }
925544
private double max(ArrayList<DistanceSet> v) {
        double max = 0.0;
        for (DistanceSet n : v) {
            if (max < n.dist.get(n.dist.size() - 1)) {
                max = n.dist.get(n.dist.size() - 1);
            }
        }
        return max;
    }
195617
public double maxDist(SpatialComparable mbr1, SpatialComparable mbr2) {
    final int dim1 = mbr1.getDimensionality(), dim2 = mbr2.getDimensionality();
    final int mindim = dim1 < dim2 ? dim1 : dim2;

    double agg = 0.;
    for(int d = 0; d < mindim; d++) {
      double d1 = mbr1.getMax(d) - mbr2.getMin(d);
      double d2 = mbr2.getMax(d) - mbr1.getMin(d);
      double delta = d1 > d2 ? d1 : d2;
      agg += delta * delta;
    }
    for(int d = mindim; d < dim1; d++) {
      double d1 = Math.abs(mbr1.getMin(d)), d2 = Math.abs(mbr1.getMax(d));
      double delta = d1 > d2 ? d1 : d2;
      agg += delta * delta;
    }
    for(int d = mindim; d < dim2; d++) {
      double d1 = Math.abs(mbr2.getMin(d)), d2 = Math.abs(mbr2.getMax(d));
      double delta = d1 > d2 ? d1 : d2;
      agg += delta * delta;
    }
    return FastMath.sqrt(agg);
  }
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;
    }
168586
public static double elementMax( DMatrix3 a ) {
        double max = a.a1;
        if( a.a2 > max ) max = a.a2;
        if( a.a3 > max ) max = a.a3;

        return max;
    }
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;
    }
1254510
public static double elementMaxAbs( DMatrix4 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;
        tmp = Math.abs(a.a4); if( tmp > max ) max = tmp;

        return max;
    }
844286
public void max(double v) {
    if (Double.isFinite(v)) {
      double max = get();
      while (isGreaterThan(v, max) && !compareAndSet(max, v)) {
        max = value.get();
      }
    }
  }
416918
public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>> int compare(T1 a1, T1 b1, T2 a2, T2 b2) {
        int res = N.compare(a1, b1);

        return res == 0 ? N.compare(a2, b2) : res;
    }
709904
public static double[] normalizeL1(double[] vector) {
		// compute vector 1-norm
		double norm1 = 0;
		for (int i = 0; i < vector.length; i++) {
			norm1 += Math.abs(vector[i]);
		}

		if (norm1 == 0) {
			Arrays.fill(vector, 1.0 / vector.length);
		} else {
			for (int i = 0; i < vector.length; i++) {
				vector[i] = vector[i] / norm1;
			}
		}
		return vector;
	}
305402
public static float max(final float a, final float b) {
        if (Float.isNaN(a)) {
            return b;
        } else if (Float.isNaN(b)) {
            return a;
        } else {
            return Math.max(a, b);
        }
    }
391050
@Pure
	public static double max(double... values) {
		if (values == null || values.length == 0) {
			return Double.NaN;
		}
		double max = values[0];
		for (final double v : values) {
			if (v > max) {
				max = v;
			}
		}
		return max;
	}
187898
public static BigFloat max(BigFloat value1, BigFloat value2) {
		return value1.compareTo(value2) >= 0 ? value1 : value2;
	}
1233441
public double getMaxDist(VectorApproximation vec) {
    final int dim = lookup.length;
    double maxDist = 0;
    for(int d = 0; d < dim; d++) {
      final int vp = vec.getApproximation(d);
      maxDist += getPartialMaxDist(d, vp);
    }
    return FastMath.pow(maxDist, onebyp);
  }