Exemple #1
0
        public void DetectPivotConstrain(int pivotColumnIndex)
        {
            double temp = 0;

            foreach (var item in constrains)
            {
                var value = item.DivideRightSideValueByPivotCloumnIndexValue(pivotColumnIndex);
                if (value < temp || temp == 0)
                {
                    temp           = value;
                    PivotConstrain = item;
                }
            }
        }
Exemple #2
0
        public void ReduceToZero(NewConstrain pivotConstrain, int pivotIndex)
        {
            var multiplier = leftSideArray[pivotIndex];

            int i = 0;

            foreach (var item in leftSideArray)
            {
                leftSideArray[i] = leftSideArray[i] - (pivotConstrain.leftSideArray[i] * multiplier);
                i++;
            }
            i = 0;
            foreach (var item in SlackVarialbes)
            {
                SlackVarialbes[i] = SlackVarialbes[i] - (pivotConstrain.SlackVarialbes[i] * multiplier);
                i++;
            }
            RightSideValue = RightSideValue - (pivotConstrain.RightSideValue * multiplier);
        }