Utility function for array sums.
@method _arraySum
@private
776540
function(arr){
		var ct = 0;
		for(var i = 0; i < arr.length; ct+=arr[i++]){}
		return ct;
	}
1001743
def sum(self):
        
        results = [x.ufuncs.sum() for x in self.elem]
        return np.sum(results)
660914
function arrayHas(value, array) {
    error_if_not_array_1.errorIfNotArray(array);
    return (array.length > 0 && (array_get_indexes_1.getFirstIndexOf(value, array) > -1));
}
1337793
function arrayMin(data) {
	var i = data.length,
		min = data[0];

	while (i--) {
		if (data[i] < min) {
			min = data[i];
		}
	}
	return min;
}
421147
function sum(input, initial) {

    return (!isArray(input)) ? input :
        input.reduce(function(prev, curr) {
            return prev + curr;
        }, initial || 0);
}
748677
function(data){
			var rows = this.calculateRowsNumber();
			var datas = [];
			for(var i = 0; i < data.length; i += rows){
				datas.push(data.slice(i, i+rows));
			}
			return datas;
		}
117434
function reduce(array, callback) {
    var accumulator = null;
    each(array, function(value, index) {
      accumulator = callback(accumulator, value, index, array);
    });
    return accumulator;
  }
607447
function last(array) {
      var length = array == null ? 0 : array.length;
      return length ? array[length - 1] : undefined$1;
    }
270283
function() {
            	var v = [];
            	
            	for(var i = 1; i <= this.cols(); i++) {
            	    for(var j = 1; j <= this.rows(); j++) {
            		v.push(this.e(j, i));
            	    }
            	}

            	return $V(v);
                }
140582
function() {
                  var dim = this.dimensions();
                  var r = [];
                  for (var i = 1; i <= dim.cols; i++) {
                    r.push(this.col(i).sum() / dim.rows);
                  }
                  return $V(r);
                }
187924
function _calculateTotals() {
        if (empty($this->_calculateTotals)) {
            return;
        }

        $this->addSeparator();

        $totals = array();
        foreach ($this->_data as $row) {
            if (is_array($row)) {
                foreach ($this->_calculateTotals as $columnID) {
                    $totals[$columnID] += $row[$columnID];
                }
            }
        }

        $this->_data[] = $totals;
        $this->_updateRowsCols();
    }
837093
function areArrays () {
  for (let i = 0; i < arguments.length; i++) {
    if (!Array.isArray(arguments[i])) {
      return false;
    }
  }
  
  return true;
}
904700
function(srcArr, dstLength){
		var barW	= Math.floor(srcArr.length / dstLength);
		var nBar	= Math.floor(srcArr.length / barW);
		var arr		= []
		for(var x = 0, arrIdx = 0; x < srcArr.length; arrIdx++){
			var sum	= 0;
			for(var i = 0; i < barW; i++, x++){
				sum += srcArr[x];
			}
			var average	= sum/barW;
			arr[arrIdx]	= average;
		}
		return arr;
	}
1342881
function ( array1, array2 ) {
		var result = [];

		array.each( array1, function ( i ) {
			if ( !array.contains( array2, i ) ) {
				array.add( result, i );
			}
		});

		array.each( array2, function ( i ) {
			if ( !array.contains( array1, i ) ) {
				array.add( result, i );
			}
		});

		return result;
	}
431428
function arrayFunction(item, index) {
      return function(data, cb) {
        if (iterator.length === 2) {
          iterator(item, cb);
        } else if (iterator.length === 3) {
          iterator(item, index, cb);
        } else {
          iterator(item, index, data, cb);
        }
      };
    }
1114977
public static double sum(Array array) throws ExpressionException {
	if (array.getDimension() > 1) throw new ExpressionException("can only get sum/avg from 1 dimensional arrays");

	double rtn = 0;
	int len = array.size();
	// try {
	for (int i = 1; i <= len; i++) {
	    rtn += _toDoubleValue(array, i);
	}
	/*
	 * } catch (PageException e) { throw new
	 * ExpressionException("exception while execute array operation: "+e.getMessage()); }
	 */
	return rtn;
    }
1019242
function combineMultipleArrays(arrays, func, thisArg) {
  if (arrays.length === 0) {
    throw new Error('cannot combine an empty list of arrays');
  }
  thisArg = isUndefined(thisArg) ? null : thisArg;

  // Check lengths
  var numArgs = arrays.length;
  var isSingle = allocArray(numArgs);
  var numElems = 1;
  var j;
  for (j = 0; j < numArgs; j++) {
    if (arrays[j].length === 1) {
      isSingle[j] = true;
    } else {
      isSingle[j] = false;
      if (numElems === 1) {
        numElems = arrays[j].length;
      } else if (numElems !== arrays[j].length) {
        throw new Error('length mismatch: expected ' + numElems +
          ' elements but found ' + arrays[j].length);
      }
    }
  }

  // Apply func element-wise
  var resultArray = allocArray(numElems);
  var argArray = allocArray(numArgs);
  for (var i = 0; i < numElems; i++) {
    for (j = 0; j < numArgs; j++) {
      argArray[j] = isSingle[j] ? arrays[j][0] : arrays[j][i];
    }
    resultArray[i] = func.apply(thisArg, argArray);
  }

  return resultArray;
}