Package org.apache.commons.numbers.field
Class AbstractField<T extends org.apache.commons.numbers.core.NativeOperators<T>>
- java.lang.Object
-
- org.apache.commons.numbers.field.AbstractField<T>
-
- Type Parameters:
T- Type of the field elements.
- All Implemented Interfaces:
Field<T>
- Direct Known Subclasses:
BigFractionField,DDField,FP64Field,FractionField
public abstract class AbstractField<T extends org.apache.commons.numbers.core.NativeOperators<T>> extends Object implements Field<T>
Boiler-plate code for concrete implementations ofField.
-
-
Constructor Summary
Constructors Constructor Description AbstractField()Create an instance.
-
Method Summary
All Methods Instance Methods Concrete 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.Treciprocal(T a)Return the reciprocal (multiplicative inverse).Tsubtract(T a, T b)Subtract the elementbfroma.
-
-
-
Constructor Detail
-
AbstractField
public AbstractField()
Create an instance.
-
-
Method Detail
-
reciprocal
public T reciprocal(T a)
Return the reciprocal (multiplicative inverse).- Specified by:
reciprocalin interfaceField<T extends org.apache.commons.numbers.core.NativeOperators<T>>- Parameters:
a- Field element.- Returns:
a-1.
-
-