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; }
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); }
public bool test(Vector p) { return(c1_.test(p) && c2_.test(p)); }