예제 #1
0
        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;
        }
예제 #2
0
        private BoxConstraint Add(UpperBound bound)
        {
            UpperBound newUpperBound = this.upperBound.Tighten(bound);

            if (newUpperBound == this.upperBound)
            {
                return this;
            }

            return this.ToBuilder().WithUpperBound(newUpperBound).Build();
        }
예제 #3
0
        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);
        }
예제 #4
0
        private BoxConstraint Add(UpperBound bound)
        {
            UpperBound newUpperBound = this.upperBound.Tighten(bound);

            if (newUpperBound == this.upperBound)
            {
                return(this);
            }

            return(this.ToBuilder().WithUpperBound(newUpperBound).Build());
        }
예제 #5
0
        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;
        }
예제 #6
0
            public Builder WithUpperBound(UpperBound ub)
            {
                this.UpperBound = ub;

                return this;
            }
예제 #7
0
            public Builder WithUpperBound(UpperBound ub)
            {
                this.UpperBound = ub;

                return(this);
            }