Package org.apache.commons.numbers.field
Interface Field<T>
- Type Parameters:
T
- Type of the field elements.
- All Known Implementing Classes:
AbstractField
,BigFractionField
,DDField
,FP64Field
,FractionField
public interface Field<T>
Interface representing a field.
-
Method Summary
Modifier and TypeMethodDescriptionAdd the elements.Divide the elementa
byb
.Multiply the elementa
by a specified number of timesn
.Multiply the elements.Negate the element.one()
Return the value of one.reciprocal
(T a) Return the reciprocal (multiplicative inverse).Subtract the elementb
froma
.zero()
Return the value of zero.
-
Method Details
-
add
Add the elements.- Parameters:
a
- Field element.b
- Field element.- Returns:
a + b
.
-
subtract
Subtract the elementb
froma
.- Parameters:
a
- Field element.b
- Field element.- Returns:
a - b
.
-
negate
Negate the element.- Parameters:
a
- Field element.- Returns:
-a
.
-
multiply
Multiply the elementa
by a specified number of timesn
.- Parameters:
n
- Number of timesa
must be added to itself.a
- Field element.- Returns:
n a
.
-
multiply
Multiply the elements.- Parameters:
a
- Field element.b
- Field element.- Returns:
a * b
.
-
divide
Divide the elementa
byb
.- Parameters:
a
- Field element.b
- Field element.- Returns:
a * b-1
.
-
reciprocal
Return the reciprocal (multiplicative inverse).- Parameters:
a
- Field element.- Returns:
a-1
.
-
one
T one()Return the value of one.- Returns:
- the field element
1
such that for alla
,1 * a == a
.
-
zero
T zero()Return the value of zero.- Returns:
- the field element
0
such that for alla
,0 + a == a
.
-