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

DeterminantTest3() private method

private DeterminantTest3 ( ) : void
return void
        public void DeterminantTest3()
        {
            double[,] m =
            {
                { 0, 4, 0, 2 },
                { 4, 1, 2, 4 },
                { 0, 2, 1, 1 },
                { 2, 4, 1, 1 }
            };

            Assert.IsTrue(m.IsSymmetric());
            Assert.IsFalse(m.IsPositiveDefinite());

            double expected = 44;

            bool thrown = false;

            try
            {
                Matrix.Determinant(m, symmetric: true);
            }
            catch (Exception)
            {
                thrown = true;
            }

            Assert.IsTrue(thrown);

            thrown = false;

            try
            {
                Matrix.LogDeterminant(m, symmetric: true);
            }
            catch (Exception)
            {
                thrown = true;
            }

            Assert.IsTrue(thrown);

            double det = Matrix.PseudoDeterminant(m);
            Assert.AreEqual(expected, det, 1e-10);
            Assert.IsFalse(Double.IsNaN(det));
        }
MatrixTest