Ejemplo n.º 1
0
        public LPForm()
        {
            InitializeComponent();
              var lt1 = new Equation(new Digit[] { new Digit(1), new Digit(-1) }, new Digit(-1));
              //var lt2 = new Equation(new Digit[] { new Digit(-2, 3), new Digit(-1) }, new Digit(7, 2));
              var lt2 = new Equation(new Digit[] { new Digit(-4), new Digit(-6) }, new Digit(21));
              var mainEqua = new Equation(new Digit[] { new Digit(1), new Digit(10) });

              Task task = new Task(Task.TaskType.Max, new Limit[] {
            new Limit(Limit.LimitType.Equal, lt1), new Limit(Limit.LimitType.More, lt2),
              }, mainEqua);
              ss = new SimplexSolver(task);
        }
Ejemplo n.º 2
0
        public void fillDgvSolver(Solver solver)
        {
            dgvSolver.Rows.Clear();
              dgvSolver.Columns.Clear();
              var numClmns = solver.SizeY() + 1;
              for (int i = 0; i < numClmns; i++) dgvSolver.Columns.Add("", "");

              for (int i = 0; i < solver.SizeX(); i++) {
            String[] strings = new String[numClmns];
            for (int j = 0; j < solver.SizeY(); j++) {
              strings[j] = solver.Table(i, j).GetDouble().ToString();
            }
            dgvSolver.Rows.Add(strings);
              }
        }