Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
BooleanValues.cs
1using System;
4
6{
10 public sealed class BooleanValues : Field, IOrderedSet
11 {
12 private static readonly int hashCode = typeof(BooleanValues).FullName.GetHashCode();
13
18 {
19 }
20
25 {
26 get { return BooleanValue.True; }
27 }
28
32 public override IAbelianGroupElement Zero
33 {
34 get { return BooleanValue.False; }
35 }
36
42 public override bool Contains(IElement Element)
43 {
44 return Element.AssociatedObjectValue is bool;
45 }
46
48 public override bool Equals(object obj)
49 {
50 return obj is BooleanValues;
51 }
52
54 public override int GetHashCode()
55 {
56 return hashCode;
57 }
58
65 public int Compare(IElement x, IElement y)
66 {
69
70 return b1.Value.CompareTo(b2.Value);
71 }
72 }
73}
Base class for all types of elements.
Definition: Element.cs:13
Base class for all types of fields.
Definition: Field.cs:10
Boolean-valued number.
Definition: BooleanValue.cs:12
static readonly BooleanValue False
Constant false value.
static readonly BooleanValue True
Constant true value.
The field Z_2 of boolean numbers ([0]_2, 0 or false, and [1]_2, 1 or true).
BooleanValues()
The field Z_2 of boolean numbers ([0]_2, 0 or false, and [1]_2, 1 or true).
override ICommutativeRingWithIdentityElement One
Returns the identity element of the commutative ring with identity.
override int GetHashCode()
Calculates a hash code of the element. Hash code.
int Compare(IElement x, IElement y)
Compares two double values.
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.
override IAbelianGroupElement Zero
Returns the zero element of the group.
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