Esempio n. 1
0
        public ActionResult SecondLab(int? n, int? m)
        {
            if (!m.HasValue || !n.HasValue)
            {
                n = m = 3;
            }
            SecondLabViewModel secondLabViewModel = new SecondLabViewModel
            {
                N = n.Value,
                M = m.Value
            };
            secondLabViewModel.FillRandom();

            return View(secondLabViewModel);
        }
Esempio n. 2
0
        public ActionResult SecondLab(int n, int m, List<double> matrixItems, int[] basis, double[] vectorB, double[] vectorC, double[] vectorX, int[] basisIndexes)
        {
            SecondLabViewModel secondLabViewModel = new SecondLabViewModel
            {
                N = n,
                M = m,
                VectorB = vectorB,
                VectorC = vectorC,
                VectorX = vectorX,
                BasisIndexes = basisIndexes
            };
            secondLabViewModel.FillFromSource(matrixItems);
            secondLabViewModel.SimplexMethodResult = SimplexMethod.Solve(secondLabViewModel.SourceMatrix,
                secondLabViewModel.VectorC, secondLabViewModel.VectorB, secondLabViewModel.VectorX, secondLabViewModel.BasisIndexes);

            return View(secondLabViewModel);
        }