Package org.apfloat.jscience
Class ApcomplexField
- java.lang.Object
-
- java.lang.Number
-
- org.jscience.mathematics.number.Number<T>
-
- org.apfloat.jscience.AbstractField<ApcomplexField,Apcomplex>
-
- org.apfloat.jscience.ApcomplexField
-
- All Implemented Interfaces:
Serializable
,Comparable<ApcomplexField>
,javolution.lang.Immutable
,javolution.lang.Realtime
,javolution.lang.ValueType
,javolution.xml.XMLSerializable
,org.jscience.mathematics.structure.Field<ApcomplexField>
,org.jscience.mathematics.structure.GroupAdditive<ApcomplexField>
,org.jscience.mathematics.structure.GroupMultiplicative<ApcomplexField>
,org.jscience.mathematics.structure.Ring<ApcomplexField>
,org.jscience.mathematics.structure.Structure<ApcomplexField>
public class ApcomplexField extends AbstractField<ApcomplexField,Apcomplex>
This class represents an arbitrary precision complex number.The precision of each calculation is determined separately, which means that loss of precision can easily accumulate in complicated calculations (e.g. matrix inversion). If this should be avoided, and a fixed precision is required, then it may be better to use
FixedPrecisionApcomplexField
instead.- Since:
- 1.8.0
- Version:
- 1.8.0
- Author:
- Mikko Tommila
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApcomplexField(Apcomplex value)
Constructs a new complex field object with the specified value.
-
Method Summary
Modifier and Type Method Description ApcomplexField
copy()
Returns a copy of this object.ApcomplexField
inverse()
Returns the multiplicative inverse of this object.ApcomplexField
opposite()
Returns the additive inverse of this object.ApcomplexField
plus(ApcomplexField that)
Returns the sum of this object with the one specified.ApcomplexField
times(ApcomplexField that)
Returns the product of this object with the one specified.-
Methods inherited from class org.apfloat.jscience.AbstractField
compareTo, doubleValue, equals, hashCode, isLargerThan, longValue, toText, value
-
-
-
-
Constructor Detail
-
ApcomplexField
public ApcomplexField(Apcomplex value)
Constructs a new complex field object with the specified value.- Parameters:
value
- The value.
-
-
Method Detail
-
plus
public ApcomplexField plus(ApcomplexField that)
Description copied from class:AbstractField
Returns the sum of this object with the one specified.- Specified by:
plus
in interfaceorg.jscience.mathematics.structure.GroupAdditive<ApcomplexField>
- Specified by:
plus
in classAbstractField<ApcomplexField,Apcomplex>
- Parameters:
that
- The addend.- Returns:
this + that
-
opposite
public ApcomplexField opposite()
Description copied from class:AbstractField
Returns the additive inverse of this object.- Specified by:
opposite
in interfaceorg.jscience.mathematics.structure.GroupAdditive<ApcomplexField>
- Specified by:
opposite
in classAbstractField<ApcomplexField,Apcomplex>
- Returns:
-this
-
times
public ApcomplexField times(ApcomplexField that)
Description copied from class:AbstractField
Returns the product of this object with the one specified.- Specified by:
times
in interfaceorg.jscience.mathematics.structure.GroupMultiplicative<ApcomplexField>
- Specified by:
times
in interfaceorg.jscience.mathematics.structure.Ring<ApcomplexField>
- Specified by:
times
in classAbstractField<ApcomplexField,Apcomplex>
- Parameters:
that
- The multiplicand.- Returns:
this * that
-
inverse
public ApcomplexField inverse() throws ArithmeticException
Description copied from class:AbstractField
Returns the multiplicative inverse of this object.- Specified by:
inverse
in interfaceorg.jscience.mathematics.structure.GroupMultiplicative<ApcomplexField>
- Specified by:
inverse
in classAbstractField<ApcomplexField,Apcomplex>
- Returns:
1 / this
- Throws:
ArithmeticException
- If the divisor is zero.
-
copy
public ApcomplexField copy()
Description copied from class:AbstractField
Returns a copy of this object.- Specified by:
copy
in interfacejavolution.lang.ValueType
- Specified by:
copy
in classAbstractField<ApcomplexField,Apcomplex>
- Returns:
- A copy of this object.
-
-