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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tadd(T a, T b)Add the elements.Tdivide(T a, T b)Divide the elementabyb.Tmultiply(int n, T a)Multiply the elementaby a specified number of timesn.Tmultiply(T a, T b)Multiply the elements.Tnegate(T a)Negate the element.Tone()Return the value of one.Treciprocal(T a)Return the reciprocal (multiplicative inverse).Tsubtract(T a, T b)Subtract the elementbfroma.Tzero()Return the value of zero.
-
-
-
Method Detail
-
add
T add(T a, T b)
Add the elements.- Parameters:
a- Field element.b- Field element.- Returns:
a + b.
-
subtract
T subtract(T a, T b)
Subtract the elementbfroma.- Parameters:
a- Field element.b- Field element.- Returns:
a - b.
-
multiply
T multiply(int n, T a)
Multiply the elementaby a specified number of timesn.- Parameters:
a- Field element.n- Number of timesamust be added to itself.- Returns:
n a.
-
multiply
T multiply(T a, T b)
Multiply the elements.- Parameters:
a- Field element.b- Field element.- Returns:
a * b.
-
divide
T divide(T a, T b)
Divide the elementabyb.- Parameters:
a- Field element.b- Field element.- Returns:
a * b-1.
-
reciprocal
T reciprocal(T a)
Return the reciprocal (multiplicative inverse).- Parameters:
a- Field element.- Returns:
a-1.
-
-