Finds the min and max of a dataset

@param lows
@param highs
@return
966812
private double[] findMinMax(double[] lows, double[] highs) {

    double min = Double.MAX_VALUE;
    double max = -Double.MAX_VALUE;

    for (int i = 0; i < highs.length; i++) {

      if (!Double.isNaN(highs[i]) && highs[i] > max) {
        max = highs[i];
      }
      if (!Double.isNaN(lows[i]) && lows[i] < min) {
        min = lows[i];
      }
    }

    return new double[] {min, max};
  }
1081475
public static ByteStringRange getBound(RowSet rowSet) {
    // Find min & max keys
    ByteString minKey = null;
    ByteString maxKey = null;

    for (ByteString key : rowSet.getRowKeysList()) {
      if (minKey == null || ByteStringComparator.INSTANCE.compare(minKey, key) > 0) {
        minKey = key;
      }
      if (maxKey == null || ByteStringComparator.INSTANCE.compare(maxKey, key) < 0) {
        maxKey = key;
      }
    }

    // Convert min & max keys in start & end points for a range
    StartPoint minStartPoint = null;
    EndPoint maxEndPoint = null;
    if (minKey != null) {
      minStartPoint = new StartPoint(minKey, true);
    }
    if (maxKey != null) {
      maxEndPoint = new EndPoint(maxKey, true);
    }

    // Expand the range using the RowSet ranges
    for (RowRange rowRange : rowSet.getRowRangesList()) {
      StartPoint currentStartPoint = StartPoint.extract(rowRange);
      if (minStartPoint == null || minStartPoint.compareTo(currentStartPoint) > 0) {
        minStartPoint = currentStartPoint;
      }

      EndPoint currentEndpoint = EndPoint.extract(rowRange);
      if (maxEndPoint == null || maxEndPoint.compareTo(currentEndpoint) < 0) {
        maxEndPoint = currentEndpoint;
      }
    }

    // Build a range using the endpoints
    ByteStringRange boundingRange = ByteStringRange.unbounded();
    if (minStartPoint != null) {
      if (minStartPoint.isClosed) {
        boundingRange.startClosed(minStartPoint.value);
      } else {
        boundingRange.startOpen(minStartPoint.value);
      }
    }
    if (maxEndPoint != null) {
      if (maxEndPoint.isClosed) {
        boundingRange.endClosed(maxEndPoint.value);
      } else {
        boundingRange.endOpen(maxEndPoint.value);
      }
    }

    return boundingRange;
  }
193077
public static double min(FlatDataCollection flatDataCollection) {
        double min=Double.POSITIVE_INFINITY;
        
        Iterator<Double> it = flatDataCollection.iteratorDouble();
        while(it.hasNext()) {
            Double v = it.next();
            if(v != null && min > v) {
                min=v;
            }
        } 
        
        return min;
    }
546162
private Map<String, Double> getMinMax(Map<Long, Double> metricData) {
        double min = 0.0;
        double max = 0.0;
        boolean isMinMaxSet = false;
        for (Double value : metricData.values()) {
            double valueDouble = value;
            if (!isMinMaxSet) {
                min = valueDouble;
                max = valueDouble;
                isMinMaxSet = true;
            } else {
                if (valueDouble < min) {
                    min = valueDouble;
                } else if (valueDouble > max) {
                    max = valueDouble;
                }
            }
        }

        Map<String, Double> minMax = new HashMap<>();
        minMax.put("min", min);
        minMax.put("max", max);
        return minMax;
    }
1260719
public static String findLowestTier(String[] tiers) {
    //if only 1 store then you don't need to find the lowest tier
    if (tiers.length == 1) {
      return tiers[0];
    }

    //we expect at least one tier
    if (tiers.length == 0) {
      throw new RuntimeException("No existing tier");
    }

    // We rely here on the alphabetical order matching the depth order so from highest to lowest we have
    // OnHeap, OffHeap, Disk, Clustered
    String lowestTier = tiers[0];
    for (int i = 1; i < tiers.length; i++) {
      if (tiers[i].compareTo(lowestTier) < 0) {
        lowestTier = tiers[i];
      }
    }

    return lowestTier;
  }
603340
def get_minimum_span(low, high, span):
    
    if is_number(low) and low == high:
        if isinstance(low, np.datetime64):
            span = span * np.timedelta64(1, 's')
        low, high = low-span, high+span
    return low, high
1149823
public static int[] range(int min, int max) {
    int[] range = new int[max - min];
    for (int i = 0; i < (max - min); i++) {
      range[i] = i + min;
    }
    return range;
  }
186402
@Override
    public ZMatrixRMaj getLower(ZMatrixRMaj lower )
    {
        int numRows = LU.numRows;
        int numCols = LU.numRows < LU.numCols ? LU.numRows : LU.numCols;

        lower = UtilDecompositons_ZDRM.checkZerosUT(lower, numRows,numCols);

        for( int i = 0; i < numCols; i++ ) {
            lower.set(i,i,1.0,0.0);

            for( int j = 0; j < i; j++ ) {
                int indexLU = LU.getIndex(i,j);
                int indexL = lower.getIndex(i,j);

                double real = LU.data[indexLU];
                double imaginary = LU.data[indexLU+1];

                lower.data[indexL] = real;
                lower.data[indexL+1] = imaginary;
            }
        }

        if( numRows > numCols ) {
            for( int i = numCols; i < numRows; i++ ) {
                for( int j = 0; j < numCols; j++ ) {
                    int indexLU = LU.getIndex(i,j);
                    int indexL = lower.getIndex(i,j);

                    double real = LU.data[indexLU];
                    double imaginary = LU.data[indexLU+1];

                    lower.data[indexL] = real;
                    lower.data[indexL+1] = imaginary;
                }
            }
        }
        return lower;
    }
1274154
public static <T> T min(T lhs, T rhs, Comparator<T> comparator) {
        return BinaryOperator.minBy(comparator).apply(lhs, rhs);
    }
1076746
public static long minimum(long... values)
    {
        int len = values.length;
        long current = values[0];

        for (int i=1; i < len; i++)
        {
            current = Math.min(values[i], current);
        }

        return current;
    }
114951
public static double min(double... nums) {
    double min = nums[0];
    for (int i = 1; i < nums.length; i++) {
      if (nums[i] > min) {
        min = nums[i];
      }
    }
    return min;
  }
1185839
def lows(self, *args):
		
		for t in ifilter(lambda e: e[2] == 'L', self.extrema(*args)):
			yield t
581264
@Override
    public DMatrixRMaj getLower(DMatrixRMaj lower )
    {
        int numRows = LU.numRows;
        int numCols = LU.numRows < LU.numCols ? LU.numRows : LU.numCols;

        lower = UtilDecompositons_DDRM.checkZerosUT(lower,numRows,numCols);

        for( int i = 0; i < numCols; i++ ) {
            lower.unsafe_set(i,i,1.0);

            for( int j = 0; j < i; j++ ) {
                lower.unsafe_set(i,j, LU.unsafe_get(i,j));
            }
        }

        if( numRows > numCols ) {
            for( int i = numCols; i < numRows; i++ ) {
                for( int j = 0; j < numCols; j++ ) {
                    lower.unsafe_set(i,j, LU.unsafe_get(i,j));
                }
            }
        }
        return lower;
    }
198900
public static <T extends Comparable<T>> Predicate<T> between(
      final T low, final T high) {
    return new Predicate<T>() {
      @Override
      public boolean apply(T obj) {
        return obj != null
            && (low == null || obj.compareTo(low) >= 0)
            && (high == null || obj.compareTo(high) < 0);
      }
    };
  }
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;
    }
343356
@SuppressWarnings("rawtypes")
	public Set zrangeByScore(Object key, double min, double max) {
		Jedis jedis = getJedis();
		try {
			Set<byte[]> data = jedis.zrangeByScore(keyToBytes(key), min, max);
			Set<Object> result = new LinkedHashSet<Object>();	// 有序集合必须 LinkedHashSet
			valueSetFromBytesSet(data, result);
			return result;
		}
		finally {close(jedis);}
	}
952809
public static Short min(Short a, Short b) {
		return a <= b ? a : b;
	}