Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
AbelianGroup.cs
1using System;
3
5{
9 public abstract class AbelianGroup : Group, IAbelianGroup
10 {
14 public AbelianGroup()
15 : base()
16 {
17 }
18
25 public override sealed IGroupElement RightSubtract(IGroupElement Left, IGroupElement Right)
26 {
27 if (Left is IAbelianGroupElement L && Right is IAbelianGroupElement R)
28 return this.Subtract(L, R);
29 else
30 return base.RightSubtract(Left, Right);
31 }
32
39 public override sealed IGroupElement LeftSubtract(IGroupElement Left, IGroupElement Right)
40 {
41 if (Left is IAbelianGroupElement L && Right is IAbelianGroupElement R)
42 return this.Subtract(R, L);
43 else
44 return base.LeftSubtract(Left, Right);
45 }
46
54 {
55 return this.Add(Left, Right.Negate()) as IAbelianGroupElement;
56 }
57
61 public override sealed bool IsAbelian
62 {
63 get
64 {
65 return true;
66 }
67 }
68
72 public override sealed IGroupElement AdditiveIdentity
73 {
74 get
75 {
76 return this.Zero;
77 }
78 }
79
83 public abstract IAbelianGroupElement Zero
84 {
85 get;
86 }
87
88 }
89}
Base class for all types of abelian groups.
Definition: AbelianGroup.cs:10
virtual IAbelianGroupElement Subtract(IAbelianGroupElement Left, IAbelianGroupElement Right)
Subtracts the right group element from the left one: Left-Right
Definition: AbelianGroup.cs:53
override sealed IGroupElement RightSubtract(IGroupElement Left, IGroupElement Right)
Subtracts the right group element from the left one: Left+(-Right)
Definition: AbelianGroup.cs:25
override sealed bool IsAbelian
If the group + operator is commutative or not. (For abelian groups, this is always true....
Definition: AbelianGroup.cs:62
abstract IAbelianGroupElement Zero
Returns the zero element of the group.
Definition: AbelianGroup.cs:84
AbelianGroup()
Base class for all types of abelian groups.
Definition: AbelianGroup.cs:14
override sealed IGroupElement AdditiveIdentity
Returns the additive identity of the group. (For abelian groups, this calls Zero.)
Definition: AbelianGroup.cs:73
override sealed IGroupElement LeftSubtract(IGroupElement Left, IGroupElement Right)
Subtracts the left group element from the right one: (-Left)+Right.
Definition: AbelianGroup.cs:39
Base class for all types of groups.
Definition: Group.cs:10
virtual ISemiGroupElement Add(ISemiGroupElement Left, ISemiGroupElement Right)
Adds two semigroup elements, if possible.
Definition: SemiGroup.cs:25
Basic interface for all types of abelian group elements.
Basic interface for all types of group elements.
Definition: IGroupElement.cs:9
IGroupElement Negate()
Negates the element.
Basic interface for all types of abelian groups.