Class SortElements
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryFunction
com.singularsys.extensions.statistical.ListReturningFunction
com.singularsys.extensions.statistical.SortElements
- All Implemented Interfaces:
MatrixFunctionI,JepComponent,PostfixMathCommandI,Serializable
PostfixMathCommand to sort elements in a list. Flatten arrays so not
suitable for matrices
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.extensions.statistical.ListReturningFunction
listFun, lpFields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, description, name, NaN, numberOfParameters -
Constructor Summary
ConstructorsConstructorDescriptionSortElements(boolean increasing, FieldI f) Construct the rank function.SortElements(boolean increasing, FieldI f, MatrixFactoryI mf) -
Method Summary
Modifier and TypeMethodDescriptioncalcDims(Dimensions... inDims) Attempts to calculate the dimensions of a result of a PostfixMathCommand.booleancheckNumberOfParameters(int n) Checks the number of parameters of the function.Evaluate the functionGets a light-weight instance suitable for using in multiple threads.Methods inherited from class com.singularsys.extensions.statistical.ListReturningFunction
convertToList, initMethods inherited from class com.singularsys.jep.functions.NaryFunction
runMethods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Constructor Details
-
SortElements
Construct the rank function.- Parameters:
increasing- whether ranks are calculated in increasing (standard) or ascending order. In increasing order the highest term has a rank of 1.f- field
-
SortElements
-
-
Method Details
-
checkNumberOfParameters
public boolean checkNumberOfParameters(int n) Description copied from class:PostfixMathCommandChecks the number of parameters of the function. Functions which set numberOfParameter=-1 should overload this method- Specified by:
checkNumberOfParametersin interfacePostfixMathCommandI- Overrides:
checkNumberOfParametersin classPostfixMathCommand- Parameters:
n- number of parameters function will be called with.- Returns:
- false if an illegal number of parameters is supplied, true otherwise.
-
eval
Description copied from class:NaryFunctionEvaluate the function- Specified by:
evalin classNaryFunction- Parameters:
args- arguments to the function- Returns:
- value returned by the function
- Throws:
EvaluationException- if the calculation cannot be performed
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Returns:
- either a new instance, null or 'this'.
-
calcDims
Description copied from interface:MatrixFunctionIAttempts to calculate the dimensions of a result of a PostfixMathCommand.- Parameters:
inDims- the dimensions of each argument- Returns:
- the dimension of the result, or null, if it cannot be calculated
-