Exemple #1
0
        private void SimplexGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            currentSimplexTable = SimplexTables.Count - 1;
            SimplexTable cursmptbl = SimplexTables[currentSimplexTable];

            SimplexTable smptbl = new SimplexTable(cursmptbl.N, cursmptbl.M);

            smptbl.Assign(cursmptbl);

            SimplexTables.Clear();
            SimplexTables.Add(smptbl);

            if (smptbl.FillTable(SimplexGrid))
            {
                IsNewTask = false;

                smptbl.Solved     = false;
                smptbl.Infinity   = false;
                smptbl.Unsolvable = false;

                smptbl.ResetbaseVector();

                CanonicalN = smptbl.N;
                CanonicalM = smptbl.M;

                for (int i = 0; i < CanonicalM; i++)
                {
                    CanonicalSign[i] = 2;
                }

                CanonicalTaskType = TaskTypeComboBox.SelectedIndex;

                smptbl.FillVectorb(CanonicalVectorb);
                smptbl.FillVectorc(CanonicalVectorc);
                smptbl.FillMatrixA(CanonicalMatrixA);

                PrintSolveLog(TaskInfotextBox);

                toolStripStatusLabel.Text = "Итерация: ";
            }
        }
Exemple #2
0
        private void NewSimplexTableToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewTaskForm ntf = new NewTaskForm();

            ntf.Text = NewSimplexTableToolStripMenuItem.Text;
            if (ntf.ShowDialog() == DialogResult.OK)
            {
                IsNewTask = false;

                SimplexTables.Clear();
                SimplexTable smptbl = new SimplexTable(ntf.N, ntf.M);

                CanonicalN = smptbl.N;
                CanonicalM = smptbl.M;

                for (int i = 0; i < CanonicalM; i++)
                {
                    CanonicalSign[i] = 2;
                }

                SourceTaskType    = 0;
                CanonicalTaskType = 0;
                TaskTypeComboBox.SelectedIndex = 0;

                smptbl.FillVectorb(CanonicalVectorb);
                smptbl.FillVectorc(CanonicalVectorc);
                smptbl.FillMatrixA(CanonicalMatrixA);

                SimplexTables.Add(smptbl);
                currentSimplexTable = SimplexTables.Count - 1;
                UpdateSimplexGrid();
                OpenTableMode();

                PrintSolveLog(TaskInfotextBox);
            }
        }