예제 #1
0
		public void TransposeLong()
		{
			ComplexDoubleMatrix a = new ComplexDoubleMatrix(3, 2);
			a[0, 0] = new Complex(1);
			a[0, 1] = new Complex(2);
			a[1, 0] = new Complex(3);
			a[1, 1] = new Complex(4);
			a[2, 0] = new Complex(5);
			a[2, 1] = new Complex(6);
			a.Transpose();
			Assert.AreEqual(a[0, 0], new Complex(1));
			Assert.AreEqual(a[0, 1], new Complex(3));
			Assert.AreEqual(a[0, 2], new Complex(5));
			Assert.AreEqual(a[1, 0], new Complex(2));
			Assert.AreEqual(a[1, 1], new Complex(4));
			Assert.AreEqual(a[1, 2], new Complex(6));
			Assert.AreEqual(a.RowLength, 2);
			Assert.AreEqual(a.ColumnLength, 3);
		}
예제 #2
0
		public void TransposeSquare()
		{
			ComplexDoubleMatrix a = new ComplexDoubleMatrix(2, 2);
			a[0, 0] = new Complex(1);
			a[0, 1] = new Complex(2);
			a[1, 0] = new Complex(3);
			a[1, 1] = new Complex(4);
			a.Transpose();
			Assert.AreEqual(a[0, 0], new Complex(1));
			Assert.AreEqual(a[0, 1], new Complex(3));
			Assert.AreEqual(a[1, 0], new Complex(2));
			Assert.AreEqual(a[1, 1], new Complex(4));
		}