Accord.Tests.Math.MatrixTest.ReshapeTest C# (CSharp) Method

ReshapeTest() private method

private ReshapeTest ( ) : void
return void
        public void ReshapeTest()
        {
            int[,] start = 
            {
                { 1, 3, 5},
                { 2, 4, 6},
            };

            int[] middle = Matrix.Reshape(start);

            int[] array = { 1, 3, 5, 2, 4, 6 };
            Assert.IsTrue(Matrix.IsEqual(array, middle));

            int rows = 3;
            int cols = 2;

            int[,] expected = 
            {
                { 1, 3 },
                { 5, 2 },
                { 4, 6 },
            };

            int[,] actual = Matrix.Reshape(array, rows, cols);
            Assert.IsTrue(Matrix.IsEqual(expected, actual));

            rows = 2;
            cols = 3;

            actual = Matrix.Reshape(array, rows, cols);
            Assert.IsTrue(Matrix.IsEqual(start, actual));
        }
MatrixTest