Ejemplo n.º 1
0
        public void FindPivot()
        {
            var      t = new Tableau(new [] { _y1, _y2, _y3, _z });
            Variable head;
            Variable row;

            Assert.IsTrue(t.FindPivot(out head, out row));
        }
Ejemplo n.º 2
0
        public void NextTableau()
        {
            Variable head;
            Variable row;

            var t1 = new Tableau(new[] { _y1, _y2, _y3, _z });

            t1.FindPivot(out head, out row);
            var t2 = Solver.NextTableau(t1, head, row);

            Assert.AreEqual(4000, t2.TargetEquation.Coefficient);
            t2.FindPivot(out head, out row);
            var t3 = Solver.NextTableau(t2, head, row);

            Assert.AreEqual(4960, t3.TargetEquation.Coefficient);
            t3.FindPivot(out head, out row);
            var t4 = Solver.NextTableau(t3, head, row);

            Assert.AreEqual(5400, t4.TargetEquation.Coefficient);
            Assert.IsFalse(t4.FindPivot(out head, out row));
        }