public abstract class AbstractIntegerSym extends ExprImpl implements IInteger, java.io.Externalizable
IntegerSym
,
BigIntegerSym
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.math.BigInteger |
BI_MINUS_ONE
The BigInteger constant minus one.
|
PRIME_CERTAINTY
ASTID, 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, variables2Slots
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, div, divideAndRemainder, divisors, eabs, exponent, gcd, getBigNumerator, intValue, isEven, isOdd, isProbablePrime, isProbablePrime, longValue, mod, modInverse, modPow, moebiusMu, multiply, nthRoot, nthRootSplit, quotient, shiftLeft, shiftRight, subtract
add, compareInt, equalsFraction, factorInteger, getBigDenominator, getDenominator, getFraction, getNumerator, multiply, normalize
divideBy, doubleValue, isGreaterThan, isLessThan, isNegative, isPositive, isZero, numValue, round, sign, toInt, toLong
numericNumber
compareAbsValueToOne, 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, variables2Slots
public 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.AbelianGroupElem
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 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 ApfloatNum apfloatNumValue(long precision)
ISignedNumber
Apfloat
number wrapped into an ApfloatNum
object.apfloatNumValue
in interface ISignedNumber
precision
- set the precision of the resulting ApfloatNumpublic IInteger 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 IInteger eulerPhi() throws java.lang.ArithmeticException
public IExpr evaluate(EvalEngine engine)
public IInteger floorFraction()
INumber
IInteger
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 INumber
IInteger
value that is not greater than this
and is equal to
a mathematical integer.public ISymbol head()
ExprImpl
IAST
get the first element
(offset 0) of the IAST
list (i.e. get(0) ).public int hierarchy()
IExpr
public java.lang.String internalFormString(boolean symbolsAsFactoryMethod, int depth)
ExprImpl
internalFormString
in interface IExpr
internalFormString
in class ExprImpl
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".public abstract ISignedNumber inverse()
ExprImpl
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.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 IExpr
java.lang.ArithmeticException
public 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 IExpr
java.lang.ArithmeticException
IExpr.isRational()
public boolean isNumIntValue()
int
value. The value
of an INum
object can be an int
value.isNumIntValue
in interface IExpr
public IInteger jacobiSymbol(IInteger b)
jacobiSymbol
in interface IInteger
b
- public IInteger jacobiSymbolF()
jacobiSymbolF
in interface IInteger
public IInteger jacobiSymbolG(IInteger b)
jacobiSymbolG
in interface IInteger
public IInteger lcm(IInteger that)
public java.math.BigInteger multiply(long val)
val
- public abstract IInteger negate()
ExprImpl
negate
in interface edu.jas.structure.AbelianGroupElem<IExpr>
negate
in interface org.apache.commons.math4.FieldElement<IExpr>
negate
in interface IInteger
negate
in interface IRational
negate
in interface ISignedNumber
negate
in class ExprImpl
public IInteger opposite()
ExprImpl
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.opposite
in interface IExpr
opposite
in interface INumber
opposite
in interface ISignedNumber
opposite
in class ExprImpl
IExpr.negative()
public IExpr plus(IExpr that)
ExprImpl
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.public final IInteger pow(long exponent) throws java.lang.ArithmeticException
public IInteger[] primitiveRoots() throws java.lang.ArithmeticException
primitiveRoots
in interface IInteger
java.lang.ArithmeticException
public ISignedNumber subtractFrom(ISignedNumber that)
ISignedNumber
that
signed number from this
signed numbersubtractFrom
in interface ISignedNumber
that
- a signed numberpublic IExpr times(IExpr that)
ExprImpl
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.public byte[] toByteArray()
toByteArray
in interface IInteger
public double getImaginary()
INumber
getImaginary
in interface INumber