public void UpdateMaximizeSegmentColumn(int col) { if (col == -1) { return; } if (rowMaximizeSegment == -1) { rowMaximizeSegment = lp.AddConstraint(true); } lp.SetConstraintElement(rowMaximizeSegment, col, lp.GetConstraintElement(rowMaximizeSegment, col) - 1.0 * columnScale[col]); compactSolution = null; needsDual = true; }
/*public void UpdateMaximizeSegmentColumn(int col) * { * if (col == -1) return; * if (rowMaximizeSegment == -1) rowMaximizeSegment = lp.AddConstraint(); * lp.SetConstraintElement(rowMaximizeSegment, col, lp.GetConstraintElement(rowMaximizeSegment, col) - 1.0 * columnScale[col]); * compactSolution = null; * needsDual = true; * } * * public void UpdateMaximizeSegmentDuration(double value) * { * if (rowMaximizeSegment == -1) rowMaximizeSegment = lp.AddConstraint(); * lp.SetConstraintRHS(rowMaximizeSegment, lp.GetConstraintRHS(rowMaximizeSegment) - value); * compactSolution = null; * needsDual = true; * } * * public bool HasColdsnapConstraints * { * get * { * return rowColdsnap != -1; * } * }*/ public int AddConstraint() { bool newConstraint; return(lp.AddConstraint(null, out newConstraint)); }