|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjmathlib.core.interpreter.RootObject
jmathlib.core.tokens.Token
jmathlib.core.tokens.OperandToken
jmathlib.core.tokens.DataToken
jmathlib.core.tokens.NumberToken
jmathlib.core.tokens.numbertokens.DoubleNumberToken
public class DoubleNumberToken
| Field Summary | |
|---|---|
static DoubleNumberToken |
j
Constant value set to j |
static DoubleNumberToken |
one
Constant value set to 1 |
static DoubleNumberToken |
zero
Constant value set to 0 |
| Fields inherited from class jmathlib.core.tokens.NumberToken |
|---|
IMAG, numFormat, REAL |
| Fields inherited from class jmathlib.core.tokens.DataToken |
|---|
dataType, noElem, sizeA, sizeX, sizeY |
| Fields inherited from class jmathlib.core.tokens.Token |
|---|
priority |
| Fields inherited from interface jmathlib.core.constants.TokenConstants |
|---|
ADDSUB_PRIORITY, AND_PRIORITY, ANDAND_PRIORITY, ASSIGN_PRIORITY, BRACKET_PRIORITY, COMPARE_PRIORITY, CONCAT, MATRIX, MULDIV_PRIORITY, OR_PRIORITY, OROR_PRIORITY, PARAMETER, POWER_PRIORITY, RELATION_PRIORITY, SINGLE, ttDelimiter, ttNotSet, ttOperand, ttOperator |
| Fields inherited from interface jmathlib.core.constants.ErrorCodes |
|---|
ERR_BRACKET_OPEN, ERR_BRACKET_ORDER, ERR_FUNCTION_NOT_FOUND, ERR_FUNCTION_NOT_IMPLEMENTED, ERR_INSUFFICIENT_PARAMETERS, ERR_INVALID_PARAMETER, ERR_LVALUE_REQUIRED, ERR_MATRIX_SINGULAR, ERR_NOT_SQUARE_MATRIX, ERR_OPNOTSUPPORTED, ERR_TOO_MANY_PARAMETERS, ERR_USER_ERROR, ERR_VARIABLE_NOTDEFINED, OK, OK_FUNCTION_PROCESS |
| Constructor Summary | |
|---|---|
DoubleNumberToken()
Constructor creating empty number token |
|
DoubleNumberToken(double _value)
Constructor creating a scalar taking the numbers value as a double |
|
DoubleNumberToken(double[][] _values)
Constructor taking the numbers value as a double[][] |
|
DoubleNumberToken(double[][][] _values)
Constructor taking the numbers value as a double[][][] |
|
DoubleNumberToken(double[][] _real,
double[][] _imaginary)
Constructor taking the numbers value as two double[][] |
|
DoubleNumberToken(double _real,
double _imaginary)
Constructor taking the numbers value as a pair of double values representing real and imaginary part |
|
DoubleNumberToken(int[] _sizeA,
double[] _reValues,
double[] _imValues)
Constructor for multidimensional array |
|
DoubleNumberToken(int _dy,
int _dx,
double[] _reValues,
double[] _imValues)
|
|
DoubleNumberToken(java.lang.String _real,
java.lang.String _imaginary)
Constructor taking the numbers value as a string |
|
| Method Summary | |
|---|---|
OperandToken |
add(OperandToken arg)
add arg to this object for a number token |
double |
arg(int y,
int x)
calculate the arg of the complex number at y, x |
OperandToken |
conjugate()
Complex function - calculates the complex conjugate of the number |
OperandToken |
ctranspose()
calculate the conjugate transpose of a matrix |
double[] |
divide(double[] arg1,
double[] arg2)
divide two complex numbers and return a complex number again, pay special attention to infinity and not a number |
OperandToken |
divide(OperandToken arg)
divide this object by arg for a number token |
boolean |
equals(java.lang.Object arg)
Check if two tokens are equal |
OperandToken |
factorial()
Standard functions - calculates the factorial of the number |
double |
factorial(double amount)
Calulates the factorial of a real value |
OperandToken |
getElement(int n)
|
DataToken |
getElementSized(int y,
int x)
return a new Number Token of size y*x |
int |
getIntValue(int y,
int x)
|
double[][] |
getReValues()
|
double |
getValueAbs(int y,
int x)
|
double |
getValueArg(int y,
int x)
|
double[] |
getValueComplex(int n)
|
double[] |
getValueComplex(int y,
int x)
|
double |
getValueIm()
|
double |
getValueIm(int n)
|
double |
getValueIm(int[] index)
|
double |
getValueIm(int y,
int x)
|
double |
getValueRe()
|
double |
getValueRe(int n)
|
double |
getValueRe(int[] index)
|
double |
getValueRe(int y,
int x)
|
double[][] |
getValuesIm()
|
double[][] |
getValuesRe()
|
boolean |
isComplex()
|
boolean |
isImaginary()
|
boolean |
isNull()
Checks if this operand is zero |
boolean |
isReal()
|
OperandToken |
leftDivide(OperandToken arg)
left divide |
OperandToken |
mPower(OperandToken arg)
The value to raise it to the matrix power of |
double[] |
multiply(double[] arg1,
double[] arg2)
Multiplies two complex numbers |
OperandToken |
multiply(OperandToken arg)
multiply arg by this object for a number token |
OperandToken |
negate()
standard function - returns the negative of the number |
OperandToken |
power(OperandToken arg)
Raise this object to the power of arg |
OperandToken |
scalarDivide(OperandToken arg)
scalar divide arg by this object for a number token |
OperandToken |
scalarLeftDivide(OperandToken arg)
scalar left divide |
OperandToken |
scalarMultiply(OperandToken arg)
scalar multiply arg by this object for a number token |
void |
setElement(int n,
OperandToken num)
|
void |
setSize(int dy,
int dx)
increase/decrease the size of the current DoubleNumberToken to size y*x |
void |
setValue(int[] index,
double _real,
double _imag)
|
void |
setValue(int n,
double _real,
double _imag)
|
void |
setValue(int y,
int x,
double _real,
double _imag)
Set value at position y, x |
void |
setValueComplex(int n,
double[] _value)
|
void |
setValueComplex(int y,
int x,
double[] _value)
Set value at position y, x |
OperandToken |
subtract(OperandToken arg)
subtract arg from this object for a number token |
java.lang.String |
toString()
return the number as a string |
java.lang.String |
toString(double[] _values)
create string representation of (complex) double values |
OperandToken |
transpose()
calculate the transpose of a matrix |
| Methods inherited from class jmathlib.core.tokens.NumberToken |
|---|
evaluate, getElement, index2n, isNumeric, isScalar, setElement, toString, yx2n |
| Methods inherited from class jmathlib.core.tokens.DataToken |
|---|
checkEqualDimensions, getDataType, getDimensions, getNumberOfElements, getSize, getSizeX, getSizeY |
| Methods inherited from class jmathlib.core.tokens.OperandToken |
|---|
asArray, Children, derivative, expand, integral, isLeaf, mpower, simplify, subst |
| Methods inherited from class jmathlib.core.tokens.Token |
|---|
isDisplayResult, setDisplayResult, toMathMlString |
| Methods inherited from class jmathlib.core.interpreter.RootObject |
|---|
clone, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final DoubleNumberToken one
public static final DoubleNumberToken zero
public static final DoubleNumberToken j
| Constructor Detail |
|---|
public DoubleNumberToken()
public DoubleNumberToken(double _value)
_value - = the numbers value as a doublepublic DoubleNumberToken(double[][] _values)
_value - = the numbers value as a 2D array of double
public DoubleNumberToken(java.lang.String _real,
java.lang.String _imaginary)
_real - = the numbers real value as a string_imaginary - = the numbers imaginary value as a string
public DoubleNumberToken(double _real,
double _imaginary)
_real - = the numbers real value as a double_imaginary - = the numbers imaginary value as a double
public DoubleNumberToken(double[][] _real,
double[][] _imaginary)
_real - = the numbers value as a 2D array of double_imaginary - = the numbers value as a 2D array of doublepublic DoubleNumberToken(double[][][] _values)
_values - = the numbers value as a 3D array of double
public DoubleNumberToken(int _dy,
int _dx,
double[] _reValues,
double[] _imValues)
_dy - _dx - _reValues - _imValues -
public DoubleNumberToken(int[] _sizeA,
double[] _reValues,
double[] _imValues)
_sizeA - _reValues - _imValues - | Method Detail |
|---|
public DataToken getElementSized(int y,
int x)
getElementSized in class DataTokenx - y -
public void setSize(int dy,
int dx)
setSize in class DataTokendy - number of rowsdx - number of columnspublic double getValueRe()
public double getValueRe(int y,
int x)
y - x -
public double getValueRe(int[] index)
index -
public double getValueRe(int n)
n -
public int getIntValue(int y,
int x)
y - x -
public double getValueIm()
public double getValueIm(int y,
int x)
y - x -
public double getValueIm(int[] index)
index -
public double getValueIm(int n)
n -
public double getValueAbs(int y,
int x)
y - x -
public double getValueArg(int y,
int x)
y - x -
public double[][] getValuesRe()
public double[][] getReValues()
public double[][] getValuesIm()
public OperandToken getElement(int n)
getElement in class DataTokenn -
public void setElement(int n,
OperandToken num)
setElement in class DataTokenn - num -
public double[] getValueComplex(int y,
int x)
y - = y position in matrixx - = x position in matrix
public double[] getValueComplex(int n)
n -
public void setValueComplex(int n,
double[] _value)
n - _value -
public void setValueComplex(int y,
int x,
double[] _value)
y - = y position in matrixx - = x position in matrix_value - = the value to set it to as an array of doubles
public void setValue(int y,
int x,
double _real,
double _imag)
y - = y position in matrixx - = x position in matrixreal - = real valueimag - = imaginary value
public void setValue(int n,
double _real,
double _imag)
n - _real - _imag -
public void setValue(int[] index,
double _real,
double _imag)
index - multidimensional index_real - _imag - public java.lang.String toString()
toString in class NumberTokenpublic java.lang.String toString(double[] _values)
_values[]={REAL,IMAG} - real and imaginary part of number
public boolean equals(java.lang.Object arg)
equals in class java.lang.Objectarg - = the object to check against
public double arg(int y,
int x)
y - x -
public OperandToken add(OperandToken arg)
add in class OperandToken= - the value to add to it
public OperandToken subtract(OperandToken arg)
subtract in class OperandToken= - the value to subtract
public OperandToken power(OperandToken arg)
power in class OperandToken= - the value to raise it to the power of
public OperandToken mPower(OperandToken arg)
mPower in class OperandTokenarg -
public OperandToken multiply(OperandToken arg)
multiply in class OperandTokenarg - = the value to multiply it by
public double[] multiply(double[] arg1,
double[] arg2)
arg1 - = the first complex number as an array of doublearg2 - = the second complex number as an array of double
public OperandToken divide(OperandToken arg)
divide in class OperandTokenarg - = the value to divide it by
public double[] divide(double[] arg1,
double[] arg2)
arg1 - = the first complex number as an array of doublearg2 - = the second complex number as an array of double
public OperandToken scalarMultiply(OperandToken arg)
scalarMultiply in class OperandTokenarg - = the amount to multiply it by
public OperandToken scalarDivide(OperandToken arg)
scalarDivide in class OperandTokenarg - = the amount to divide it by
public OperandToken leftDivide(OperandToken arg)
leftDivide in class OperandTokenpublic OperandToken scalarLeftDivide(OperandToken arg)
scalarLeftDivide in class OperandTokenpublic OperandToken transpose()
transpose in class OperandTokenpublic OperandToken ctranspose()
ctranspose in class OperandTokenpublic OperandToken negate()
negate in class OperandTokenpublic OperandToken factorial()
factorial in class OperandTokenpublic double factorial(double amount)
amount - = the number to calc the factorial of
public OperandToken conjugate()
public boolean isNull()
isNull in class OperandTokenpublic boolean isReal()
public boolean isImaginary()
public boolean isComplex()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||