private void методСопряженныхГрадиентовToolStripMenuItem_Click(object sender, EventArgs e) { InitMethodParameters(); istest = false; isrectangle = true; task = new MainTaskRectangle(a, b, c, d, n, m, eps, nmax, initApprx, w); task2 = new MainTaskRectangle(a, b, c, d, 2 * n, 2 * m, eps, nmax, initApprx, w); task.ConjugateGradientMethod(); task2.ConjugateGradientMethod(); int iTotalEps = -1, jTotalEps = -1; double maxError = CalculateMainError(ref task, ref task2, ref iTotalEps, ref jTotalEps); double xTotalEps = a + iTotalEps * (b - a) / n; double yTotalEps = c + jTotalEps * (d - c) / m; double rmax = task.RMax(); double rmax2 = task2.RMax(); double r2 = task.R2(); double r22 = task2.R2(); WriteResults(istest, maxError, iTotalEps, jTotalEps, xTotalEps, yTotalEps, task.epsMax, task.countSteps, rmax, r2, rmax2, r22); str_w.Text = task.w.ToString(); }
private void МетодМинимальныхНевязокToolStripMenuItem1_Click(object sender, EventArgs e) { InitMethodParameters(); istest = false; isrectangle = true; task = new MainTaskRectangle(a, b, c, d, n, m, eps, nmax, initApprx); task2 = new MainTaskRectangle(a, b, c, d, 2 * n, 2 * m, eps, nmax, initApprx); task.MinimumResidualsMethod(); task2.MinimumResidualsMethod(); int iTotalEps = -1, jTotalEps = -1; double maxError = CalculateMainError(ref task, ref task2, ref iTotalEps, ref jTotalEps); double xTotalEps = a + iTotalEps * (b - a) / n; double yTotalEps = c + jTotalEps * (d - c) / m; double rmax = task.RMax(); double rmax2 = task2.RMax(); double r2 = task.R2(); double r22 = task2.R2(); WriteResults(istest, maxError, iTotalEps, jTotalEps, xTotalEps, yTotalEps, task.epsMax, task.countSteps, rmax, r2, rmax2, r22); str_w.Text = task.w.ToString(); }