Return the maximum value of the given double array.

@since 4.0

@param values the array.
@return the maximum value or {@link Long#MIN_VALUE} if the given array is
empty.
@throws NullPointerException if the given array is {@code null}.
500966
public static long max(final long[] values) {
		long max = Long.MIN_VALUE;
		if (values.length > 0) {
			max = values[0];

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

		return max;
	}
29973
@Pure
	public static float max(float... values) {
		if (values == null || values.length == 0) {
			return Float.NaN;
		}
		float max = values[0];
		for (final float v : values) {
			if (v > max) {
				max = v;
			}
		}
		return max;
	}
1085485
public static Double[] wrap(double... values) {
		if (null == values) {
			return null;
		}
		final int length = values.length;
		if (0 == length) {
			return new Double[0];
		}

		final Double[] array = new Double[length];
		for (int i = 0; i < length; i++) {
			array[i] = Double.valueOf(values[i]);
		}
		return array;
	}
449857
public static double[] getMaximumValues(Front front) {
    if (front == null) {
      throw new NullFrontException() ;
    } else if (front.getNumberOfPoints() == 0) {
      throw new EmptyFrontException() ;
    }

    int numberOfObjectives = front.getPoint(0).getDimension() ;

    double[] maximumValue = new double[numberOfObjectives];
    for (int i = 0; i < numberOfObjectives; i++) {
      maximumValue[i] = Double.NEGATIVE_INFINITY;
    }

    for (int i = 0 ; i < front.getNumberOfPoints(); i++) {
      for (int j = 0; j < numberOfObjectives; j++) {
        if (front.getPoint(i).getValue(j) > maximumValue[j]) {
          maximumValue[j] = front.getPoint(i).getValue(j);
        }
      }
    }

    return maximumValue;
  }
1025331
@Override
    public Double reduce(List<Double> values) {
        double min = Double.MAX_VALUE;
        double max = Double.MIN_VALUE;

        for (Double value : values) {
            if (value == null) {
                value = 0.0;
            }

            double candidate = (value);

            if (candidate < min) {
                min = candidate;
            }
            if (candidate > max) {
                max = candidate;
            }
        }
        return max - min;
    }
126433
public static double min(double[][] values) {
    double min = Double.MAX_VALUE;
    for (int i = 0; i < values.length; i++) {
      for (int j = 0; j < values[i].length; j++) {
        min = (values[i][j] < min) ? values[i][j] : min;
      }
    }
    return min;
  }
426491
@Override
    public Double reduce(List<Double> values) {
    	if(values == null || values.isEmpty()) {
    		return null;
    	}
    	
    	Stream<Double> stream = StreamSupport.stream(values.spliterator(), true);
    	if(stream.allMatch(o -> o == null)) {
    		stream.close();
    		return null;
    	}
    	stream.close();
    	
        double max = Double.NEGATIVE_INFINITY;
        for (Double value : values) {
            if (value == null) {
                continue;
            }

            double candidate = value;
            if (candidate > max) {
                max = candidate;
            }
        }
        return max;
    }
890284
public static int getMaxValue (int[] values)
    {
        int max = Integer.MIN_VALUE;
        int vcount = (values == null) ? 0 : values.length;
        for (int ii = 0; ii < vcount; ii++) {
            if (values[ii] > max) {
                // new max
                max = values[ii];
            }
        }
        return max;
    }
200704
public static BigFloat max(BigFloat value1, BigFloat... values) {
		BigFloat result = value1;

		for (BigFloat other : values) {
			result = max(result, other);
		}

		return result;
	}
1007901
public static double max( double []array , int offset , int length ) {
		double max = -Double.MAX_VALUE;
		for (int i = 0; i < length; i++) {
			double tmp = array[offset+i];
			if( tmp > max ) {
				max = tmp;
			}
		}
		return max;
	}
454624
public static double average(List<? extends Number> values) {
        if (values == null || values.isEmpty()) return 0D;

        double sum = 0D;
        for (Number v : values) sum += v.doubleValue();

        return sum / values.size();
    }
1189781
public static Value float64Array(@Nullable double[] v) {
    return float64Array(v, 0, v == null ? 0 : v.length);
  }
283210
public static String min(String... values) {
        BigDecimal bd;
        BigDecimal bd2;
        try {
            int start = 0;
            while (values[start] == null) {
                start++;
            }
            bd = new BigDecimal(values[start]);
            for (int i = start + 1; i < values.length; i++) {
                if (values[i] == null) {
                    continue;
                }
                bd2 = new BigDecimal(values[i]);
                if (bd.compareTo(bd2) > 0) {
                    bd = bd2;
                }
            }
            return bd.toString();
        } catch (Exception e) {
            return null;
        }
    }
552133
public static double mode(double[] values) {
        if (values.length == 0)
            throw new IllegalArgumentException("No mode in an empty array");        
        Counter<Double> c = new ObjectCounter<Double>();
        for (double d : values)
            c.count(d);
        return c.max();
    }
456576
public static void columnMaxAbs( DMatrixSparseCSC A , double []values ) {
        if( values.length < A.numCols )
            throw new IllegalArgumentException("Array is too small. "+values.length+" < "+A.numCols);

        for (int i = 0; i < A.numCols; i++) {
            int idx0 = A.col_idx[i];
            int idx1 = A.col_idx[i+1];

            double maxabs = 0;
            for (int j = idx0; j < idx1; j++) {
                double v = Math.abs(A.nz_values[j]);
                if( v > maxabs )
                    maxabs = v;
            }
            values[i] = maxabs;
        }
    }
792945
public static BigRational min(BigRational... values) {
		if (values.length == 0) {
			return BigRational.ZERO;
		}
		BigRational result = values[0];
		for (int i = 1; i < values.length; i++) {
			result = result.min(values[i]);
		}
		return result;
	}
871166
public static double sum(Collection<? extends Number> values) {
        double sum = 0d;
        for (Number n : values)
            sum += n.doubleValue();
        return sum;
    }