Ejemplo n.º 1
0
        public void Constructor_WhenPassedArray_ReturnsCorrectSize()
        {
            var arr = new int[3, 2];
            var matrix = new CoolMatrix(arr);

            var expectedSize = new Size(3, 2);

            Assert.AreEqual(expectedSize, matrix.Size);
        }
Ejemplo n.º 2
0
 public CoolMatrix Transpose(CoolMatrix matrixA)
 {
     int[, ] arrResult = new int[matrixA.height, matrixA.width ];
     for (int i = 0; i < matrixA.width; i++)
     {
         for (int j = 0; j < matrixA.height; j++)
         {
             arrResult[j, i] = matrixA.arr[i, j];
         }
     }
     return arrResult;
 }