public class VSum extends ArrayFunctionBase
Sum
function which does not expand
them. The result of sum([1,2],[3,4]) in contrast would be [4,6].
ArrayFunctionBase.ZeroLengthErrorBehaviour
Modifier and Type | Field and Description |
---|---|
protected Add |
add |
curNumberOfParameters, name, NaN, numberOfParameters
Constructor and Description |
---|
VSum() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
calc(java.util.List<java.lang.Object> v)
Abstract method for performing the array calculation.
|
java.lang.Object |
sum(java.util.List<java.lang.Object> vals)
Returns the sum of a set of values.
|
addToArray, checkNumberOfParameters, getZeroLengthErrorBehaviour, run, setZeroLengthErrorBehaviour, throwAtLeastOneExcep
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString, toString
protected Add add
public java.lang.Object sum(java.util.List<java.lang.Object> vals) throws EvaluationException
vals
- Values to be averagedEvaluationException
- if the calculation cannot be performedprotected java.lang.Object calc(java.util.List<java.lang.Object> v) throws EvaluationException
ArrayFunctionBase
calc
in class ArrayFunctionBase
v
- The list to operate on. Note this is in reverse order of the arguments of the function.EvaluationException
- if the calculation cannot be performedCopyright © 2018 Singular Systems http://www.singularsys.com/jep