public void TransponateIfNeeded(OptimisingType type) { if (type == OptimisingType.min) { Transpose(); } }
public void SetObjectiveFunction(string objectiveFunction) { if (objectiveFunction.Contains("min")) { TargetType = OptimisingType.min; } else if (objectiveFunction.Contains("max")) { TargetType = OptimisingType.max; } else { throw new UnkonwTargetType(objectiveFunction); } _ObjectiveFunction = RemoveUnessearryStringGarbage(objectiveFunction); }
public SimplexLineCollection(NewObjectiveFunction newObjectiveFunction, List <NewConstrain> newConstrains, OptimisingType type) { constrains = newConstrains; objectiveFunction = newObjectiveFunction; TransponateIfNeeded(type); foreach (var item in constrains) { item.NumberOfConstrains = (constrains.Count); } int i = 0; foreach (var item in constrains) { item.GenerateSlackVariable(i); i++; } objectiveFunction.GenerateSlackVariable(); }