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

AddMatrixAndVectorTest() private method

private AddMatrixAndVectorTest ( ) : void
return void
        public void AddMatrixAndVectorTest()
        {
            double[,] a = Matrix.Create(3, 5, 0.0);
            double[] v = { 1, 2, 3, 4, 5 };
            double[,] actual;


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

            actual = Matrix.Add(a, v, 0); // Add to rows
            Assert.IsTrue(Matrix.IsEqual(expected, actual));


            double[,] b = Matrix.Create(5, 4, 0.0);
            double[] u = { 1, 2, 3, 4, 5 };

            double[,] expected2 = 
            {
                { 1, 1, 1, 1, },
                { 2, 2, 2, 2, },
                { 3, 3, 3, 3, },
                { 4, 4, 4, 4, },
                { 5, 5, 5, 5, },
            };

            actual = Matrix.Add(b, u, 1); // Add to columns
            Assert.IsTrue(Matrix.IsEqual(expected2, actual));

        }
MatrixTest