Class DoubleField
- All Implemented Interfaces:
AbelianGroup<Double>, AbelianMonoid<Double>, Group<Double>, Magma<Double>, Monoid<Double>, Field<Double>, Ring<Double>, Semiring<Double>, Set<Double>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the sum of two elements (additive notation).intReturns the characteristic of this field.booleanTests whether this set contains the specified element.Returns a human-readable description of this set.Returns the multiplicative inverse of a non-zero element.booleanisEmpty()Returnstrueif this set contains no elements.booleanFields always have commutative multiplication.Returns the product of two elements.Returns the additive inverse (negation) of an element.one()Returns the multiplicative identity (one element).Performs the binary operation on two elements.zero()Returns the additive identity (zero element).Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AbelianGroup
isCommutative, subtractMethods inherited from interface AbelianMonoid
identity, isCommutativeMethods inherited from interface Monoid
isAssociative
-
Field Details
-
INSTANCE
-
-
Method Details
-
contains
Description copied from interface:SetTests whether this set contains the specified element.This is the fundamental operation of a set - membership testing.
-
isEmpty
public boolean isEmpty()Description copied from interface:SetReturnstrueif this set contains no elements.The empty set (∅) is a fundamental concept in set theory. It is the unique set containing no elements.
-
description
Description copied from interface:SetReturns a human-readable description of this set.Examples:
- "â„ (Real Numbers)"
- "ℤ/12ℤ (Integers modulo 12)"
- "{1, 2, 3, 4, 5}"
- Specified by:
descriptionin interfaceSet<Double>- Returns:
- a description of this set
-
add
Description copied from interface:AbelianMonoidReturns the sum of two elements (additive notation).Delegates to
Magma.operate(Object, Object).- Specified by:
addin interfaceAbelianMonoid<Double>- Parameters:
a- the first addendb- the second addend- Returns:
- a + b
-
multiply
Description copied from interface:SemiringReturns the product of two elements.Multiplication must be associative and distribute over addition.
-
zero
Description copied from interface:AbelianMonoidReturns the additive identity (zero element).Delegates to
AbelianMonoid.identity().- Specified by:
zeroin interfaceAbelianMonoid<Double>- Returns:
- the zero element
-
one
-
negate
Description copied from interface:AbelianGroupReturns the additive inverse (negation) of an element.Satisfies: a + (-a) = (-a) + a = 0
- Specified by:
negatein interfaceAbelianGroup<Double>- Parameters:
element- the element to negate- Returns:
- -element
- See Also:
-
inverse
Description copied from interface:FieldReturns the multiplicative inverse of a non-zero element.For element a ≠0, returns a⻹ such that: a × a⻹ = a⻹ × a = 1
Examples:
- In ℚ: inverse(2/3) = 3/2
- In â„Â: inverse(5.0) = 0.2
- In â„‚: inverse(3+4i) = (3-4i)/25
-
characteristic
public int characteristic()Description copied from interface:FieldReturns the characteristic of this field.The characteristic is the smallest positive integer n such that:
1 + 1 + ... + 1 (n times) = 0
If no such n exists, the characteristic is 0.Examples:
- char(ℚ) = char(â„Â) = char(â„‚) = 0
- char(ðÂâ€Â½Ã¢â€šÅ¡) = p (for prime p)
- Specified by:
characteristicin interfaceField<Double>- Returns:
- the characteristic (0 for infinite fields, p for finite fields)
-
isMultiplicationCommutative
public boolean isMultiplicationCommutative()Description copied from interface:FieldFields always have commutative multiplication.- Specified by:
isMultiplicationCommutativein interfaceField<Double>- Specified by:
isMultiplicationCommutativein interfaceSemiring<Double>- Returns:
- always
true
-
operate
Description copied from interface:MagmaPerforms the binary operation on two elements.This is the fundamental operation of a magma. The result must be an element of this magma (closure property).
Properties: None required (not necessarily associative or commutative)
-