Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ComplexNumbers.cs
1using System.Numerics;
4
6{
10 public sealed class ComplexNumbers : Field
11 {
12 internal static readonly ComplexNumber zero = new ComplexNumber(Complex.Zero);
13 internal static readonly ComplexNumber one = new ComplexNumber(Complex.One);
14 private static readonly int hashCode = typeof(ComplexNumbers).FullName.GetHashCode();
15
20 {
21 }
22
27 {
28 get { return one; }
29 }
30
34 public override IAbelianGroupElement Zero
35 {
36 get { return zero; }
37 }
38
44 public override bool Contains(IElement Element)
45 {
46 object Obj = Element.AssociatedObjectValue;
47 return (Obj is Complex) || (Obj is double);
48 }
49
51 public override bool Equals(object obj)
52 {
53 return obj is ComplexNumbers;
54 }
55
57 public override int GetHashCode()
58 {
59 return hashCode;
60 }
61
65 public static readonly ComplexNumbers Instance = new ComplexNumbers();
66
68 public override string ToString()
69 {
70 return "ℂ";
71 }
72 }
73}
Base class for all types of elements.
Definition: Element.cs:13
abstract object AssociatedObjectValue
Associated object value.
Definition: Element.cs:46
Base class for all types of fields.
Definition: Field.cs:10
Pseudo-field of Complex numbers, as an approximation of the field of real numbers.
override IAbelianGroupElement Zero
Returns the zero element of the group.
ComplexNumbers()
Pseudo-field of Complex numbers, as an approximation of the field of real numbers.
override int GetHashCode()
Calculates a hash code of the element. Hash code.
static readonly ComplexNumbers Instance
Instance of the set of complex numbers.
override ICommutativeRingWithIdentityElement One
Returns the identity element of the commutative ring with identity.
override bool Equals(object obj)
Compares the element to another. If elements are equal.
override bool Contains(IElement Element)
Checks if the set contains an element.
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