public class ComplexSym extends ExprImpl implements IComplex
ASTID, BLANKID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(IVisitor<T> visitor)
Accept a visitor with return type T
|
boolean |
accept(IVisitorBoolean visitor)
Accept a visitor with return type
boolean |
int |
accept(IVisitorInt visitor)
Accept a visitor with return type
int |
long |
accept(IVisitorLong visitor)
Accept a visitor with return type
long |
ComplexSym |
add(ComplexSym parm1) |
IComplex |
add(IComplex parm1) |
ApcomplexNum |
apcomplexNumValue(long precision)
Get a
Apcomplex number wrapped into an
ApcomplexNum object. |
org.apfloat.Apcomplex |
apcomplexValue(long precision) |
INumber |
ceilFraction()
Returns the smallest (closest to negative infinity)
IInteger
value that is not less than this and is equal to a
mathematical integer. |
int |
compareAbsValueToOne()
Compare the absolute value of this number with
1 and return
1 , if the absolute value is greater than 1
0 , if the absolute value equals 1
-1 , if the absolute value is less than 1
|
int |
compareTo(IExpr expr)
Compares this expression with the specified expression for order.
|
ComplexNum |
complexNumValue()
Get a
ComplexNum number bject. |
int |
complexSign()
Gets the signum value of a complex number
|
IComplex |
conjugate()
Conjugate this (complex-) number.
|
IExpr |
eabs()
Get the absolute value for a given number
|
boolean |
equals(java.lang.Object obj)
Test if this is equal to b.
|
boolean |
equalsInt(int i)
Check if this number equals the given
int number? |
IExpr |
evaluate(EvalEngine engine)
Evaluate an expression
|
INumber |
floorFraction()
Returns the largest (closest to positive infinity)
IInteger
value that is not greater than this and is equal to a
mathematical integer. |
java.lang.String |
fullFormString()
Return the
FullForm() of this expression |
ISignedNumber |
getIm()
Returns the imaginary part of a complex number
|
double |
getImaginary()
Returns the imaginary part of a complex number
|
IRational |
getImaginaryPart()
Returns the imaginary part of a complex number
|
ISignedNumber |
getRe()
Returns the real part of a complex number
|
double |
getReal()
Returns the real part of a complex number
|
IRational |
getRealPart()
Returns the real part of a complex number
|
int |
hashCode()
Hashcode of this Element.
|
ISymbol |
head()
If this object is an instance of
IAST get the first element
(offset 0) of the IAST list (i.e. get(0) ). |
int |
hierarchy()
A unique integer ID for the implementation of this expression
|
java.lang.String |
internalFormString(boolean symbolsAsFactoryMethod,
int depth)
Return the internal Java form of this expression.
|
java.lang.String |
internalJavaString(boolean symbolsAsFactoryMethod,
int depth,
boolean useOperators)
Return the internal Java form of this expression.
|
java.lang.String |
internalScalaString(boolean symbolsAsFactoryMethod,
int depth)
Return the internal Scala form of this expression.
|
IExpr |
inverse()
Returns the multiplicative inverse of this object.
|
boolean |
isZero()
Test if this expression equals
0 in symbolic or numeric
mode. |
IComplex |
multiply(IComplex parm1) |
ComplexSym |
negate()
Negate this.
|
INumber |
normalize()
Return the normalized form of this number (i.e. if the imaginary part equals zero, return the real part as a fractional or
integer number).
|
INumber |
numericNumber()
Create a numeric number from this exact "symbolic" number.
|
INumber |
opposite()
Returns an
IExpr whose value is (-1) * this . |
IExpr |
plus(IExpr that)
Returns an
IExpr whose value is (this + that) . |
IComplex |
pow(int parm1) |
IExpr |
times(IExpr that)
Returns an
IExpr whose value is (this * that) . |
java.lang.String |
toString() |
static ComplexSym |
valueOf(org.apache.commons.math4.fraction.BigFraction real,
org.apache.commons.math4.fraction.BigFraction imaginary) |
static ComplexSym |
valueOf(java.math.BigInteger real) |
static ComplexSym |
valueOf(java.math.BigInteger real,
java.math.BigInteger imaginary) |
static ComplexSym |
valueOf(IFraction real) |
static ComplexSym |
valueOf(IRational real) |
static ComplexSym |
valueOf(IRational real,
IRational imaginary) |
static ComplexSym |
valueOf(long real_numerator,
long real_denominator,
long imag_numerator,
long imag_denominator) |
$div, $minus, $plus, $times, $up, abs, and, apply, apply, asType, copy, dec, divide, egcd, evalComplex, evalDouble, evalNumber, evalSignedNumber, factory, gcd, getAt, inc, leafCount, leaves, minus, mod, multiply, negative, optional, or, power, power, remainder, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceRepeated, replaceSlots, signum, subtract, sum, topHead, toScript, toScriptFactory, variables2Slots
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
$div, $minus, $plus, $times, $up, and, apply, apply, asType, dec, divide, evalComplex, evalDouble, evalNumber, evalSignedNumber, evaluateHead, getAt, getField, ifPresent, inc, isAllExpanded, isAnd, isArcCos, isArcCosh, isArcSin, isArcSinh, isArcTan, isArcTanh, isAST, isAST, isAST, isAST, isAST, isAST, isAST, isASTSizeGE, isAtom, isBlank, isComplex, isComplexInfinity, isComplexNumeric, isCondition, isConstant, isCos, isCosh, isDerivative, isDirectedInfinity, isE, isExpanded, isFalse, isFlatAST, isFraction, isFree, isFree, isFree, isFreeAST, isFreeAST, isFreeOfPatterns, isFunction, isGEOrdered, isGTOrdered, isIndeterminate, isInfinity, isInteger, isIntegerResult, isLEOrdered, isList, isListOfLists, isLog, isLTOrdered, isMatrix, isMember, isMember, isMinusOne, isModule, isNegative, isNegativeInfinity, isNegativeResult, isNonNegativeResult, isNot, isNumber, isNumEqualInteger, isNumEqualRational, isNumeric, isNumericFunction, isNumericMode, isNumIntValue, isOne, isONE, isOr, isOrderlessAST, isPattern, isPatternDefault, isPatternExpr, isPatternSequence, isPi, isPlus, isPlusTimesPower, isPolynomial, isPolynomial, isPolynomialOfMaxDegree, isPositive, isPositiveResult, isPower, isPresent, isRational, isRationalResult, isRationalValue, isRealResult, isRuleAST, isSame, isSame, isSequence, isSignedNumber, isSin, isSinh, isSlot, isSlotSequence, isSpan, isSymbol, isTan, isTanh, isTimes, isTrue, isUnit, isValue, isVariable, isVector, isZERO, leafCount, leaves, minus, mod, multiply, multiply, negative, ofNullable, optional, or, orElse, orElseGet, orElseThrow, power, power, reciprocal, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceSlots, signum, subtract, sum, timesDistributed, topHead, variables2Slots
public static ComplexSym valueOf(org.apache.commons.math4.fraction.BigFraction real, org.apache.commons.math4.fraction.BigFraction imaginary)
public static ComplexSym valueOf(java.math.BigInteger real)
public static ComplexSym valueOf(java.math.BigInteger real, java.math.BigInteger imaginary)
public static ComplexSym valueOf(IFraction real)
public static ComplexSym valueOf(IRational real)
public static ComplexSym valueOf(IRational real, IRational imaginary)
public static ComplexSym valueOf(long real_numerator, long real_denominator, long imag_numerator, long imag_denominator)
public <T> T accept(IVisitor<T> visitor)
public boolean accept(IVisitorBoolean visitor)
boolean
public int accept(IVisitorInt visitor)
int
public long accept(IVisitorLong visitor)
long
public ComplexSym add(ComplexSym parm1)
public ApcomplexNum apcomplexNumValue(long precision)
INumber
Apcomplex
number wrapped into an
ApcomplexNum
object.apcomplexNumValue
in interface INumber
precision
- set the precision of the resulting ApcomplexNumpublic org.apfloat.Apcomplex apcomplexValue(long precision)
public INumber ceilFraction()
INumber
IInteger
value that is not less than this
and is equal to a
mathematical integer. This method raises ArithmeticException
if a
numeric value cannot be represented by an long
type.ceilFraction
in interface INumber
IInteger
value that is not less than this
and is equal to a
mathematical integer.public int compareAbsValueToOne()
1
and return
1
, if the absolute value is greater than 10
, if the absolute value equals 1-1
, if the absolute value is less than 1compareAbsValueToOne
in interface INumber
public int compareTo(IExpr expr)
public ComplexNum complexNumValue()
INumber
ComplexNum
number bject.complexNumValue
in interface INumber
public int complexSign()
INumber
complexSign
in interface INumber
this == 0
; +1 for
real(this) > 0
or
( real(this)==0 && imaginary(this) > 0 )
;
-1 for real(this) < 0 || ( real(this) == 0 &&
imaginary(this) < 0 )
-
conjugate
public IComplex conjugate()
Conjugate this (complex-) number.
-
eabs
public IExpr eabs()
Get the absolute value for a given number
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface: edu.jas.structure.Element
Test if this is equal to b.
- Specified by:
equals
in interface edu.jas.structure.Element<IExpr>
- Overrides:
equals
in class java.lang.Object
- Returns:
- true if this is equal to b, else false.
-
equalsInt
public boolean equalsInt(int i)
Description copied from interface: INumber
Check if this number equals the given int
number?
-
evaluate
public IExpr evaluate(EvalEngine engine)
Evaluate an expression
-
floorFraction
public INumber floorFraction()
Description copied from interface: INumber
Returns the largest (closest to positive infinity) IInteger
value that is not greater than this
and is equal to a
mathematical integer.
This method raises ArithmeticException
if a numeric value cannot
be represented by an long
type.
- Specified by:
floorFraction
in interface INumber
- Returns:
- the largest (closest to positive infinity)
IInteger
value that is not greater than this
and is equal to
a mathematical integer.
-
fullFormString
public java.lang.String fullFormString()
Description copied from interface: IExpr
Return the FullForm()
of this expression
- Specified by:
fullFormString
in interface IExpr
- Overrides:
fullFormString
in class ExprImpl
-
getIm
public ISignedNumber getIm()
Description copied from interface: INumber
Returns the imaginary part of a complex number
-
getImaginaryPart
public IRational getImaginaryPart()
Returns the imaginary part of a complex number
- Specified by:
getImaginaryPart
in interface IComplex
- Returns:
- imaginary part
-
getRe
public ISignedNumber getRe()
Description copied from interface: INumber
Returns the real part of a complex number
-
getRealPart
public IRational getRealPart()
Returns the real part of a complex number
- Specified by:
getRealPart
in interface IComplex
- Returns:
- real part
-
hashCode
public final int hashCode()
Description copied from interface: edu.jas.structure.Element
Hashcode of this Element.
- Specified by:
hashCode
in interface edu.jas.structure.Element<IExpr>
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- the hashCode.
-
head
public ISymbol head()
Description copied from class: ExprImpl
If this object is an instance of IAST
get the first element
(offset 0) of the IAST
list (i.e. get(0) ).
-
hierarchy
public int hierarchy()
Description copied from interface: IExpr
A unique integer ID for the implementation of this expression
-
internalFormString
public java.lang.String internalFormString(boolean symbolsAsFactoryMethod,
int depth)
Description copied from class: ExprImpl
Return the internal Java form of this expression.
- Specified by:
internalFormString
in interface IExpr
- Overrides:
internalFormString
in class ExprImpl
- Parameters:
symbolsAsFactoryMethod
- if true
use the F.symbol()
method,
otherwise print the symbol name.
depth
- the recursion depth of this call. 0
indicates
"recurse without a limit".
-
internalJavaString
public java.lang.String internalJavaString(boolean symbolsAsFactoryMethod,
int depth,
boolean useOperators)
Description copied from class: ExprImpl
Return the internal Java form of this expression.
- Specified by:
internalJavaString
in interface IExpr
- Overrides:
internalJavaString
in class ExprImpl
- Parameters:
symbolsAsFactoryMethod
- if true
use the F.symbol()
method,
otherwise print the symbol name.
depth
- the recursion depth of this call. 0
indicates
"recurse without a limit".
useOperators
- use operators instead of function names for representation of
Plus, Times, Power,...
-
internalScalaString
public java.lang.String internalScalaString(boolean symbolsAsFactoryMethod,
int depth)
Description copied from class: ExprImpl
Return the internal Scala form of this expression.
- Specified by:
internalScalaString
in interface IExpr
- Overrides:
internalScalaString
in class ExprImpl
- Parameters:
symbolsAsFactoryMethod
- if true
use the F.symbol()
method,
otherwise print the symbol name.
depth
- the recursion depth of this call. 0
indicates
"recurse without a limit".
-
inverse
public IExpr inverse()
Description copied from class: ExprImpl
Returns the multiplicative inverse of this object. It is the object such
as this.times(this.inverse()) == ONE
, with ONE
being the multiplicative identity. Calculates
F.eval(F.Power(this, F.CN1))
in the common case and uses a
specialized implmentation for derived number classes.
-
isZero
public boolean isZero()
Description copied from interface: IExpr
Test if this expression equals 0
in symbolic or numeric
mode.
-
negate
public ComplexSym negate()
Description copied from class: ExprImpl
Negate this.
-
normalize
public INumber normalize()
Description copied from interface: IComplex
Return the normalized form of this number (i.e. if the imaginary part equals zero, return the real part as a fractional or
integer number).
-
numericNumber
public final INumber numericNumber()
Description copied from interface: IBigNumber
Create a numeric number from this exact "symbolic" number.
- Specified by:
numericNumber
in interface IBigNumber
- Returns:
-
opposite
public INumber opposite()
Description copied from class: ExprImpl
Returns an IExpr
whose value is (-1) * this
.
Calculates F.eval(F.Times(F.CN1, this))
in the common case
and uses a specialized implementation for derived number classes.
-
plus
public IExpr plus(IExpr that)
Description copied from class: ExprImpl
Returns an IExpr
whose value is (this + that)
.
Calculates F.eval(F.Plus(this, that))
in the common case and
uses a specialized implementation for derived number classes.
-
times
public IExpr times(IExpr that)
Description copied from class: ExprImpl
Returns an IExpr
whose value is (this * that)
.
Calculates F.eval(F.Times(this, that))
in the common case
and uses a specialized implementation for derived number classes.
-
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
-
getImaginary
public double getImaginary()
Description copied from interface: INumber
Returns the imaginary part of a complex number
- Specified by:
getImaginary
in interface INumber
- Returns:
- real part