|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--com.perisic.ring.Ring
|
+--com.perisic.ring.IntegerRing
The ring of Integers. In essential this class wraps the java.math.Biginteger class.
Note that this class has no public constructor. The only public instance of this class is Ring.Z.
Example of use:
import com.perisic.ring.*;
import java.math.*;
class IntegerRingExample {
public static void main(String [] args) {
RingElt a = Ring.Z.map("3");
RingElt b = Ring.Z.map( new BigInteger("1000000"));
a = Ring.Z.add(a,b);
System.out.println("a = "+a);
}
}
writes "a = 1000003" to the output.
| Fields inherited from class com.perisic.ring.Ring |
C,
F2,
Q,
R,
Z |
| Method Summary | |
RingElt |
add(RingElt a,
RingElt b)
Returns the sum of the parameters. |
RingElt |
ediv(RingElt a,
RingElt b)
Euclidian division. |
boolean |
equalZero(RingElt b)
Returns true if b is equals to zero, false otherwise. |
RingElt |
inv(RingElt b)
Returns b for b == 1 and b == -1. |
boolean |
isEuclidian()
Returns true as Z is an Euclidian ring. |
RingElt |
mod(RingElt a,
RingElt b)
Remainder of Euclidian division. |
RingElt |
mult(RingElt a,
RingElt b)
Returns the product of the parameters. |
RingElt |
neg(RingElt b)
Returns -b as an element of this Ring. |
RingElt |
one()
Returns 1 as an element of this Ring. |
RingElt |
tdiv(RingElt a,
RingElt b)
True division. |
static java.math.BigInteger |
toBigInteger(RingElt b)
Returns the value of b as a BigInteger. |
java.lang.String |
toString()
Returns "Z". |
RingElt |
zero()
Returns 0 as an element of this Ring. |
| Methods inherited from class com.perisic.ring.Ring |
div,
eltToString,
equal,
evaluatePolynomial,
gcd,
isField,
isUFD,
map,
map,
map,
map,
map,
pow,
pow,
sub |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Method Detail |
public java.lang.String toString()
public boolean isEuclidian()
public RingElt add(RingElt a,
RingElt b)
a - a RingElt which can be mapped to an element of this ring.b - a RingElt which can be mapped to an element of this ring.
public RingElt mult(RingElt a,
RingElt b)
a - a RingElt which can be mapped to an element of this ring.b - a RingElt which can be mapped to an element of this ring.
public RingElt inv(RingElt b)
throws RingException
b - a RingElt which can be mapped to an element of this ring.
public RingElt ediv(RingElt a,
RingElt b)
a - a RingElt which can be mapped to an element of this ring.b - a RingElt which can be mapped to an element of this ring.BigInteger.divide(java.math.BigInteger)
public RingElt tdiv(RingElt a,
RingElt b)
a - a RingElt which can be mapped to an element of this ring.b - a RingElt which can be mapped to an element of this ring.
public RingElt mod(RingElt a,
RingElt b)
a - a RingElt which can be mapped to an element of this ring.b - a RingElt which can be mapped to an element of this ring.public RingElt one()
public RingElt zero()
public RingElt neg(RingElt b)
b - a RingElt which can be mapped to an element of this ring.public boolean equalZero(RingElt b)
b - a RingElt which can be mapped to an element of this ring.public static java.math.BigInteger toBigInteger(RingElt b)
b - a RingElt which can be mapped to an element of this ring.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||