|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.perisic.ring.Ring
com.perisic.ring.IntegerRing
public class 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.
| Field Summary |
|---|
| Fields inherited from class com.perisic.ring.Ring |
|---|
C, F2, Q, R |
| 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 |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isEuclidian()
isEuclidian in class Ring
public RingElt add(RingElt a,
RingElt b)
add in class Ringa - 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)
mult in class Ringa - 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
inv in class Ringb - a RingElt which can be mapped to an element of this ring.
RingException - if b is neither 1 or -1.
public RingElt ediv(RingElt a,
RingElt b)
ediv in class Ringa - 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)
tdiv in class Ringa - 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.
RingException - if b divides not a.
public RingElt mod(RingElt a,
RingElt b)
mod in class Ringa - 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()
one in class Ringpublic RingElt zero()
zero in class Ringpublic RingElt neg(RingElt b)
neg in class Ringb - a RingElt which can be mapped to an element of this ring.
public boolean equalZero(RingElt b)
equalZero in class Ringb - 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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||