Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DoubleNumbers.cs
1using System;
4
6{
10 public sealed class DoubleNumbers : Field, IOrderedSet
11 {
12 private static readonly int hashCode = typeof(DoubleNumbers).FullName.GetHashCode();
13
18 {
19 }
20
24 public static readonly DoubleNumbers Instance = new DoubleNumbers();
25
30 {
31 get { return DoubleNumber.OneElement; }
32 }
33
37 public override IAbelianGroupElement Zero
38 {
39 get { return DoubleNumber.ZeroElement; }
40 }
41
47 public override bool Contains(IElement Element)
48 {
49 return Element.AssociatedObjectValue is double;
50 }
51
53 public override bool Equals(object obj)
54 {
55 return obj is DoubleNumbers;
56 }
57
59 public override int GetHashCode()
60 {
61 return hashCode;
62 }
63
70 public int Compare(IElement x, IElement y)
71 {
74
75 return d1.Value.CompareTo(d2.Value);
76 }
77
78 }
79}
Base class for all types of elements.
Definition: Element.cs:13
Base class for all types of fields.
Definition: Field.cs:10
static readonly DoubleNumber ZeroElement
0
Definition: DoubleNumber.cs:16
static readonly DoubleNumber OneElement
1
Definition: DoubleNumber.cs:21
Pseudo-field of double numbers, as an approximation of the field of real numbers.
override bool Equals(object obj)
Compares the element to another. If elements are equal.
DoubleNumbers()
Pseudo-field of double numbers, as an approximation of the field of real numbers.
override ICommutativeRingWithIdentityElement One
Returns the identity element of the commutative ring with identity.
override bool Contains(IElement Element)
Checks if the set contains an element.
static readonly DoubleNumbers Instance
Instance of the set of complex numbers.
int Compare(IElement x, IElement y)
Compares two double values.
override IAbelianGroupElement Zero
Returns the zero element of the group.
override int GetHashCode()
Calculates a hash code of the element. Hash code.
Basic interface for all types of abelian group elements.
Basic interface for all types of commutative ring with identity elements.
Basic interface for all types of elements.
Definition: IElement.cs:20
Basic interface for ordered sets.
Definition: IOrderedSet.cs:11