public BoxConstraint(int position, LowerBound lb, UpperBound ub) { if (lb == null || ub == null) { throw new ArgumentNullException("Bounds cannot be null."); } this.lowerBound = lb; this.upperBound = ub; this.position = position; }
private BoxConstraint Add(UpperBound bound) { UpperBound newUpperBound = this.upperBound.Tighten(bound); if (newUpperBound == this.upperBound) { return this; } return this.ToBuilder().WithUpperBound(newUpperBound).Build(); }
private List <BoxConstraint> SetupBoxConstraints(int numVars) { var boxConstraints = new List <BoxConstraint>(); for (int i = 0; i < numVars; i++) { boxConstraints.Add(new BoxConstraint(i, LowerBound.Empty(i), UpperBound.Empty(i))); } return(boxConstraints); }
private BoxConstraint Add(UpperBound bound) { UpperBound newUpperBound = this.upperBound.Tighten(bound); if (newUpperBound == this.upperBound) { return(this); } return(this.ToBuilder().WithUpperBound(newUpperBound).Build()); }
public Builder WithUpperBound(UpperBound ub) { this.UpperBound = ub; return this; }
public Builder WithUpperBound(UpperBound ub) { this.UpperBound = ub; return(this); }