|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.parser.CalcFunctions
public abstract class CalcFunctions
Enumeration of all functions that are used by CalcEngine
. The
defined functions objects override
execute(int argNum, Stack argStack)
to provide the respective
functionality. All functions get their arguments from a stack and put the
results back on the stack after successful computation.
Field Summary | |
---|---|
static CalcFunctions |
COS
cos(a), computes cosinus function for all elements of an array. |
static CalcFunctions |
FRACDIFF
fracdiff(a, d), fractional differences of a. |
static CalcFunctions |
LAGN
lagn(a,b), lags the array by b elements and fills the resulting free slots with Double.NaN . |
static CalcFunctions |
LOG
log(a), computes natural logarithm for all elements of an array. |
static CalcFunctions |
MAX
max(a,b), returns an array with the maximum elements of a
and b for each row. |
static CalcFunctions |
MEANC
meanc(a), computes the mean of all elements in an array. |
static CalcFunctions |
MIN
min(a,b), returns an array with the minimum elements of a
and b for each row. |
static CalcFunctions |
ONES
ones(a), creates an array of ones with dimension (a x 1) . |
static CalcFunctions |
REVERSE
reverse(a), reverses the order of an array, starting from observation T to 1. |
static CalcFunctions |
RNDN
rndn(a), creates an array of a random numbers between 0
and 1. |
static CalcFunctions |
ROWS
rows(a), gets the rows of an array. |
static CalcFunctions |
SIN
sin(a), computes sinus function for all elements of an array. |
static CalcFunctions |
SQRT
sqrt(a), computes square root for all elements of an array. |
static CalcFunctions |
STAND
stand(a), creates a normalized version if the array by subtracting the mean and dividing by the standard deviation. |
static CalcFunctions |
STDC
stdc(a), computes the standard deviation of all elements in an array. |
static CalcFunctions |
SUMC
sumc(a), computes the sum of all elements in an array. |
static CalcFunctions |
TAN
tan(a), computes tangens function for all elements of an array. |
static CalcFunctions |
TREND
trend(a), creates an array of numbers incremented by 1 with dimension (a x 1) , starting from 1. |
Method Summary | |
---|---|
static void |
callFunctionForName(java.lang.String functionName,
int argNum,
java.util.Stack<double[]> argStack)
Executes a function specified with a name. |
boolean |
equals(java.lang.Object o)
Override prevention method to enforce a.equals(b) if and
only if a==b . |
abstract void |
execute(int argNum,
java.util.Stack<double[]> argStack)
This defines the operation that is actually carried out by the function. |
static int |
getLength(double[] aa,
double[] bb)
Computes the correct length when 2 array are combined. |
int |
hashCode()
Override prevention method invokes super method. |
java.lang.String |
toString()
Returns the name of the runtype, do not use for comparisons. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final CalcFunctions FRACDIFF
public static final CalcFunctions SIN
public static final CalcFunctions COS
public static final CalcFunctions TAN
public static final CalcFunctions SQRT
public static final CalcFunctions LOG
public static final CalcFunctions LAGN
Double.NaN
. Lagging means, that every element
i
is replaced by the element in i-b
. The
argument b
can also be negative, which would result in a
forward shift.
public static final CalcFunctions ROWS
public static final CalcFunctions ONES
(a x 1)
.
public static final CalcFunctions TREND
(a x 1)
, starting from 1.
public static final CalcFunctions RNDN
a
random numbers between 0
and 1.
public static final CalcFunctions SUMC
public static final CalcFunctions MEANC
public static final CalcFunctions STDC
public static final CalcFunctions STAND
public static final CalcFunctions REVERSE
public static final CalcFunctions MIN
a
and b
for each row.
public static final CalcFunctions MAX
a
and b
for each row.
Method Detail |
---|
public static void callFunctionForName(java.lang.String functionName, int argNum, java.util.Stack<double[]> argStack) throws java.lang.IllegalArgumentException
functionName
- a case insensitive String with the name of the function to
callargNum
- the number of arguments to the functionargStack
- the current Stack to store the input as well as the result
java.lang.IllegalArgumentException
- in case the function does not exist or the arguments are
wrongpublic final boolean equals(java.lang.Object o)
a.equals(b)
if and
only if a==b
.
equals
in class java.lang.Object
o
- object to compare with
true
if equal, false
otherwisepublic abstract void execute(int argNum, java.util.Stack<double[]> argStack)
argNum
- the number of arguments to the functionargStack
- the current Stack to store the input as well as the resultpublic static int getLength(double[] aa, double[] bb) throws java.lang.IllegalArgumentException
aa
- double arraybb
- double array
ParseException
- if (aa.length != bb.length) && (aa.length != 1) && (bb.length !=
1)
java.lang.IllegalArgumentException
public final int hashCode()
hashCode
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |