public void Transpose() { var A = new ElasticMatrix <int>(3, 2); A[0, 0] = 0; A[0, 1] = 1; A[1, 0] = 2; A[1, 1] = 4; A[2, 0] = 0; A[2, 1] = 3; var At = A.Transpose(); var Att = At.Transpose(); var Attt = Att.Transpose(); Assert.IsTrue(A.Equals(Att)); Assert.IsTrue(At.Equals(Attt)); Assert.IsFalse(A.Equals(At)); }
public void Sorting() { var A = new ElasticMatrix <int>(3, 4); A[0, 0] = 10; A[0, 1] = 11; A[0, 2] = 12; A[0, 3] = 13; A[1, 3] = 23; A[1, 0] = 20; A[1, 1] = 21; A[2, 3] = 33; A[2, 2] = 32; A[2, 1] = 31; A[2, 0] = 30; var B = new ElasticMatrix <int>(A); Assert.IsTrue(A.Equals(B)); A.Sorting(); Assert.IsFalse(A.Equals(B)); var E = new ElasticMatrix <int>(3, 4); E[0, 0] = 10; E[0, 1] = 11; E[0, 2] = 12; E[0, 3] = 13; E[1, 0] = 20; E[1, 1] = 21; E[1, 3] = 23; E[2, 0] = 30; E[2, 1] = 31; E[2, 2] = 32; E[2, 3] = 33; Assert.IsTrue(E.Equals(A)); }