Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ComplexMatrix.cs
1using System;
3using System.Numerics;
4using System.Text;
12
14{
18 public sealed class ComplexMatrix : RingElement, IMatrix
19 {
20 private Complex[,] values;
21 private IElement[,] matrixElements;
22 private ICollection<IElement> elements;
23 private readonly int rows;
24 private readonly int columns;
25
30 public ComplexMatrix(Complex[,] Values)
31 {
32 this.values = Values;
33 this.elements = null;
34 this.matrixElements = null;
35 this.rows = Values.GetLength(0);
36 this.columns = Values.GetLength(1);
37 }
38
45 public ComplexMatrix(int Rows, int Columns, ICollection<IElement> Elements)
46 {
47 this.values = null;
48 this.elements = Elements;
49 this.matrixElements = null;
50 this.rows = Rows;
51 this.columns = Columns;
52 }
53
57 public Complex[,] Values
58 {
59 get
60 {
61 if (this.values is null)
62 {
63 Complex[,] v = new Complex[this.rows, this.columns];
64 int x = 0;
65 int y = 0;
66
67 if (this.elements is ChunkedList<IElement> Values)
68 {
69 ChunkNode<IElement> Loop = Values.FirstChunk;
70 int i, c;
71
72 while (!(Loop is null))
73 {
74 for (i = Loop.Start, c = Loop.Pos; i < c; i++)
75 {
76 if (!(Loop[i].AssociatedObjectValue is Complex z))
77 z = 0;
78
79 v[y, x++] = z;
80 if (x >= this.columns)
81 {
82 y++;
83 x = 0;
84 }
85 }
86
87 Loop = Loop.Next;
88 }
89 }
90 else
91 {
92 foreach (IElement E in this.elements)
93 {
94 if (!(E.AssociatedObjectValue is Complex z))
95 z = 0;
96
97 v[y, x++] = z;
98 if (x >= this.columns)
99 {
100 y++;
101 x = 0;
102 }
103 }
104 }
105
106 this.values = v;
107 }
108
109 return this.values;
110 }
111 }
112
116 public ICollection<IElement> Elements
117 {
118 get
119 {
120 if (this.elements is null)
121 {
122 int x, y, i = 0;
123 IElement[] v = new IElement[this.rows * this.columns];
124
125 for (y = 0; y < this.rows; y++)
126 {
127 for (x = 0; x < this.columns; x++)
128 v[i++] = new ComplexNumber(this.values[y, x]);
129 }
130
131 this.elements = v;
132 }
133
134 return this.elements;
135 }
136 }
137
142 {
143 get
144 {
145 if (this.matrixElements is null)
146 {
147 IElement[,] v = new IElement[this.rows, this.columns];
148 int x = 0;
149 int y = 0;
150
151 foreach (IElement E in this.Elements)
152 {
153 v[y, x++] = E;
154 if (x >= this.columns)
155 {
156 y++;
157 x = 0;
158 }
159 }
160
161 this.matrixElements = v;
162 }
163
164 return this.matrixElements;
165 }
166 }
167
171 public int Rows => this.rows;
172
176 public int Columns => this.columns;
177
179 public override string ToString()
180 {
181 Complex[,] v = this.Values;
182 StringBuilder sb = null;
183 bool First;
184 int x, y;
185
186 for (y = 0; y < this.rows; y++)
187 {
188 if (sb is null)
189 sb = new StringBuilder("[[");
190 else
191 sb.Append(",\r\n [");
192
193 First = true;
194 for (x = 0; x < this.columns; x++)
195 {
196 if (First)
197 First = false;
198 else
199 sb.Append(", ");
200
201 sb.Append(Expression.ToString(v[y, x]));
202 }
203
204 sb.Append(']');
205 }
206
207 if (sb is null)
208 sb = new StringBuilder("[[]]");
209 else
210 sb.Append(']');
211
212 return sb.ToString();
213 }
214
218 public override IRing AssociatedRing
219 {
220 get
221 {
222 if (this.associatedMatrixSpace is null)
223 this.associatedMatrixSpace = new ComplexMatrices(this.rows, this.columns);
224
225 return this.associatedMatrixSpace;
226 }
227 }
228
229 private ComplexMatrices associatedMatrixSpace = null;
230
234 public override object AssociatedObjectValue => this;
235
242 {
243 Complex[,] v;
244 int x, y, z;
245
246 if (Element.AssociatedObjectValue is Complex n)
247 {
248 Complex[,] Values = this.Values;
249
250 v = new Complex[this.rows, this.columns];
251
252 for (y = 0; y < this.rows; y++)
253 {
254 for (x = 0; x < this.columns; x++)
255 v[y, x] = n * Values[y, x];
256 }
257
258 return new ComplexMatrix(v);
259 }
260 else if (Element is ComplexMatrix Matrix)
261 {
262 if (Matrix.columns != this.rows)
263 return null;
264
265 Complex[,] Values = this.Values;
266 Complex[,] Values2 = Matrix.Values;
267
268 v = new Complex[Matrix.rows, this.columns];
269 for (y = 0; y < Matrix.rows; y++)
270 {
271 for (x = 0; x < this.columns; x++)
272 {
273 n = 0;
274
275 for (z = 0; z < this.rows; z++)
276 n += Values2[y, z] * Values[z, x];
277
278 v[y, x] = n;
279 }
280 }
281
282 return new ComplexMatrix(v);
283 }
284 else if (Element is IMatrix)
285 return new ObjectMatrix(this.MatrixElements).MultiplyLeft(Element);
286 else
287 return null;
288 }
289
296 {
297 Complex[,] v;
298 int x, y, z;
299
300 if (Element.AssociatedObjectValue is Complex n)
301 {
302 Complex[,] Values = this.Values;
303
304 v = new Complex[this.rows, this.columns];
305
306 for (y = 0; y < this.rows; y++)
307 {
308 for (x = 0; x < this.columns; x++)
309 v[y, x] = n * Values[y, x];
310 }
311
312 return new ComplexMatrix(v);
313 }
314 else if (Element is ComplexMatrix Matrix)
315 {
316 if (this.columns != Matrix.rows)
317 return null;
318
319 Complex[,] Values = this.Values;
320 Complex[,] Values2 = Matrix.Values;
321
322 v = new Complex[this.rows, Matrix.columns];
323 for (y = 0; y < this.rows; y++)
324 {
325 for (x = 0; x < Matrix.columns; x++)
326 {
327 n = 0;
328
329 for (z = 0; z < this.columns; z++)
330 n += Values[y, z] * Values2[z, x];
331
332 v[y, x] = n;
333 }
334 }
335
336 return new ComplexMatrix(v);
337 }
338 else if (Element is IMatrix)
339 return new ObjectMatrix(this.MatrixElements).MultiplyRight(Element);
340 else
341 return null;
342 }
343
348 public override IRingElement Invert()
349 {
350 if (this.rows != this.columns)
351 return null;
352
353 Complex[,] Values = this.Values;
354 int c2 = this.columns << 1;
355 Complex[,] v = new Complex[this.rows, c2];
356 int x, y;
357
358 for (y = 0; y < this.rows; y++)
359 {
360 for (x = 0; x < this.columns; x++)
361 {
362 v[y, x] = Values[y, x];
363 v[y, x + this.columns] = (x == y ? 1 : 0);
364 }
365 }
366
367 if (Reduce(v, true, true, out _) < 0)
368 return null;
369
370 Complex[,] v2 = new Complex[this.rows, this.columns];
371
372 for (y = 0; y < this.rows; y++)
373 {
374 for (x = 0; x < this.columns; x++)
375 v2[y, x] = v[y, x + this.columns];
376 }
377
378 return new ComplexMatrix(v2);
379 }
380
392 public IMatrix Reduce(bool Eliminate, bool BreakIfZero, out int Rank, out ICommutativeRingWithIdentityElement Factor)
393 {
394 Complex[,] M = (Complex[,])this.Values.Clone();
395 Rank = Reduce(M, Eliminate, BreakIfZero, out Complex c);
396 Factor = new ComplexNumber(c);
397 return new ComplexMatrix(M);
398 }
399
411 public static int Reduce(Complex[,] Matrix, bool Eliminate, bool BreakIfZero,
412 out Complex Factor)
413 {
414 int x, y, u, z;
415 int Rows = Matrix.GetLength(0);
416 int Columns = Matrix.GetLength(1);
417 int MinCount = Math.Min(Rows, Columns);
418 double a, b;
419 Complex w;
420 int Rank = 0;
421
422 Factor = 1;
423
424 for (x = 0; x < MinCount; x++)
425 {
426 a = Matrix[x, x].Magnitude;
427 z = x;
428 for (y = x + 1; y < Rows; y++)
429 {
430 b = Matrix[y, x].Magnitude;
431 if (b > a)
432 {
433 a = b;
434 z = y;
435 }
436 }
437
438 if (z != x)
439 {
440 for (u = x; u < Columns; u++)
441 {
442 w = Matrix[x, u];
443 Matrix[x, u] = Matrix[z, u];
444 Matrix[z, u] = w;
445 }
446
447 Factor = -Factor;
448 }
449
450 w = Matrix[x, x];
451 if (w == 0)
452 {
453 if (BreakIfZero)
454 return -1;
455 }
456 else
457 {
458 Rank++;
459
460 if (w != 1)
461 {
462 for (u = x; u < Columns; u++)
463 Matrix[x, u] /= w;
464
465 Factor *= w;
466 }
467
468 for (y = Eliminate ? 0 : x + 1; y < Rows; y++)
469 {
470 if (y != x && (w = Matrix[y, x]) != 0)
471 {
472 for (u = x; u < Columns; u++)
473 Matrix[y, u] -= w * Matrix[x, u];
474 }
475 }
476 }
477 }
478
479 return Rank;
480 }
481
488 {
489 Complex[,] v;
490 int x, y;
491
492 if (Element.AssociatedObjectValue is Complex n)
493 {
494 Complex[,] Values = this.Values;
495
496 v = new Complex[this.rows, this.columns];
497
498 for (y = 0; y < this.rows; y++)
499 {
500 for (x = 0; x < this.columns; x++)
501 v[y, x] = n + Values[y, x];
502 }
503
504 return new ComplexMatrix(v);
505 }
506 else if (Element is ComplexMatrix Matrix)
507 {
508 if (this.columns != Matrix.columns || this.rows != Matrix.rows)
509 return null;
510
511 Complex[,] Values = this.Values;
512 Complex[,] Values2 = Matrix.Values;
513
514 v = new Complex[this.rows, this.columns];
515 for (y = 0; y < this.rows; y++)
516 {
517 for (x = 0; x < this.columns; x++)
518 v[y, x] = Values[y, x] + Values2[y, x];
519 }
520
521 return new ComplexMatrix(v);
522 }
523 else if (Element is IMatrix)
524 return new ObjectMatrix(this.MatrixElements).Add(Element);
525 else
526 return null;
527 }
528
533 public override IGroupElement Negate()
534 {
535 Complex[,] Values = this.Values;
536 Complex[,] v = new Complex[this.rows, this.columns];
537 int x, y;
538
539 for (y = 0; y < this.rows; y++)
540 {
541 for (x = 0; x < this.columns; x++)
542 v[y, x] = -Values[y, x];
543 }
544
545 return new ComplexMatrix(v);
546 }
547
553 public override bool Equals(object obj)
554 {
555 if (obj is ComplexMatrix Matrix)
556 {
557 if (this.columns != Matrix.columns || this.rows != Matrix.rows)
558 return false;
559
560 Complex[,] V1 = this.Values;
561 Complex[,] V2 = Matrix.Values;
562 int x, y;
563
564 for (y = 0; y < this.rows; y++)
565 {
566 for (x = 0; x < this.columns; x++)
567 {
568 if (V1[y, x] != V2[y, x])
569 return false;
570 }
571 }
572
573 return true;
574 }
575 else if (obj is IMatrix)
576 return new ObjectMatrix(this.MatrixElements).Equals(obj);
577 else
578 return false;
579 }
580
585 public override int GetHashCode()
586 {
587 Complex[,] Values = this.Values;
588 int Result = 0;
589 int x, y;
590
591 for (y = 0; y < this.rows; y++)
592 {
593 for (x = 0; x < this.columns; x++)
594 Result ^= Values[y, x].GetHashCode();
595 }
596
597 return Result;
598 }
599
603 public override bool IsScalar => false;
604
608 public override ICollection<IElement> ChildElements => this.Elements;
609
617 {
618 return MatrixDefinition.Encapsulate(Elements, this.rows, this.columns, Node);
619 }
620
627 public override IElement Encapsulate(ICollection<IElement> Elements, ScriptNode Node)
628 {
629 return MatrixDefinition.Encapsulate(Elements, this.rows, this.columns, Node);
630 }
631
636 {
637 get
638 {
639 if (this.zero is null)
640 this.zero = new ComplexMatrix(new Complex[this.rows, this.columns]);
641
642 return this.zero;
643 }
644 }
645
646 private ComplexMatrix zero = null;
647
651 public int Dimension => this.rows;
652
656 public ICollection<IElement> VectorElements
657 {
658 get
659 {
660 if (!(this.rowVectors is null))
661 return this.rowVectors;
662
663 Complex[,] v = this.Values;
665 int x, y;
666 Complex[] r;
667
668 for (y = 0; y < this.rows; y++)
669 {
670 r = new Complex[this.columns];
671
672 for (x = 0; x < this.columns; x++)
673 r[x] = v[y, x];
674
675 Rows.Add(new ComplexVector(r));
676 }
677
678 this.rowVectors = Rows;
679 return Rows;
680 }
681 }
682
683 private ChunkedList<IElement> rowVectors = null;
684
690 {
691 Complex[,] v = new Complex[this.columns, this.rows];
692 Complex[,] Values = this.Values;
693 int x, y;
694
695 for (y = 0; y < this.rows; y++)
696 {
697 for (x = 0; x < this.columns; x++)
698 v[x, y] = Values[y, x];
699 }
700
701 return new ComplexMatrix(v);
702 }
703
709 {
710 Complex[,] v = new Complex[this.columns, this.rows];
711 Complex[,] Values = this.Values;
712 int x, y;
713
714 for (y = 0; y < this.rows; y++)
715 {
716 for (x = 0; x < this.columns; x++)
717 v[x, y] = Complex.Conjugate(Values[y, x]);
718 }
719
720 return new ComplexMatrix(v);
721 }
722
728 public IElement GetElement(int Index)
729 {
730 if (Index < 0 || Index >= this.rows)
731 throw new ScriptException("Index out of bounds.");
732
733 Complex[,] M = this.Values;
734 Complex[] V = new Complex[this.columns];
735 int i;
736
737 for (i = 0; i < this.columns; i++)
738 V[i] = M[Index, i];
739
740 return new ComplexVector(V);
741 }
742
748 public void SetElement(int Index, IElement Value)
749 {
750 if (Index < 0 || Index >= this.rows)
751 throw new ScriptException("Index out of bounds.");
752
753 if (!(Value is ComplexVector V))
754 throw new ScriptException("Row vectors in a Complex matrix are required to be Complex vectors.");
755
756 if (V.Dimension != this.columns)
757 throw new ScriptException("Dimension mismatch.");
758
759 Complex[] V2 = V.Values;
760 Complex[,] M = this.Values;
761 this.elements = null;
762
763 int i;
764
765 for (i = 0; i < this.columns; i++)
766 M[Index, i] = V2[i];
767 }
768
775 public IElement GetElement(int Column, int Row)
776 {
777 if (Column < 0 || Column >= this.columns || Row < 0 || Row >= this.rows)
778 throw new ScriptException("Index out of bounds.");
779
780 return new ComplexNumber(this.Values[Row, Column]);
781 }
782
789 public void SetElement(int Column, int Row, IElement Value)
790 {
791 if (Column < 0 || Column >= this.columns || Row < 0 || Row >= this.rows)
792 throw new ScriptException("Index out of bounds.");
793
794 if (!(Value.AssociatedObjectValue is Complex V))
795 throw new ScriptException("Elements in a Complex matrix must be Complex values.");
796
797 Complex[,] M = this.Values;
798 this.elements = null;
799
800 M[Row, Column] = V;
801 }
802
808 public IVector GetRow(int Row)
809 {
810 if (Row < 0 || Row >= this.rows)
811 throw new ScriptException("Index out of bounds.");
812
813 Complex[,] M = this.Values;
814 Complex[] V = new Complex[this.columns];
815 int i;
816
817 for (i = 0; i < this.columns; i++)
818 V[i] = M[Row, i];
819
820 return new ComplexVector(V);
821 }
822
828 public IVector GetColumn(int Column)
829 {
830 if (Column < 0 || Column >= this.columns)
831 throw new ScriptException("Index out of bounds.");
832
833 Complex[,] M = this.Values;
834 Complex[] V = new Complex[this.rows];
835 int i;
836
837 for (i = 0; i < this.rows; i++)
838 V[i] = M[i, Column];
839
840 return new ComplexVector(V);
841 }
842
848 public void SetRow(int Row, IVector Vector)
849 {
850 if (Row < 0 || Row >= this.rows)
851 throw new ScriptException("Index out of bounds.");
852
853 if (Vector.Dimension != this.columns)
854 throw new ScriptException("Vector dimension does not match number of columns");
855
856 if (!(Vector is ComplexVector V))
857 throw new ScriptException("Row vectors in a Complex matrix must be Complex vectors.");
858
859 Complex[] V2 = V.Values;
860 Complex[,] M = this.Values;
861 this.elements = null;
862 int i;
863
864 for (i = 0; i < this.columns; i++)
865 M[Row, i] = V2[i];
866 }
867
873 public void SetColumn(int Column, IVector Vector)
874 {
875 if (Column < 0 || Column >= this.columns)
876 throw new ScriptException("Index out of bounds.");
877
878 if (Vector.Dimension != this.rows)
879 throw new ScriptException("Vector dimension does not match number of rows");
880
881 if (!(Vector is ComplexVector V))
882 throw new ScriptException("Column vectors in a Complex matrix must be Complex vectors.");
883
884 Complex[] V2 = V.Values;
885 Complex[,] M = this.Values;
886 this.elements = null;
887 int i;
888
889 for (i = 0; i < this.rows; i++)
890 M[i, Column] = V2[i];
891 }
892
901 public bool TryFind(IElement Element, out int Column, out int Row)
902 {
903 return this.TryFind(Element, 0, 0, out Column, out Row);
904 }
905
916 public bool TryFind(IElement Element, int FromColumn, int FromRow, out int Column, out int Row)
917 {
918 if (Element is ComplexNumber Z)
919 return this.TryFind(Z.Value, FromColumn, FromRow, out Column, out Row);
920 else
921 {
922 Column = -1;
923 Row = -1;
924 return false;
925 }
926 }
927
938 public bool TryFind(Complex Element, int FromColumn, int FromRow, out int Column, out int Row)
939 {
940 Complex[,] Values = this.Values;
941
942 while (FromRow < this.rows)
943 {
944 while (FromColumn < this.columns)
945 {
946 if (Values[FromRow, FromColumn] == Element)
947 {
948 Column = FromColumn;
949 Row = FromRow;
950
951 return true;
952 }
953
954 FromColumn++;
955 }
956
957 FromColumn = 0;
958 FromRow++;
959 }
960
961 Column = -1;
962 Row = -1;
963
964 return false;
965 }
966
975 public bool TryFindLast(IElement Element, out int Column, out int Row)
976 {
977 return this.TryFindLast(Element, this.columns - 1, this.rows - 1, out Column, out Row);
978 }
979
990 public bool TryFindLast(IElement Element, int FromColumn, int FromRow, out int Column, out int Row)
991 {
992 if (Element is ComplexNumber Z)
993 return this.TryFindLast(Z.Value, FromColumn, FromRow, out Column, out Row);
994 else
995 {
996 Column = -1;
997 Row = -1;
998 return false;
999 }
1000 }
1001
1012 public bool TryFindLast(Complex Element, int FromColumn, int FromRow, out int Column, out int Row)
1013 {
1014 Complex[,] Values = this.Values;
1015
1016 while (FromRow >= 0)
1017 {
1018 while (FromColumn >= 0)
1019 {
1020 if (Values[FromRow, FromColumn] == Element)
1021 {
1022 Column = FromColumn;
1023 Row = FromRow;
1024
1025 return true;
1026 }
1027
1028 FromColumn--;
1029 }
1030
1031 FromColumn = this.columns - 1;
1032 FromRow--;
1033 }
1034
1035 Column = -1;
1036 Row = -1;
1037
1038 return false;
1039 }
1040
1041 }
1042}
Node referencing a chunk in a ChunkedList<T>
Definition: ChunkNode.cs:11
ChunkNode< T > Next
Next chunk
Definition: ChunkNode.cs:26
int Pos
Index after the last element in chunk.
Definition: ChunkNode.cs:51
int Start
Index of first element in chunk.
Definition: ChunkNode.cs:46
A chunked list is a linked list of chunks of objects of type T .
Definition: ChunkedList.cs:54
Base class for all types of elements.
Definition: Element.cs:14
abstract object AssociatedObjectValue
Associated object value.
Definition: Element.cs:43
Base class for all types of ring elements.
Definition: RingElement.cs:10
Base class for script exceptions.
Class managing a script expression.
Definition: Expression.cs:41
static string ToString(double Value)
Converts a value to a string, that can be parsed as part of an expression.
Definition: Expression.cs:4760
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
Pseudo-ring of Complex-valued matrices.
override IElement Encapsulate(ChunkedList< IElement > Elements, ScriptNode Node)
Encapsulates a set of elements into a similar structure as that provided by the current element.
static int Reduce(Complex[,] Matrix, bool Eliminate, bool BreakIfZero, out Complex Factor)
Reduces a matrix.
override ICollection< IElement > ChildElements
An enumeration of child elements. If the element is a scalar, this property will return null.
IElement[,] MatrixElements
Matrix elements
IElement GetElement(int Column, int Row)
Gets an element of the matrix.
IMatrix Transpose()
Returns a transposed matrix.
ICollection< IElement > VectorElements
Vector of row vectors.
bool TryFindLast(Complex Element, int FromColumn, int FromRow, out int Column, out int Row)
Tries to find the last element in the matrix, continuing search from a given position in the matrix....
void SetRow(int Row, IVector Vector)
Gets a row vector from the matrix.
bool TryFind(Complex Element, int FromColumn, int FromRow, out int Column, out int Row)
Tries to find an element in the matrix, continuing search from a given position in the matrix....
bool TryFindLast(IElement Element, int FromColumn, int FromRow, out int Column, out int Row)
Tries to find the last element in the matrix, continuing search from a given position in the matrix....
bool TryFind(IElement Element, int FromColumn, int FromRow, out int Column, out int Row)
Tries to find an element in the matrix, continuing search from a given position in the matrix....
override IAbelianGroupElement Add(IAbelianGroupElement Element)
Tries to add an element to the current element.
override IElement Encapsulate(ICollection< IElement > Elements, ScriptNode Node)
Encapsulates a set of elements into a similar structure as that provided by the current element.
override IAbelianGroupElement Zero
Returns the zero element of the group.
Complex[,] Values
Matrix element values.
override IRingElement MultiplyRight(IRingElement Element)
Tries to multiply an element to the current element, from the right.
ComplexMatrix(Complex[,] Values)
Complex-valued matrix.
override bool Equals(object obj)
Compares the element to another.
override IRingElement MultiplyLeft(IRingElement Element)
Tries to multiply an element to the current element, from the left.
override IGroupElement Negate()
Negates the element.
override IRingElement Invert()
Inverts the element, if possible.
IMatrix ConjugateTranspose()
Returns a conjugate transposed matrix.
IElement GetElement(int Index)
Gets an element of the vector.
IMatrix Reduce(bool Eliminate, bool BreakIfZero, out int Rank, out ICommutativeRingWithIdentityElement Factor)
Reduces a matrix.
override bool IsScalar
If the element represents a scalar value.
bool TryFindLast(IElement Element, out int Column, out int Row)
Tries to find the last element in the matrix. Search is done, right to left, bottom to top.
ICollection< IElement > Elements
Matrix elements.
void SetElement(int Column, int Row, IElement Value)
Sets an element in the matrix.
IVector GetRow(int Row)
Gets a row vector from the matrix.
bool TryFind(IElement Element, out int Column, out int Row)
Tries to find an element in the matrix. Search is done, left to right, top to bottom.
IVector GetColumn(int Column)
Gets a column vector from the matrix.
int Dimension
Dimension of matrix, if seen as a vector of row vectors.
void SetElement(int Index, IElement Value)
Sets an element in the vector.
override int GetHashCode()
Calculates a hash code of the element.
override object AssociatedObjectValue
Associated object value.
void SetColumn(int Column, IVector Vector)
Gets a column vector from the matrix.
override IRing AssociatedRing
Associated Ring.
ComplexMatrix(int Rows, int Columns, ICollection< IElement > Elements)
Complex-valued vector.
override IRingElement MultiplyRight(IRingElement Element)
Tries to multiply an element to the current element, from the right.
override IAbelianGroupElement Add(IAbelianGroupElement Element)
Tries to add an element to the current element.
override IRingElement MultiplyLeft(IRingElement Element)
Tries to multiply an element to the current element, from the left.
override bool Equals(object obj)
Compares the element to another.
static IMatrix Encapsulate(ICollection< IElement > Rows, ScriptNode Node)
Encapsulates the elements of a matrix.
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:21
object AssociatedObjectValue
Associated object value.
Definition: IElement.cs:34
Basic interface for all types of group elements.
Definition: IGroupElement.cs:9
Basic interface for matrices.
Definition: IMatrix.cs:7
Basic interface for all types of ring elements.
Definition: IRingElement.cs:10
Basic interface for vectors.
Definition: IVector.cs:9
int Dimension
Dimension of vector.
Definition: IVector.cs:14
Basic interface for all types of rings.
Definition: IRing.cs:10
Definition: ImplTypes.g.cs:58