Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Ring.cs
2
4{
8 public abstract class Ring : AbelianGroup, IRing
9 {
13 public Ring()
14 : base()
15 {
16 }
17
24 public virtual IRingElement Multiply(IRingElement Left, IRingElement Right)
25 {
26 IRingElement Result;
27
28 Result = Left.MultiplyRight(Right);
29 if (!(Result is null))
30 return Result;
31
32 Result = Right.MultiplyLeft(Left);
33 if (!(Result is null))
34 return Result;
35
36 return null;
37 }
38
46 {
47 IRingElement Inverse = Right.Invert();
48 if (Inverse is null)
49 return null;
50 else
51 return this.Multiply(Left, Inverse) as IRingElement;
52 }
53
61 {
62 IRingElement Inverse = Left.Invert();
63 if (Inverse is null)
64 return null;
65 else
66 return this.Multiply(Inverse, Right) as IRingElement;
67 }
68
72 public abstract bool IsCommutative
73 {
74 get;
75 }
76 }
77}
Base class for all types of abelian groups.
Definition: AbelianGroup.cs:10
Base class for all types of rings.
Definition: Ring.cs:9
abstract bool IsCommutative
If the ring * operator is commutative or not.
Definition: Ring.cs:73
virtual IRingElement RightDivide(IRingElement Left, IRingElement Right)
Divides the right ring element from the left one: Left*(1/Right)
Definition: Ring.cs:45
virtual IRingElement LeftDivide(IRingElement Left, IRingElement Right)
Divides the left ring element from the right one: (1/Left)*Right.
Definition: Ring.cs:60
virtual IRingElement Multiply(IRingElement Left, IRingElement Right)
Multiplies two ring elements, if possible.
Definition: Ring.cs:24
Ring()
Base class for all types of rings.
Definition: Ring.cs:13
Basic interface for all types of ring elements.
Definition: IRingElement.cs:10
IRingElement MultiplyRight(IRingElement Element)
Tries to multiply an element to the current element, from the right.
IRingElement Invert()
Inverts the element, if possible.
IRingElement MultiplyLeft(IRingElement Element)
Tries to multiply an element to the current element, from the left.
Basic interface for all types of rings.
Definition: IRing.cs:10