Class Ranks
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryFunction
com.singularsys.extensions.statistical.ListReturningFunction
com.singularsys.extensions.statistical.Ranks
- All Implemented Interfaces:
MatrixFunctionI,JepComponent,PostfixMathCommandI,Serializable
PostfixMathCommand to return the rank of all the elements in a list. Result
of an array of doubles, one per element of the input. Various conventions for
calculating ranks can be used
- See Also:
-
Nested Class Summary
Nested Classes -
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
ConstructorsConstructorDescriptionRanks(Ranks.Type type, boolean descending, FieldI f) Construct the rank function.Ranks(Ranks.Type type, boolean descending, 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 functionReturn a description of the function from the properties file.Gets 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, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Constructor Details
-
Ranks
Construct the rank function.- Parameters:
type- Method used to calculate ranks,Type.COMPETITIONis standarddescending- whether ranks are calculated in descending (standard) or ascending order. In descending order the highest term has a rank of 1.f- field
-
Ranks
-
-
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
-
getDescription
Description copied from class:PostfixMathCommandReturn a description of the function from the properties file. The property name is the class name followed by ".description". The property is found using theJepMessagesclass, which can be configured to add additional properties files. IfPostfixMathCommand.setDescription(String)has been called, return the description set by that method instead.- Specified by:
getDescriptionin interfacePostfixMathCommandI- Overrides:
getDescriptionin classPostfixMathCommand- Returns:
- the description of the function
-