public class RationalField extends GenericPowerField<Rational>
RationalNumberFactory
,
Rational
,
Serialized Formone, zero
Constructor and Description |
---|
RationalField() |
Modifier and Type | Method and Description |
---|---|
Rational |
addG(Rational l,
Rational r)
Adds two elements of type E.
|
Rational |
cast(java.lang.Object l)
Convert the input to type E.
|
java.lang.Integer |
cmpG(Rational l,
Rational r)
Compare two objects of the same type.
|
Rational |
convertFromInt(java.lang.Integer l)
Attempt to convert argument from an integer
|
java.lang.Integer |
convertToIntE(Rational r)
If possible convert the argument to an Integer to enable integral powers.
|
Rational |
divG(Rational l,
Rational r)
Divides two elements of type E.
|
Rational |
getOne()
Get the multiplicative identity for this field.
|
Rational |
getZero()
Get the additive identity for this field
|
Rational |
modG(Rational l,
Rational r)
Modulus of two elements of type E.
|
Rational |
mulG(Rational l,
Rational r)
Multiplies two elements of type E.
|
Rational |
negG(Rational l)
Negates an elements of type E.
|
Rational |
powNonInt(Rational l,
Rational r)
Power only implemented for integral powers.
|
Rational |
subG(Rational l,
Rational r)
Subtracts two elements of type E.
|
powG, powI
add, and, cmp, convertToInt, div, mod, mul, neg, not, or, pow, sub
public Rational cast(java.lang.Object l)
GenericField
cast
in class GenericField<Rational>
public Rational addG(Rational l, Rational r) throws EvaluationException
GenericField
addG
in class GenericField<Rational>
l
- lhs argumentr
- rhs argumentEvaluationException
- on errorpublic java.lang.Integer cmpG(Rational l, Rational r) throws EvaluationException
GenericField
cmpG
in class GenericField<Rational>
l
- left argumentr
- right argumentEvaluationException
public Rational divG(Rational l, Rational r) throws EvaluationException
GenericField
divG
in class GenericField<Rational>
l
- numeratorr
- denominatorEvaluationException
- on errorpublic Rational modG(Rational l, Rational r) throws EvaluationException
GenericField
modG
in class GenericField<Rational>
l
- lhs argumentr
- rhs argumentEvaluationException
- on errorpublic Rational mulG(Rational l, Rational r) throws EvaluationException
GenericField
mulG
in class GenericField<Rational>
l
- lhs argumentr
- rhs argumentEvaluationException
- on errorpublic Rational negG(Rational l) throws EvaluationException
GenericField
negG
in class GenericField<Rational>
l
- the argumentEvaluationException
- on errorpublic Rational powNonInt(Rational l, Rational r) throws EvaluationException
powNonInt
in class GenericPowerField<Rational>
EvaluationException
public Rational subG(Rational l, Rational r) throws EvaluationException
GenericField
subG
in class GenericField<Rational>
l
- lhs argumentr
- rhs argumentEvaluationException
- on errorpublic Rational convertFromInt(java.lang.Integer l) throws EvaluationException
IntegerConvertor
convertFromInt
in interface IntegerConvertor
convertFromInt
in class GenericField<Rational>
l
- value to convertEvaluationException
public Rational getOne()
FieldI
getOne
in interface FieldI
getOne
in class GenericField<Rational>
public Rational getZero()
FieldI
getZero
in interface FieldI
getZero
in class GenericField<Rational>
public java.lang.Integer convertToIntE(Rational r) throws EvaluationException
GenericField
powG(E,E)
method will be called.convertToIntE
in class GenericField<Rational>
r
- argument to convert.EvaluationException
Copyright © 2018 Singular Systems http://www.singularsys.com/jep