This returns the sum of products for the given
numbers.
@param nums the sum of products for the give numbers
@return the sum of products for the given numbers
439547
public static double sumOfProducts(double[]... nums) {
        if (nums == null || nums.length < 1)
            return 0;
        double sum = 0;

        for (int i = 0; i < nums.length; i++) {
            /* The ith column for all of the rows */
            double[] column = column(i, nums);
            sum += times(column);

        }
        return sum;
    }
543931
public static String sum(String... addends) {

        if (addends == null || addends.length == 0) {
            return null;
        }

        BigDecimal sum;
        try {
            sum = new BigDecimal(addends[0]);
            for (int i = 1; i < addends.length; i++) {
                sum = sum.add(new BigDecimal(addends[i]));
            }
            return sum.toString();
        } catch (Exception e) {
            return null;
        }
    }
1045701
public static long sum(long[] array) {
		if (array == null) {
			return 0L;
		}
		long sum = 0;
		for (int i = 0; i < array.length; i++) {
			sum += array[i];
		}
		return sum;
	}
788517
public TreeMap<Bits, Long> computeSums() {
    final TreeMap<Bits, Long> sums = new TreeMap<Bits, Long>();
    long total = 0;
    for (final Entry<Bits, AtomicInteger> e : this.map.entrySet()) {
      sums.put(e.getKey(), total += e.getValue().get());
    }
    return sums;
  }
999347
static double computeFinalSum(double[] summands) {
        // Better error bounds to add both terms as the final sum
        double tmp = summands[0] + summands[1];
        double simpleSum = summands[summands.length - 1];
        if (Double.isNaN(tmp) && Double.isInfinite(simpleSum))
            return simpleSum;
        else
            return tmp;
    }
157963
public NumberExpression<Integer> numGeometries() {
        if (numGeometries == null) {
            numGeometries = Expressions.numberOperation(Integer.class, SpatialOps.NUM_GEOMETRIES, mixin);
        }
        return numGeometries;
    }
1000541
@Override
    public <N extends Number> Expression<N> sum(Expression<N> arg0)
    {
        // TODO Auto-generated method stub
        return null;
    }
934205
public double sum(PairDblInt[] cols) {
	double res = 0.0;
	
	for (int i = 0; i < numLabels; i++) {
	    res += cols[i].first;
	}
	
	if (res < 1 && res > -1) {
	    res = 1;
	}
	
	return res;
    }
340350
public static int[][] copyOf(final int[][] nums) {
        final int[][] copy = new int[nums.length][];

        for (int i = 0; i < copy.length; i++) {
            final int[] member = new int[nums[i].length];
            System.arraycopy(nums[i], 0, member, 0, nums[i].length);
            copy[i] = member;
        }

        return copy;
    }
512260
Double getSum() {
      if (count == 0) {
         return null;
      }
      // Better error bounds to add both terms as the final sum
      double tmp = sum + sumCompensation;
      if (Double.isNaN(tmp) && Double.isInfinite(simpleSum)) {
         // If the compensated sum is spuriously NaN from
         // accumulating one or more same-signed infinite values,
         // return the correctly-signed infinity stored in simpleSum.
         return simpleSum;
      } else {
         return tmp;
      }
   }
1033293
public static function sumCollection(array $numbers, int $target): ?array {
        $size = count($numbers);
        if ($size < 3) return null;
        $collection = [];

        for ($i = 0; $i < $size; $i++) {
            for ($j = $i + 1; $j < $size; $j++) {
                for ($k = $j + 1; $k < $size; $k++) {
                    $sum = $numbers[$i] + $numbers[$j] + $numbers[$k];

                    if ($sum === $target) {
                        $collection[] = [$i, $j, $k];
                        $sum = 0;
                    }
                    if ($sum > $target) continue;
                }
            }
        }
        return $collection;
    }
233744
public double num()
  {

    int node = item(0);
    return (node != DTM.NULL) ? getNumberFromNode(node) : Double.NaN;
  }
1270377
public double sum() {
        double sum = 0;
        TIntDoubleIterator iter = edges.iterator();
        while (iter.hasNext()) {
            iter.advance();
            sum += iter.value();
        }
        return sum;
    }
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;
    }
627972
public static Object sum(Object[] self, Object initialValue) {
        return sum(toList(self), initialValue, false);
    }
1071252
private void computeSumItemSizes() {
        for (int d = 0; d < nbDims; d++) {
            long sum = 0;
            for (int i = 0; i < iSizes[d].length; i++) {
                sum += iSizes[d][i];
            }
            this.sumISizes[d] = sum;
        }

    }
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;
  }