Example #1
0
        public void UnitMatrixConversions()
        {
            UnitMatrix I = UnitMatrix.OfDimension(3);

            SquareMatrix A = I.ToSquareMatrix();

            Assert.IsTrue(I == A);
            A[0, 1] += 2.0;
            Assert.IsTrue(I != A);

            SymmetricMatrix B = I.ToSymmetricMatrix();

            Assert.IsTrue(I == B);
            B[0, 1] += 2.0;
            Assert.IsTrue(I != B);

            DiagonalMatrix C = I.ToDiagonalMatrix();

            Assert.IsTrue(I == C);
            C[2, 2] -= 1.0;
            Assert.IsTrue(I != C);
        }