예제 #1
0
        public void QRTest()
        {
            double[,] Arr1 = new double[4, 4] { { 4, 1, -2, 2 }, { 1, 2, 0, 1 }, { -2, 0, 3, -2 }, { 2, 1, -2, -1 } };
            double[,] Arr2 = new double[4, 4] { { 3,1,0,1 }, { 1, 3, 1,1 }, {0,1,3,1 },{1,1,1,3} };
            MMatrix A = new MMatrix(Arr2);
            MMatrix B = new MMatrix(Arr2);
            string s = "";

            try
            {

                s += "\nA=\n" + A.PrintToString();

                A.Householder();
                s += "\nHouseholder (A): A(n-1)=\n" + A.PrintToString();
                s += "\nEigenvalues approximation: " + A.Eigenvalues().PrintToString();

                s += "\nEigenvalues: " + B.Eigenvalues().PrintToString();

                this.RichText_Display(s);
            }
            catch (MMatrixException exp)
            {
                MessageBox.Show("INFO: " + exp.Message, sProjectTile, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }