jv.thirdParty.expr
Class Expr
- java.lang.Object
-
- jv.thirdParty.expr.Expr
-
- All Implemented Interfaces:
- java.io.Serializable
public abstract class Expr extends java.lang.Object implements java.io.SerializableA mathematical expression, built out of literal numbers, variables, arithmetic operators, and elementary functions. The operator names are from java.lang.Math.- See Also:
- Serialized Form
- Author:
- Darius Bacon
- Version:
- 30.08.08, 2.00 revised (kp) Handling of complex functions added.
07.07.99, 1.20 revised (kp) New functions added: cot, acot, acosh, asinh, atanh, acoth, sign.
31.01.99, 1.10 revised (kp) New functions added: cosh, sinh, tanh, coth.
00.00.96, 1.00 created (Darius Bacon) Original version
-
-
Field Summary
Fields Modifier and Type Field and Description static intABSAbsolute value.static intACOSArcus cosine.static intACOSHArea cosinus hyperbolicus.static intACOTArcus cotangens.static intACOTHArea cotangens hyperbolicus.static intADDBinary operator.static intARGArgument of complex number from principal branch, 0 for real numbers.static intASINArcus sine.static intASINHArea sinus hyperbolicus.static intATANArcus tangens.static intATANHArea tangens hyperbolicus.static intCEILUnary operator.static intCMPLXComplex real component, same for real numbers (kp)static intCONJComplex conjugate, identity for real numbers.static intCOSCosine.static intCOSHCosinus hyperbolicus.static intCOTCotangens.static intCOTHCotangens hyperbolicus.static intDIVBinary operator.static intEXPExponential function.static intFLOORUnary operator.static intIMComplex real component, same for real numbers (kp)static intINVComplex inversion 1/z, same for real numbers (kp)static intLOGNatural logarithm, principal branch of complex log.static intMULBinary operator.static intNEGNegative.static intPOWBinary operator.static intREComplex real component, same for real numbers (kp)static intROUNDUnary operator.static intSIGNSign of argument.static intSINSine.static intSINHSinus hyperbolicus.static intSQRTSquare rootstatic intSUBBinary operator.static intTANTangens.static intTANHTangens hyperbolicus.static intTYPE_COMPLEXstatic intTYPE_DEPENDSstatic intTYPE_REALType of an expression.
-
Constructor Summary
Constructors Constructor and Description Expr()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract booleancontains(Variable var)Check if current expression uses the given variable.abstract PuComplexgetComplexValue()Return the complex value given the current variable values.abstract doublegetValue()Return the value given the current variable values.booleanisComplex()Return whether double or complex.static Exprmake_app1(int rator, Expr rand)Create a unary expression.static Exprmake_app2(int rator, Expr rand0, Expr rand1)Create a binary expression.voidsetComplex(boolean bVal)Return whether double or complex.
-
-
-
Field Detail
-
ADD
public static final int ADD
Binary operator.- See Also:
- Constant Field Values
-
SUB
public static final int SUB
Binary operator.- See Also:
- Constant Field Values
-
MUL
public static final int MUL
Binary operator.- See Also:
- Constant Field Values
-
DIV
public static final int DIV
Binary operator.- See Also:
- Constant Field Values
-
POW
public static final int POW
Binary operator.- See Also:
- Constant Field Values
-
ABS
public static final int ABS
Absolute value.- See Also:
- Constant Field Values
-
ACOS
public static final int ACOS
Arcus cosine.- See Also:
- Constant Field Values
-
ASIN
public static final int ASIN
Arcus sine.- See Also:
- Constant Field Values
-
ATAN
public static final int ATAN
Arcus tangens.- See Also:
- Constant Field Values
-
ACOT
public static final int ACOT
Arcus cotangens. (kp)- See Also:
- Constant Field Values
-
CEIL
public static final int CEIL
Unary operator.- See Also:
- Constant Field Values
-
COS
public static final int COS
Cosine.- See Also:
- Constant Field Values
-
EXP
public static final int EXP
Exponential function.- See Also:
- Constant Field Values
-
FLOOR
public static final int FLOOR
Unary operator.- See Also:
- Constant Field Values
-
LOG
public static final int LOG
Natural logarithm, principal branch of complex log.- See Also:
- Constant Field Values
-
NEG
public static final int NEG
Negative.- See Also:
- Constant Field Values
-
ROUND
public static final int ROUND
Unary operator.- See Also:
- Constant Field Values
-
SIN
public static final int SIN
Sine.- See Also:
- Constant Field Values
-
SQRT
public static final int SQRT
Square root- See Also:
- Constant Field Values
-
TAN
public static final int TAN
Tangens.- See Also:
- Constant Field Values
-
COT
public static final int COT
Cotangens. (kp)- See Also:
- Constant Field Values
-
SINH
public static final int SINH
Sinus hyperbolicus. (kp)- See Also:
- Constant Field Values
-
COSH
public static final int COSH
Cosinus hyperbolicus. (kp)- See Also:
- Constant Field Values
-
TANH
public static final int TANH
Tangens hyperbolicus. (kp)- See Also:
- Constant Field Values
-
COTH
public static final int COTH
Cotangens hyperbolicus. (kp)- See Also:
- Constant Field Values
-
ASINH
public static final int ASINH
Area sinus hyperbolicus. (kp)- See Also:
- Constant Field Values
-
ACOSH
public static final int ACOSH
Area cosinus hyperbolicus. (kp)- See Also:
- Constant Field Values
-
ATANH
public static final int ATANH
Area tangens hyperbolicus. (kp)- See Also:
- Constant Field Values
-
ACOTH
public static final int ACOTH
Area cotangens hyperbolicus. (kp)- See Also:
- Constant Field Values
-
SIGN
public static final int SIGN
Sign of argument. (kp)- See Also:
- Constant Field Values
-
ARG
public static final int ARG
Argument of complex number from principal branch, 0 for real numbers. (kp)- See Also:
- Constant Field Values
-
CONJ
public static final int CONJ
Complex conjugate, identity for real numbers. (kp)- See Also:
- Constant Field Values
-
INV
public static final int INV
Complex inversion 1/z, same for real numbers (kp)- See Also:
- Constant Field Values
-
RE
public static final int RE
Complex real component, same for real numbers (kp)- See Also:
- Constant Field Values
-
IM
public static final int IM
Complex real component, same for real numbers (kp)- See Also:
- Constant Field Values
-
CMPLX
public static final int CMPLX
Complex real component, same for real numbers (kp)- See Also:
- Constant Field Values
-
TYPE_REAL
public static final int TYPE_REAL
Type of an expression.- See Also:
- Constant Field Values
-
TYPE_COMPLEX
public static final int TYPE_COMPLEX
- See Also:
- Constant Field Values
-
TYPE_DEPENDS
public static final int TYPE_DEPENDS
- See Also:
- Constant Field Values
-
-
Method Detail
-
isComplex
public boolean isComplex()
Return whether double or complex.
-
setComplex
public void setComplex(boolean bVal)
Return whether double or complex.
-
getComplexValue
public abstract PuComplex getComplexValue()
Return the complex value given the current variable values.
-
getValue
public abstract double getValue()
Return the value given the current variable values.
-
contains
public abstract boolean contains(Variable var)
Check if current expression uses the given variable.
-
make_app1
public static Expr make_app1(int rator, Expr rand)
Create a unary expression.- Parameters:
rator- unary operatorrand- operand
-
-
"