Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DateTimeVectors.cs
1using System;
5
7{
11 public sealed class DateTimeVectors : VectorSpace
12 {
13 private readonly int dimension;
14
20 {
21 this.dimension = Dimension;
22 }
23
27 public int Dimension => this.dimension;
28
32 public override IField ScalarField
33 {
34 get { throw new ScriptException("Scalar field not defined for generic object vectors."); }
35 }
36
40 public override IAbelianGroupElement Zero
41 {
42 get { throw new ScriptException("Zero element not defined for generic object vectors."); }
43 }
44
50 public override bool Contains(IElement Element)
51 {
52 if (Element is DateTimeVector v)
53 return v.Dimension == this.dimension;
54 else
55 return false;
56 }
57
63 public override bool Equals(object obj)
64 {
65 return (obj is DateTimeVectors v && v.dimension == this.dimension);
66 }
67
72 public override int GetHashCode()
73 {
74 return this.dimension.GetHashCode();
75 }
76
77 }
78}
Base class for all types of elements.
Definition: Element.cs:13
Base class for all types of vector spaces.
Definition: VectorSpace.cs:10
Base class for script exceptions.
Pseudo-vector space of DateTime-valued vectors.
override bool Contains(IElement Element)
Checks if the set contains an element.
override bool Equals(object obj)
Compares the element to another.
override IAbelianGroupElement Zero
Returns the zero element of the group.
DateTimeVectors(int Dimension)
Pseudo-vector space of DateTime-valued vectors.
override int GetHashCode()
Calculates a hash code of the element.
Basic interface for all types of abelian group elements.
Basic interface for all types of elements.
Definition: IElement.cs:20
Basic interface for all types of fields.
Definition: IField.cs:9