Esempio n. 1
0
        public static void test_is_positive_definite()
        {
            Console.WriteLine("\nTesting is_positive_definite(Matrix A) ...\n");
            Numeric n = new Numeric();
            List<double[]> list1 = new List<double[]>() { new double[] { 1, 2 }, new double[] { 2, 1 } }; //false
            List<double[]> list2 = new List<double[]>() { new double[] { 2, -1, 0 }, new double[] { -1, 2, -1 }, new double[] { 0, -1, 2 } }; //true

            Console.Write("\n\tExpect Fail: is_positive_definite(" + Matrix.from_list(list1) + ") = ");
            Console.WriteLine(n.is_positive_definite(Matrix.from_list(list1)));
            Console.WriteLine("\tExpect True: is_positive_definite(" + Matrix.from_list(list2) + ") = " + n.is_positive_definite(Matrix.from_list(list2)));
        }