Ejemplo n.º 1
0
        public void UnitMatrixNorms()
        {
            UnitMatrix   I = UnitMatrix.OfDimension(4);
            SquareMatrix A = I.ToSquareMatrix();

            Assert.IsTrue(I.OneNorm() == A.OneNorm());
            Assert.IsTrue(I.InfinityNorm() == A.InfinityNorm());
            Assert.IsTrue(I.FrobeniusNorm() == A.FrobeniusNorm());
            Assert.IsTrue(I.MaxNorm() == A.MaxNorm());
        }
Ejemplo n.º 2
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);
        }