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 elementabyb.Multiply the elementaby 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 elementbfroma.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 elementbfroma.- Parameters:
a- Field element.b- Field element.- Returns:
a - b.
-
negate
Negate the element.- Parameters:
a- Field element.- Returns:
-a.
-
multiply
Multiply the elementaby a specified number of timesn.- Parameters:
n- Number of timesamust 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 elementabyb.- 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
1such that for alla,1 * a == a.
-
zero
T zero()Return the value of zero.- Returns:
- the field element
0such that for alla,0 + a == a.
-