Exemple #1
0
        public abstract double value(Problem P, ref EndCriteria.Type ecType, EndCriteria NamelessParameter3, double t_ini); // initial value of line-search step
        public double update(ref Vector data, Vector direction, double beta, Constraint constraint) {

            double diff = beta;
            Vector newParams = data + diff * direction;
            bool valid = constraint.test(newParams);
            int icount = 0;
            while (!valid) {
                if (icount > 200)
                    throw new ApplicationException("can't update linesearch");
                diff *= 0.5;
                icount++;
                newParams = data + diff * direction;
                valid = constraint.test(newParams);
            }
            data += diff * direction;
            return diff;
        }
Exemple #2
0
        public abstract double value(Problem P, ref EndCriteria.Type ecType, EndCriteria NamelessParameter3, double t_ini); // initial value of line-search step

        public double update(ref Vector data, Vector direction, double beta, Constraint constraint)
        {
            double diff      = beta;
            Vector newParams = data + diff * direction;
            bool   valid     = constraint.test(newParams);
            int    icount    = 0;

            while (!valid)
            {
                if (icount > 200)
                {
                    throw new ApplicationException("can't update linesearch");
                }
                diff *= 0.5;
                icount++;
                newParams = data + diff * direction;
                valid     = constraint.test(newParams);
            }
            data += diff * direction;
            return(diff);
        }
Exemple #3
0
 public bool test(Vector p)
 {
     return(c1_.test(p) && c2_.test(p));
 }