Пример #1
0
        private void prikaz(PosrednoIzjednacenje mnk)
        {
            MatrixVectorAndControls mvc = new MatrixVectorAndControls();

            double dd = mnk.N[1, 1];

            StatusStrip(mnk);


            ListView N = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "N", N, mnk.N, mvc.ListViewColumnHeaderToList(lvA), mvc.ListViewColumnHeaderToList(lvA));

            ListView n = new ListView();

            mvc.VectorToTabPage(tcIzjednacenje, "n", n, mnk.n, "n", mvc.ListViewColumnHeaderToList(lvA));

            ListView Qx = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "Qx", Qx, mnk.Qx, mvc.ListViewColumnHeaderToList(lvA), mvc.ListViewColumnHeaderToList(lvA));

            ListView x2d = new ListView();

            mvc.VectorToTabPage(tcIzjednacenje, "x", x2d, mnk.x, "x", mvc.ListViewColumnHeaderToList(lvA));

            ListView v = new ListView();

            mvc.VectorToTabPage(tcIzjednacenje, "v", v, mnk.v, "v", mvc.ListViewColumnHeaderToList(lvP));

            ListView Qlcap = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "Qî", Qlcap, mnk.Qlcap, mvc.ListViewColumnHeaderToList(lvP), mvc.ListViewColumnHeaderToList(lvP));

            ListView Qv = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "Qv", Qv, mnk.Qv, mvc.ListViewColumnHeaderToList(lvP), mvc.ListViewColumnHeaderToList(lvP));

            ListView Ql = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "Ql", Ql, mnk.Ql, mvc.ListViewColumnHeaderToList(lvP), mvc.ListViewColumnHeaderToList(lvP));

            ListView R = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "R", R, mnk.R, mvc.ListViewColumnHeaderToList(lvP), mvc.ListViewColumnHeaderToList(lvP));

            ListView U = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "U", U, mnk.U, mvc.ListViewColumnHeaderToList(lvP), mvc.ListViewColumnHeaderToList(lvP));

            ListView RU = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "R + U = I", RU, mnk.R + mnk.U, mvc.ListViewColumnHeaderToList(lvP), mvc.ListViewColumnHeaderToList(lvP));
        }
Пример #2
0
        private void Izjednacenje()
        {
            tcIzjednacenje.TabPages.Clear();
            lvOcjenaFunkcija.Items.Clear();

            PosrednoIzjednacenje    MNK;
            MatrixVectorAndControls mvc = new MatrixVectorAndControls();


            DenseMatrix A = mvc.ListViewToMatrix(lvA);
            DenseMatrix P = mvc.ListViewToMatrix(lvP);
            DenseVector f = mvc.ListViewToVector(lvF);
            DenseMatrix G;

            int fprekobrojnost = Math.Abs(A.ColumnCount - A.RowCount);

            if (lvG.Items.Count == 0)
            {
                MNK = new PosrednoIzjednacenje(A, P, f);
            }
            else
            {
                G   = mvc.ListViewToMatrix(lvG);
                MNK = new PosrednoIzjednacenje(A, P, f, G);
                fprekobrojnost++;
            }

            ListView Alv = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "A", Alv, A, mvc.ListViewColumnHeaderToList(lvA), mvc.ListViewColumnHeaderToList(lvP));

            ListView Plv = new ListView();

            mvc.MatrixToTabPage(tcIzjednacenje, "P", Plv, P, mvc.ListViewColumnHeaderToList(lvP), mvc.ListViewColumnHeaderToList(lvP));

            ListView flv = new ListView();

            mvc.VectorToTabPage(tcIzjednacenje, "f", flv, f, "", mvc.ListViewColumnHeaderToList(lvP));



            prikaz(MNK);
            ocjenaFunkcija(MNK);

            izjednaceneVrijednosti izjednaceno = new izjednaceneVrijednosti(MNK);

            izjednaceno.lvMjerenja(lvIzjednacenaMjerenja, lvMjerenje, Convert.ToDouble(tbSigmaNulaKvadrat.Text, CultureInfo.InvariantCulture));
            izjednaceno.lvReperi(lvReperi, lvTocke, Convert.ToDouble(tbSigmaNulaKvadrat.Text, CultureInfo.InvariantCulture), rbIzjednacenjePrisila.Checked);

            double alfa     = Convert.ToDouble(tbLokalniAlfa.Text, CultureInfo.InvariantCulture) / 100;
            double beta     = Convert.ToDouble(tbLokalniBeta.Text, CultureInfo.InvariantCulture) / 100;
            double alfaGlob = Convert.ToDouble(tbGlobalniAlfa.Text, CultureInfo.InvariantCulture) / 100;


            Statistika test = new Statistika(MNK, Convert.ToDouble(tbSigmaNulaKvadrat.Text, CultureInfo.InvariantCulture), alfa, beta, fprekobrojnost, alfaGlob);

            test.LokalniTest(lvStatistika, lvP);

            tsslGlobalniTest.Text = test.Gtest;
            tsslGlobalniTest.Text = test.Gtest;
        }