## com.perisic.ring Class QuotientField

```java.lang.Object
com.perisic.ring.Ring
com.perisic.ring.QuotientField
```

`public class QuotientFieldextends Ring`

A field of fractions p/q with p,q in B, where B is any Ring. Usually B is here a PolynomialRing, for example F2[t] or Z[a][b]. B must be at least an UFD.

You can use this class also to constuct a rational field Q with B = Z. For performance reasons it is recommended to use Ring.Q of type RationalField instead.

• Last Change: 16.01.2003
• Last Change: 13.12.2003: GPL.
• Email: ring@perisic.com. Please let me know if you use this software.
• WWW: www.ring.perisic.com
• The com.perisic.ring library is distributed under the terms of the GNU Lesser General Public License (LGPL).
• disclaimer: The classes are provided "as is". There is no warranty implied by using the com.perisic.ring package.

Version:
0.2
Author:

Field Summary

Fields inherited from class com.perisic.ring.Ring
`C, F2, Q, R, Z`

Constructor Summary
`QuotientField(Ring BaseRing)`
Construction.

Method Summary
` RingElt` ```add(RingElt a, RingElt b)```
` RingElt` ```construct(RingElt numerator, RingElt denominator)```
Constructs numerator/denominator.
` RingElt` `denominator(RingElt b)`
Returns the denominator of b as an element of the base ring.
` boolean` `equalZero(RingElt b)`
True if b == 0.
` Ring` `getBaseRing()`
Returns the denominator and numerator ring B (the base ring).
` RingElt` `inv(RingElt b)`
Returns b^-1.
` boolean` `isField()`
Returns true.
` boolean` `isIntegral(RingElt b)`
true if the denominator is one.
`static void` `main(java.lang.String[] args)`

` RingElt` `map(RingElt a)`
If a is an element of another QuotientRing, numerator and denominator are mapped to B.
` RingElt` `map(java.lang.String a)`
Maps the String a into this Ring.
` RingElt` ```mult(RingElt a, RingElt b)```
Multiplication a * b.
` RingElt` `neg(RingElt b)`
Returns -b.
` RingElt` `numerator(RingElt b)`
Returns the numerator of b as an element of the base ring.
` RingElt` `one()`
Returns 1.
` java.lang.String` `toString()`
Returns "Quot(str)" where str = B.toString().
` RingElt` `zero()`
Returns 0.

Methods inherited from class com.perisic.ring.Ring
`div, ediv, eltToString, equal, evaluatePolynomial, gcd, isEuclidian, isUFD, map, map, map, mod, pow, pow, sub, tdiv`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### QuotientField

`public QuotientField(Ring BaseRing)`
Construction.

Method Detail

### isField

`public boolean isField()`
Returns true.

Overrides:
`isField` in class `Ring`

### getBaseRing

`public Ring getBaseRing()`
Returns the denominator and numerator ring B (the base ring).

### numerator

`public RingElt numerator(RingElt b)`
Returns the numerator of b as an element of the base ring.

### denominator

`public RingElt denominator(RingElt b)`
Returns the denominator of b as an element of the base ring.

```public RingElt add(RingElt a,
RingElt b)```

Specified by:
`add` in class `Ring`

### mult

```public RingElt mult(RingElt a,
RingElt b)```
Multiplication a * b.

Specified by:
`mult` in class `Ring`

### one

`public RingElt one()`
Returns 1.

Overrides:
`one` in class `Ring`

### zero

`public RingElt zero()`
Returns 0.

Specified by:
`zero` in class `Ring`

### inv

`public RingElt inv(RingElt b)`
Returns b^-1.

Overrides:
`inv` in class `Ring`

### neg

`public RingElt neg(RingElt b)`
Returns -b.

Specified by:
`neg` in class `Ring`

### equalZero

`public boolean equalZero(RingElt b)`
True if b == 0. False otherwise.

Specified by:
`equalZero` in class `Ring`

### map

`public RingElt map(RingElt a)`
If a is an element of another QuotientRing, numerator and denominator are mapped to B. Otherwise a is mapped to B and the denominator set to 1.

Overrides:
`map` in class `Ring`

### toString

`public java.lang.String toString()`
Returns "Quot(str)" where str = B.toString().

Overrides:
`toString` in class `java.lang.Object`

### isIntegral

`public boolean isIntegral(RingElt b)`
true if the denominator is one.

### construct

```public RingElt construct(RingElt numerator,
RingElt denominator)```
Constructs numerator/denominator.

### map

`public RingElt map(java.lang.String a)`
Maps the String a into this Ring. This method is similar to the PolynomialRing.map(java.lang.String) method. In addition negative exponents are allowed.

Overrides:
`map` in class `Ring`

### main

`public static void main(java.lang.String[] args)`