Пример #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);
            }