public abstract class AbstractIntegerSym extends ExprImpl implements IInteger, java.io.Externalizable
IntegerSym,
BigIntegerSym,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static java.math.BigInteger |
BI_MINUS_ONE
The BigInteger constant minus one.
|
PRIME_CERTAINTYASTID, BLANKID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID| Constructor and Description |
|---|
AbstractIntegerSym() |
| Modifier and Type | Method and Description |
|---|---|
IRational |
abs()
Absolute value of this.
|
<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 |
ApcomplexNum |
apcomplexNumValue(long precision)
Get a
Apcomplex number wrapped into an
ApcomplexNum object. |
org.apfloat.Apcomplex |
apcomplexValue(long precision) |
ApfloatNum |
apfloatNumValue(long precision)
Get a
Apfloat number wrapped into an ApfloatNum object. |
IInteger |
ceil() |
IInteger |
ceilFraction()
Returns the smallest (closest to negative infinity)
IInteger
value that is not less than this and is equal to a
mathematical integer. |
IRational |
divideBy(IRational that) |
IInteger |
eulerPhi() |
IExpr |
evaluate(EvalEngine engine)
Evaluate an expression
|
IInteger |
floor() |
IInteger |
floorFraction()
Returns the largest (closest to positive infinity)
IInteger
value that is not greater than this and is equal to a
mathematical integer. |
IExpr |
gcd(IExpr that)
Greatest common divisor.
|
double |
getImaginary()
Returns the imaginary part of a complex number
|
double |
getReal()
Returns the real part of a complex number
|
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.
|
abstract ISignedNumber |
inverse()
Returns the multiplicative inverse of this object.
|
boolean |
isNumEqualInteger(IInteger value)
Check if this expression equals an
IInteger value. |
boolean |
isNumEqualRational(IRational value)
Check if this expression equals an
IRational value. |
boolean |
isNumIntValue()
Check if this expression represents an
int value. |
IInteger |
jacobiSymbol(IInteger b)
See: Wikipedia -
Jacobi symbol
Book: Algorithmen Arbeitsbuch - D.Herrmann page 160 |
IInteger |
jacobiSymbolF() |
IInteger |
jacobiSymbolG(IInteger b) |
static java.math.BigInteger |
lcm(java.math.BigInteger i0,
java.math.BigInteger i1) |
IInteger |
lcm(IInteger that)
Returns the least common multiple of this large integer and the one
specified.
|
java.math.BigInteger |
multiply(long val) |
abstract IInteger |
negate()
Negate this.
|
IInteger |
opposite()
Returns an
IExpr whose value is (-1) * this. |
IExpr |
plus(IExpr that)
Returns an
IExpr whose value is (this + that). |
IInteger |
pow(long exponent)
Returns this number raised at the specified exponent.
|
IInteger[] |
primitiveRoots()
The primitive roots of this integer number
|
IRational |
subtract(IRational that) |
ISignedNumber |
subtractFrom(ISignedNumber that)
Subtract
that signed number from this signed number |
IExpr |
times(IExpr that)
Returns an
IExpr whose value is (this * that). |
byte[] |
toByteArray() |
static IInteger |
valueOf(java.math.BigInteger bigInteger) |
static IntegerSym |
valueOf(int newnum) |
static IInteger |
valueOf(long newnum) |
static IInteger |
valueOf(java.lang.String integerString,
int radix)
Returns the IInteger for the specified character sequence stated in the
specified radix.
|
$div, $minus, $plus, $times, $up, and, apply, apply, asType, compareTo, conjugate, copy, dec, divide, egcd, evalComplex, evalDouble, evalNumber, evalSignedNumber, factory, fullFormString, getAt, inc, internalJavaString, internalScalaString, leafCount, leaves, minus, mod, multiply, negative, optional, or, power, power, remainder, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceRepeated, replaceSlots, signum, subtract, sum, topHead, toScript, toScriptFactory, variables2Slotsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, div, divideAndRemainder, divisors, eabs, exponent, gcd, getBigNumerator, intValue, isEven, isOdd, isProbablePrime, isProbablePrime, longValue, mod, modInverse, modPow, moebiusMu, multiply, nthRoot, nthRootSplit, quotient, shiftLeft, shiftRight, subtractadd, compareInt, equalsFraction, factorInteger, getBigDenominator, getDenominator, getFraction, getNumerator, multiply, normalizedivideBy, doubleValue, isGreaterThan, isLessThan, isNegative, isPositive, isZero, numValue, round, sign, toInt, toLongnumericNumbercompareAbsValueToOne, complexNumValue, complexSign, conjugate, equalsInt, getIm, getRe$div, $minus, $plus, $times, $up, and, apply, apply, asType, compareTo, dec, divide, evalComplex, evalDouble, evalNumber, evalSignedNumber, evaluateHead, fullFormString, getAt, getField, ifPresent, inc, internalJavaString, internalScalaString, 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, isNegativeInfinity, isNegativeResult, isNonNegativeResult, isNot, isNumber, isNumeric, isNumericFunction, isNumericMode, isOne, isONE, isOr, isOrderlessAST, isPattern, isPatternDefault, isPatternExpr, isPatternSequence, isPi, isPlus, isPlusTimesPower, isPolynomial, isPolynomial, isPolynomialOfMaxDegree, 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, variables2Slotspublic static final java.math.BigInteger BI_MINUS_ONE
public static java.math.BigInteger lcm(java.math.BigInteger i0,
java.math.BigInteger i1)
public static IInteger valueOf(java.math.BigInteger bigInteger)
bigInteger - public static IntegerSym valueOf(int newnum)
public static IInteger valueOf(long newnum)
public static IInteger valueOf(java.lang.String integerString, int radix)
'+' or a minus sign '-' .chars - the character sequence to parse.radix - the radix to be used while parsing.java.lang.NumberFormatException - if the specified character sequence does not contain a
parsable large integer.public IRational abs()
edu.jas.structure.AbelianGroupElempublic <T> T accept(IVisitor<T> visitor)
public boolean accept(IVisitorBoolean visitor)
booleanpublic int accept(IVisitorInt visitor)
intpublic long accept(IVisitorLong visitor)
longpublic ApcomplexNum apcomplexNumValue(long precision)
INumberApcomplex number wrapped into an
ApcomplexNum object.apcomplexNumValue in interface INumberprecision - set the precision of the resulting ApcomplexNumpublic org.apfloat.Apcomplex apcomplexValue(long precision)
public ApfloatNum apfloatNumValue(long precision)
ISignedNumberApfloat number wrapped into an ApfloatNum object.apfloatNumValue in interface ISignedNumberprecision - set the precision of the resulting ApfloatNumpublic IInteger ceilFraction()
INumberIInteger
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 INumberIInteger
value that is not less than this and is equal to a
mathematical integer.public IInteger eulerPhi() throws java.lang.ArithmeticException
public IExpr evaluate(EvalEngine engine)
public IInteger floorFraction()
INumberIInteger
value that is not greater than this and is equal to a
mathematical integer. ArithmeticException if a numeric value cannot
be represented by an long type.floorFraction in interface INumberIInteger
value that is not greater than this and is equal to
a mathematical integer.public ISymbol head()
ExprImplIAST get the first element
(offset 0) of the IAST list (i.e. get(0) ).public int hierarchy()
IExprpublic java.lang.String internalFormString(boolean symbolsAsFactoryMethod,
int depth)
ExprImplinternalFormString in interface IExprinternalFormString in class ExprImplsymbolsAsFactoryMethod - 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".public abstract ISignedNumber inverse()
ExprImplthis.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.public boolean isNumEqualInteger(IInteger value) throws java.lang.ArithmeticException
IInteger value. The value
of an INum or the value of an IInteger object
can be equal to value.isNumEqualInteger in interface IExprjava.lang.ArithmeticExceptionpublic boolean isNumEqualRational(IRational value) throws java.lang.ArithmeticException
IRational value. The
value of an IInteger, IFraction or the value of
an INum object can be equal to value.isNumEqualRational in interface IExprjava.lang.ArithmeticExceptionIExpr.isRational()public boolean isNumIntValue()
int value. The value
of an INum object can be an int value.isNumIntValue in interface IExprpublic IInteger jacobiSymbol(IInteger b)
jacobiSymbol in interface IIntegerb - public IInteger jacobiSymbolF()
jacobiSymbolF in interface IIntegerpublic IInteger jacobiSymbolG(IInteger b)
jacobiSymbolG in interface IIntegerpublic IInteger lcm(IInteger that)
public java.math.BigInteger multiply(long val)
val - public abstract IInteger negate()
ExprImplnegate in interface edu.jas.structure.AbelianGroupElem<IExpr>negate in interface org.apache.commons.math4.FieldElement<IExpr>negate in interface IIntegernegate in interface IRationalnegate in interface ISignedNumbernegate in class ExprImplpublic IInteger opposite()
ExprImplIExpr 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.opposite in interface IExpropposite in interface INumberopposite in interface ISignedNumberopposite in class ExprImplIExpr.negative()public IExpr plus(IExpr that)
ExprImplIExpr 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.public final IInteger pow(long exponent) throws java.lang.ArithmeticException
public IInteger[] primitiveRoots() throws java.lang.ArithmeticException
primitiveRoots in interface IIntegerjava.lang.ArithmeticExceptionpublic ISignedNumber subtractFrom(ISignedNumber that)
ISignedNumberthat signed number from this signed numbersubtractFrom in interface ISignedNumberthat - a signed numberpublic IExpr times(IExpr that)
ExprImplIExpr 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.public byte[] toByteArray()
toByteArray in interface IIntegerpublic double getImaginary()
INumbergetImaginary in interface INumber