This returns the product of all numbers in the given array.
@param nums the numbers to multiply over
@return the product of all numbers in the array, or 0
if the length is or nums i null
559855
public static double times(double[] nums) {
        if (nums == null || nums.length == 0)
            return 0;
        double ret = 1;
        for (int i = 0; i < nums.length; i++)
            ret *= nums[i];
        return ret;
    }
1020626
public static int sum (int zero, Iterable<? extends Number> values)
    {
        for (Number value : values) {
            zero += value.intValue();
        }
        return zero;
    }
1305912
@Override
    public Double reduce(List<Double> values) {
        Double product = 1.0;

        for (Double value : values) {
            if (value == null) {
                continue;
            }
            product *= value;
        }
        return product;
    }
131578
public static int max(int[] values)
    {
        int max = Integer.MIN_VALUE;

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

        return max;
    }
1005569
public static long sum (long zero, Iterable<? extends Number> values)
    {
        for (Number value : values) {
            zero += value.longValue();
        }
        return zero;
    }
456285
protected double multiply(double[][] mat, double[] in, double[] out) {
    double l = 0.;
    // Matrix multiplication:
    for(int d1 = 0; d1 < in.length; d1++) {
      final double[] row = mat[d1];
      double t = 0.;
      for(int d2 = 0; d2 < in.length; d2++) {
        t += row[d2] * in[d2];
      }
      out[d1] = t;
      l += t * t;
    }
    return l > 0 ? FastMath.sqrt(l) : 0.;
  }
321894
public static /*@pure@*/ double info(int counts[]) {
    
    int total = 0;
    double x = 0;
    for (int j = 0; j < counts.length; j++) {
      x -= xlogx(counts[j]);
      total += counts[j];
    }
    return x + xlogx(total);
  }
641877
public NumberExpression<T> sum() {
        if (sum == null) {
            sum = Expressions.numberOperation(getType(), Ops.AggOps.SUM_AGG, mixin);
        }
        return sum;
    }
451327
function() {
    var m = 0, n = this.elements.length, k = n, i;
    do { i = k - n;
      if (Math.abs(this.elements[i]) > Math.abs(m)) { m = this.elements[i]; }
    } while (--n);
    return m;
  }
571895
public static int whichMin(int[] x) {
        int m = x[0];
        int which = 0;

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

        return which;
    }
110827
public int sum() {
        int total = 0;
        int N = getNumElements();
        for (int i = 0; i < N; i++) {
            if( data[i] )
                total += 1;
        }
        return total;
    }
645698
public static Integer[] splitNumSeq(final String numSeq) {
    if (isEmpty(numSeq)) { return null; }
    String[] numArray = split(numSeq, ',');
    Set<Integer> numSet = CollectUtils.newHashSet();
    for (int i = 0; i < numArray.length; i++) {
      String num = numArray[i];
      if (num.contains("-")) {
        String[] termFromTo = split(num, '-');
        int from = Numbers.toInt(termFromTo[0]);
        int to = Numbers.toInt(termFromTo[1]);
        for (int j = from; j <= to; j++) {
          numSet.add(Integer.valueOf(j));
        }
      } else {
        numSet.add(new Integer(num));
      }
    }
    Integer[] nums = new Integer[numSet.size()];
    numSet.toArray(nums);
    return nums;
  }
1367356
@Override
  public Double product11(Double arg1, Double arg2) {
    if (arg1 == null || arg2 == null) {
      return Double.NaN;
    } else {
      return arg1 * arg2;
    }
  }
157963
public NumberExpression<Integer> numGeometries() {
        if (numGeometries == null) {
            numGeometries = Expressions.numberOperation(Integer.class, SpatialOps.NUM_GEOMETRIES, mixin);
        }
        return numGeometries;
    }
1217325
public int getNumWeights() {
    if (weights == null) return 0;
    int numWeights = 0;
    for (double[] wts : weights) {
      numWeights += wts.length;
    }
    return numWeights;
  }
174977
public static int count(int[] array, int value) {
        int count = 0;
        for (int i = 0; i < array.length; i++) {
            if (array[i] == value) {
                count++;
            }
        }
        return count;
    }
1109299
public static int count(final Object array) {

    if (isArray(array)) {
      return Array.getLength(array);
    } else if (array != null) {
      throw new IllegalArgumentException("Given data is not an array.");
    } else {
      return 0;
    }
  }