public DefaultBasisInput(LinearProgrammingProblem canonicalProblem, FormInitialConditions previousForm) { this.canonicalProblem = canonicalProblem; this.previousForm = previousForm; defaultBasisIndexes = new int[canonicalProblem.LimitationNumber]; InitializeComponent(); }
public DefaultSolutionInput(LinearProgrammingProblem canonicalProblem, FormInitialConditions previousForm) { this.canonicalProblem = canonicalProblem; this.previousForm = previousForm; defaultSolution = new Vector(canonicalProblem.VariableNumber); InitializeComponent(); }
public ResultForm(LinearProgrammingProblem problem, FormInitialConditions formWithProblem) { this.problem = problem; this.formWithProblem = formWithProblem; givenProblem = formWithProblem.Problem; InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { try { VariableNumber = Convert.ToInt32(textBox1.Text); } catch (FormatException) { MessageBox.Show("Введенное значение для количества переменных не является натуральным числом!"); textBox1.Text = ""; return; } catch (OverflowException) { MessageBox.Show("Введенное значение, к сожалению, слишком велико!"); textBox1.Text = ""; return; } catch (Exception) { MessageBox.Show("Неизвестная ошибка!"); textBox1.Text = ""; return; } if (VariableNumber <= 0) { MessageBox.Show("Введенное значение для количества переменных не является натуральным числом!"); textBox1.Text = ""; return; } try { LimitationNumber = Convert.ToInt32(textBox2.Text); } catch (FormatException) { MessageBox.Show("Введенное значение для количества ограничений не является натуральным числом!"); textBox2.Text = ""; return; } catch (OverflowException) { MessageBox.Show("Введенное значение, к сожалению, слишком велико!"); textBox2.Text = ""; return; } catch (Exception) { MessageBox.Show("Неизвестная ошибка!"); textBox2.Text = ""; return; } if (!radioButton1.Checked && !radioButton2.Checked && !radioButton3.Checked) { MessageBox.Show("Выберите один из методов!"); return; } if (LimitationNumber <= 0) { MessageBox.Show("Введенное значение для количества ограничений не является натуральным числом!"); textBox2.Text = ""; return; } else if (radioButton1.Checked) { MethodNumber = 0; } else if (radioButton2.Checked) { MethodNumber = 1; } else { MethodNumber = 2; } PrintAlgorithms = checkBox1.Checked; Hide(); FormInitialConditions initForm = new FormInitialConditions(VariableNumber, LimitationNumber, MethodNumber, PrintAlgorithms, this); initForm.Show(); }