Accord.Tests.Math.CholeskyDecompositionTest.LogDeterminantTest2 C# (CSharp) Method

LogDeterminantTest2() private method

private LogDeterminantTest2 ( ) : void
return void
        public void LogDeterminantTest2()
        {
            double[,] value =
            {
               {  6, -1,  2,  1 },
               { -1,  9, -3, -2 },
               {  2, -3,  8,  1 },
               {  1, -2,  1,  7 },
            };

            var chol = new CholeskyDecomposition(value);
            Assert.AreEqual(2232, chol.Determinant, 1e-12);
            Assert.IsTrue(chol.IsPositiveDefinite);

            double expected = System.Math.Log(2232);
            double actual = chol.LogDeterminant;

            Assert.AreEqual(expected, actual, 1e-10);
        }