Пример #1
0
        public void MultiplyVectorExample()
        {
            var vector1 = new VectorN(2);

            vector1[0] = 1;
            vector1[1] = 2;
            var vector2 = new VectorN(2);

            vector2[0] = 3;
            vector2[1] = 4;
            var matrix = vector1.Multiply(vector2);

            Assert.AreEqual(2, matrix.Columns);
            Assert.AreEqual(2, matrix.Rows);
            Assert.AreEqual(3, matrix[0, 0]);
            Assert.AreEqual(4, matrix[0, 1]);
            Assert.AreEqual(6, matrix[1, 0]);
            Assert.AreEqual(8, matrix[1, 1]);
        }