|
|||||||||
| 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.F2Field
public class F2Field
The finite prime field of characteristic 2. This is a wrapper class for the primitive data type boolean where "and" is the multiplcaton and "exclusive or" is the addition.
| Field Summary | |
|---|---|
static F2Field |
F2
The field F2. |
| Fields inherited from class com.perisic.ring.Ring |
|---|
C, Q, R, Z |
| Method Summary | |
|---|---|
RingElt |
add(RingElt a,
RingElt b)
The addition a + b mod 2. |
boolean |
equalZero(RingElt a)
Returns true if a == 0. |
RingElt |
inv(RingElt b)
Returns b^-1. |
boolean |
isField()
Is the ring a field? By default false. |
RingElt |
map(boolean b)
Maps false to 0 and true to 1. |
RingElt |
map(RingElt b)
If b is a modular integer ring, such that the modulus maps to 0, the value of b is mapped to F2. |
RingElt |
mult(RingElt a,
RingElt b)
The multiplicaton a * b mod 2. |
RingElt |
neg(RingElt a)
Returns -a mod 2. |
RingElt |
one()
Returns the 1 of the ring. |
boolean |
toBoolean(RingElt a)
Returns the boolean value of a. |
java.lang.String |
toString()
Returns the String "F2". |
RingElt |
zero()
Returns 0 mod 2. |
| Methods inherited from class com.perisic.ring.Ring |
|---|
div, ediv, eltToString, equal, evaluatePolynomial, gcd, isEuclidian, isUFD, map, map, map, map, mod, pow, pow, sub, tdiv |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static F2Field F2
| Method Detail |
|---|
public boolean isField()
RingNote for implementing a child class of Ring: Must be overridden in a field.
isField in class Ringpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean toBoolean(RingElt a)
public RingElt add(RingElt a,
RingElt b)
add in class Ring
public RingElt mult(RingElt a,
RingElt b)
mult in class Ringpublic RingElt zero()
zero in class Ringpublic RingElt neg(RingElt a)
neg in class Ringpublic boolean equalZero(RingElt a)
equalZero in class Ringpublic RingElt one()
one in class Ring
public RingElt inv(RingElt b)
throws RingException
inv in class RingRingExceptionpublic RingElt map(boolean b)
public RingElt map(RingElt b)
map in class Ring
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||