Package org.apache.commons.numbers.field
Class AbstractField<T extends 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
,FP64Field
,FractionField
public abstract class AbstractField<T extends NativeOperators<T>>
extends Object
implements Field<T>
Boiler-plate code for concrete implementations of
Field
.-
Constructor Details
-
AbstractField
public AbstractField()
-
-
Method Details
-
add
- Specified by:
add
in interfaceField<T extends NativeOperators<T>>
- Parameters:
a
- Field element.b
- Field element.- Returns:
a + b
.
-
subtract
- Specified by:
subtract
in interfaceField<T extends NativeOperators<T>>
- Parameters:
a
- Field element.b
- Field element.- Returns:
a - b
.
-
negate
- Specified by:
negate
in interfaceField<T extends NativeOperators<T>>
- Parameters:
a
- Field element.- Returns:
-a
.
-
multiply
- Specified by:
multiply
in interfaceField<T extends NativeOperators<T>>
- Parameters:
n
- Number of timesa
must be added to itself.a
- Field element.- Returns:
n a
.
-
multiply
- Specified by:
multiply
in interfaceField<T extends NativeOperators<T>>
- Parameters:
a
- Field element.b
- Field element.- Returns:
a * b
.
-
divide
- Specified by:
divide
in interfaceField<T extends NativeOperators<T>>
- Parameters:
a
- Field element.b
- Field element.- Returns:
a * b-1
.
-
reciprocal
- Specified by:
reciprocal
in interfaceField<T extends NativeOperators<T>>
- Parameters:
a
- Field element.- Returns:
a-1
.
-