Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CommutativeRing.cs
1using System;
3
5{
9 public abstract class CommutativeRing : Ring, ICommutativeRing
10 {
15 : base()
16 {
17 }
18
25 public override sealed IRingElement RightDivide(IRingElement Left, IRingElement Right)
26 {
27 if (Left is ICommutativeRingElement L && Right is ICommutativeRingElement R)
28 return this.Divide(L, R);
29 else
30 return base.RightDivide(Left, Right);
31 }
32
40 {
41 return this.Multiply(Left, Right.Invert()) as ICommutativeRingElement;
42 }
43
47 public override sealed bool IsCommutative
48 {
49 get
50 {
51 return true;
52 }
53 }
54
55 }
56}
Base class for all types of commutative rings.
override sealed IRingElement RightDivide(IRingElement Left, IRingElement Right)
Divides the right ring element from the left one: Left*(1/Right)
CommutativeRing()
Base class for all types of commutative rings.
virtual ICommutativeRingElement Divide(ICommutativeRingElement Left, ICommutativeRingElement Right)
Divides the right ring element from the left one: Left/Right
override sealed bool IsCommutative
If the ring * operator is commutative or not.
Base class for all types of rings.
Definition: Ring.cs:9
virtual IRingElement Multiply(IRingElement Left, IRingElement Right)
Multiplies two ring elements, if possible.
Definition: Ring.cs:24
Basic interface for all types of commutative ring elements.
Basic interface for all types of ring elements.
Definition: IRingElement.cs:10
IRingElement Invert()
Inverts the element, if possible.
Basic interface for all types of commutative rings.