Package dev.nm.algebra.structure
Interface Field<F>
-
- Type Parameters:
F
- a field
- All Superinterfaces:
AbelianGroup<F>
,Monoid<F>
,Ring<F>
- All Known Implementing Classes:
Complex
,Real
,VariancebtX
public interface Field<F> extends Ring<F>
As an algebraic structure, every field is a ring, but not every ring is a field. That is, it has the notion of addition, subtraction, multiplication, satisfying certain axioms. The most important difference is that a field allows for division (though not division by zero), while a ring may not possess a multiplicative inverse. In addition, the multiplication operation in a field is required to be commutative.- See Also:
- Wikipedia: Field (mathematics)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Field.InverseNonExistent
This is the exception thrown when the inverse of a field element does not exist.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description F
divide(F that)
/ : F × F → FF
inverse()
For each a in F, there exists an element b in F such that a × b = b × a = 1.-
Methods inherited from interface dev.nm.algebra.structure.AbelianGroup
add, minus, opposite, ZERO
-
-
-
-
Method Detail
-
inverse
F inverse() throws Field.InverseNonExistent
For each a in F, there exists an element b in F such that a × b = b × a = 1. That is, it is the object such asthis.multiply(this.inverse()) == this.ONE
- Returns:
- 1 / this if it exists
- Throws:
Field.InverseNonExistent
- if the inverse does not exist- See Also:
- Wikipedia: Multiplicative inverse
-
divide
F divide(F that) throws Field.InverseNonExistent
/ : F × F → F That is the same asthis.multiply(that.inverse())
- Parameters:
that
- the denominator- Returns:
- this / that
- Throws:
Field.InverseNonExistent
- if the inverse does not exist
-
-