# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.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.
Wikipedia: Field (mathematics)
• ### Nested Class Summary

Nested Classes
Modifier and Type Interface and Description
static class  Field.InverseNonExistent
This is the exception thrown when the inverse of a field element does not exist.
• ### Method Summary

All Methods
Modifier and Type Method and Description
F divide(F that)
/ : F × F → F

That is the same as this.multiply(that.inverse())

F inverse()
For each a in F, there exists an element b in F such that a × b = b × a = 1.
• ### Methods inherited from interface com.numericalmethod.suanshu.algebra.structure.AbelianGroup

add, minus, opposite, ZERO
• ### Methods inherited from interface com.numericalmethod.suanshu.algebra.structure.Monoid

multiply, ONE
• ### 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 as
this.multiply(this.inverse()) == this.ONE
Returns:
1 / this if it exists
Throws:
Field.InverseNonExistent - if the inverse does not exist
Wikipedia: Multiplicative inverse
• #### divide

F divide(F that)
throws Field.InverseNonExistent
/ : F × F → F

That is the same as

this.multiply(that.inverse())
Parameters:
that - the denominator
Returns:
this / that
Throws:
Field.InverseNonExistent - if the inverse does not exist