private void SolveMainTask_Click(object sender, EventArgs e)
        {
            if (!ParseArguments())
            {
                MessageBox.Show("ERROR!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            double maxDif     = 0.0;
            double maxAccMain = acc_max;
            double maxAccHalf = acc_max;
            uint   IterMain   = Nmax;
            uint   IterHalf   = Nmax;
            uint   maxI       = 0u;
            uint   maxJ       = 0u;


            Method main, half;

            if (SimpleIterButton.Checked == true)
            {
                main = new SimpleIteration();
                half = new SimpleIteration();
            }
            else
            {
                main = new ConjGradient();
                half = new ConjGradient();
            }

            main.Init(Xo, Xn, Yo, Yn, N, M, approximationType);
            main.SetFunctions(mu1Main, mu2Main, mu3Main, mu4Main, FunctionMain);
            main.Run(ref IterMain, ref maxAccMain);

            SimpleIterationParameterLabel.Text = "Параметр метода: " + main.GetMethodParameter();

            half.Init(Xo, Xn, Yo, Yn, N * 2u, M * 2u, approximationType);
            half.SetFunctions(mu1Main, mu2Main, mu3Main, mu4Main, FunctionMain);
            half.Run(ref IterHalf, ref maxAccHalf);

            FindMax(CalculateDifferenceTableForMainTask(main.data, half.data, N, M), out maxDif, out maxI, out maxJ);


            ChangeLabelValue(MaxDifLabelMain, maxDif.ToString());
            ChangeLabelValue(ResidualMainTextBox, main.CalculateResidual().ToString());
            ChangeLabelValue(IterLabelMain, IterMain.ToString());
            ChangeLabelValue(AccMaxLabelMain, maxAccMain.ToString());
            ChangeLabelValue(ResidualHalfTextBox, half.CalculateResidual().ToString());
            ChangeLabelValue(IterLabelMainHalf, IterHalf.ToString());
            ChangeLabelValue(AccMaxLabelMainHalf, maxAccHalf.ToString());
            ChangeLabelValue(DotLabel, "Соответствует узлу x = " + Math.Abs(Math.Round(main.X(maxI), 3)).ToString() +
                             "  y = " + Math.Abs(Math.Round(main.Y(maxJ), 3)).ToString());

            tableCreator.Init(N * 2 + 1u, M * 2 + 1u);
            ChangeTableValues(TableHalf, half.data);

            tableCreator.Init(N + 1u, M + 1u);
            ChangeTableValues(TableMain, main.data);
            ChangeTableValues(TableDiffMain, CalculateDifferenceTableForMainTask(main.data, half.data, N, M));
        }
        private void SolveTestTask_Click(object sender, EventArgs e)
        {
            if (!ParseArguments())
            {
                MessageBox.Show("ERROR!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            double maxDif    = 0.0;
            double maxAcc    = acc_max;
            uint   iterCount = Nmax;
            uint   maxI      = 0u;
            uint   maxJ      = 0u;
            Method task;

            if (SimpleIterButton.Checked == true)
            {
                task = new SimpleIteration();
            }
            else
            {
                task = new ConjGradient();
            }


            task.Init(Xo, Xn, Yo, Yn, N, M, approximationType);
            task.SetFunctions(mu1Test, mu2Test, mu3Test, mu4Test, FunctionTest, ExactFunction);

            task.Run(ref iterCount, ref maxAcc);

            SimpleIterationParameterLabel.Text = "Параметр метода: " + task.GetMethodParameter();


            FindMax(
                CalculateDifferenceTableForTestTask(
                    task.data, task.GetExactTable(), task.N, task.M),
                out maxDif, out maxI, out maxJ);

            ChangeLabelValue(ResidualTextBox, task.CalculateResidual().ToString());
            ChangeLabelValue(IterLabel, iterCount.ToString());
            ChangeLabelValue(AccMaxLabel, maxAcc.ToString());
            ChangeLabelValue(maxDifLabel, maxDif.ToString());
            ChangeLabelValue(DotLabelTest, "Соответствует узлу x = " + Math.Abs(Math.Round(task.X(maxI), 3)).ToString() +
                             "  y = " + Math.Abs(Math.Round(task.Y(maxJ), 3)).ToString());

            tableCreator.Init(N + 1u, M + 1u);

            ChangeTableValues(Table, task.data);
            ChangeTableValues(TableExact, task.GetExactTable());
            ChangeTableValues(TableDiffTest,
                              CalculateDifferenceTableForTestTask(task.data, task.GetExactTable(), N, M));
        }