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

InsertRowTest2() private method

private InsertRowTest2 ( ) : void
return void
        public void InsertRowTest2()
        {
            double[,] a =
            { 
               { 100.00, 27.56, 33.89},
               { 27.56, 100.00, 24.76},
               { 33.89, 24.76, 100.00} 
             };

            Assert.AreEqual(3, a.GetLength(0));
            Assert.AreEqual(3, a.GetLength(1));

            double[,] b = a.InsertColumn(new double[] { 1, 2, 3, 100 });

            Assert.AreEqual(3, a.GetLength(0));
            Assert.AreEqual(3, a.GetLength(1));
            Assert.AreEqual(4, b.GetLength(0));
            Assert.AreEqual(4, b.GetLength(1));
            Assert.IsTrue(b.GetRow(3).IsEqual(new[] { 0, 0, 0, 100 }));

            double[,] c = a.InsertRow(new double[] { 1, 2, 3, 100 });

            Assert.AreEqual(3, a.GetLength(0));
            Assert.AreEqual(3, a.GetLength(1));
            Assert.AreEqual(4, c.GetLength(0));
            Assert.AreEqual(4, c.GetLength(1));
            Assert.IsTrue(c.GetColumn(3).IsEqual(new[] { 0, 0, 0, 100 }));

            a = a.InsertColumn(new double[] { 1, 2, 3 })
                 .InsertRow(new double[] { 1, 2, 3, 100 });

            Assert.AreEqual(4, a.GetLength(0));
            Assert.AreEqual(4, a.GetLength(1));
            Assert.IsTrue(a.GetRow(3).IsEqual(new[] { 1, 2, 3, 100 }));
            Assert.IsTrue(a.GetColumn(3).IsEqual(new[] { 1, 2, 3, 100 }));
        }
MatrixTest