예제 #1
0
        public void TestRowMulitply2()
        {
            TridiagonalMatrix m = new TridiagonalMatrix(2);

            m.Data[0, 0] = 1;
            m.Data[0, 1] = 2;
            m.Data[1, 0] = 3;
            m.Data[1, 1] = 4;

            m.RowMultiply(1, -2);

            Assert.AreEqual(1, m.Data[0, 0]);
            Assert.AreEqual(2, m.Data[0, 1]);
            Assert.AreEqual(-6, m.Data[1, 0]);
            Assert.AreEqual(-8, m.Data[1, 1]);
        }
예제 #2
0
        public void TestRowMulitply1()
        {
            TridiagonalMatrix m = new TridiagonalMatrix(2);

            m.Data[0, 0] = 1;
            m.Data[0, 1] = 2;
            m.Data[1, 0] = 3;
            m.Data[1, 1] = 4;

            m.RowMultiply(0, 2);

            Assert.AreEqual(2, m.Data[0, 0]);
            Assert.AreEqual(4, m.Data[0, 1]);
            Assert.AreEqual(3, m.Data[1, 0]);
            Assert.AreEqual(4, m.Data[1, 1]);
        }