Package com.singularsys.jep.functions

Classes that implement the built-in functions and operators.

See:
          Description

Interface Summary
CallbackEvaluationI Functions which require greater control over their evaluation should implement this interface.
CallbackEvaluationI.Runnable Callback functions which have a working run(stack) method.
LValueI  
 

Class Summary
Abs Absolute value function for Numbers it returns the absolute value of same type for Complex it returns the Modulus.
Add Addition function.
ArcCosine The acos function.
ArcCosineH Implements the arcCosH function.
ArcSine  
ArcSineH Implements the arcSinH function.
ArcTangent  
ArcTangent2 atan2(y, x) Returns the angle whose tangent is y/x.
ArcTanH Implements the arcTanH function.
Arg Argument of a complex number
ArrayFunctionBase Base class for functions that operate on arrays such as Average, MinMax, and VSum.
Assign An assignment operator so we can do x=3+4.
Average Average function class, calculates the average of all its arguments.
BinaryFunction Convenient base class for binary functions.
Binomial Binomial coefficients: binom(n,i).
Ceil A PostfixMathCommandI which find the smallest integer above the number ceil(pi) give 4 ceil(-i) give -3
Comparative Implements the comparative operations <, >, <=, >=, !
ComplexPFMC Converts a pair of real numbers to a complex number Complex(x,y)=x+i y.
Conjugate The complex conjugate of a number conj(c)
Cosecant  
Cosine  
CosineH  
Cotangent The cotangent function.
Cross The cross product of two 3D vectors.
Divide  
Dot The dot product of two vectors.
Ele Function which allows array access using the a[3] notation on left and right hand side.
Exp The exp function.
Floor A PostfixMathCommandI which find the largest integer above the number floor(pi) give 3 floor(-i) give -4
Identity A Unary operator which does nothing, used for unary plus +x.
If The if(condExpr, posExpr, negExpr) function.
Imaginary  
LazyLogical A version of the logical operators which use lazy evaluation.
List The list function.
Logarithm Log base 10.
LogBase2 Log base 2.
Logical Logical operators AND and OR.
MinMax Minimum and Maximum functions.
Modulus Calculates the modulus x % y of the arguments.
Multiply  
NaryBinaryFunction Convenient base class for n-ary functions backed by a binary operation.
NaryFunction Convenient base class for nary functions.
NaturalLogarithm Natural logarithm.
Not Implementation of the not function.
Polar Converts an [r,theta] pair to a complex number r * e^(i theta).
PostfixMathCommand Function classes extend this class.
Power Computes the power of an number.
Random Encapsulates the Math.random() function.
Real  
RInt A PostfixMathCommandI which rounds a number to the closest integer.
Round A PostfixMathCommandI which rounds a number.
Secant The secant function. sec(x)=1/cos(x).
Signum The signum function returns -1 if x<0, 1 if x>0, 0 if x==0.
Sine  
SineH Hyperbolic sin.
SquareRoot Square root function.
Str Converts an object into its string representation.
StrictNaturalLogarithm A strict version of Natural logarithm.
Subtract  
Sum Adds it arguments sum(1,2,3,4,5) will be 15.
Tangent The tan function.
TanH Hyperbolic tan.
UMinus  
UnaryFunction Convenient base class for unary functions.
VSum Summation function which expands the arguments.
 

Enum Summary
ArrayFunctionBase.ZeroLengthErrorBehaviour How to respond to a zero length array as argument
 

Exception Summary
IllegalParameterException Represents an illegal parameter
 

Package com.singularsys.jep.functions Description

Classes that implement the built-in functions and operators.

There are several base classes and interfaces which can be used:

PostfixMathCommandI
The basic interface all functions should implement. Defines a void run(Stack aStack) method.
PostfixMathCommand
Base class for most functions
UnaryFunction
Base class for unary functions, just need to implement a Object eval(Object arg) method.
BinaryFunction
Base class for binary functions, just need to implement Object eval(Object l,Object r) method.
NaryBinaryFunction
Base class for n-ary functions backed by an associative operation like +,*. just need to implement Object eval(Object l,Object r) method.
CallbackEvaluationI
Interface for classes which need access to the parse-tree, for example lazy evaluation functions like && and || which do not need to evaluate all their arguments, or assignment operators which need access to a variable and not just its value.
The com.singularsys.jep.reals package also define some interfaces for functions which take double arguments and return double results, which can be quicker in special purpose evaluators.



Copyright © 2010 Singular Systems http://www.singularsys.com/jep