/* Returns true if all the points of b are solutions of c */ int rp_ctr_numinf_inner(rp_ctr_num c, rp_box b) { int res; if (!(rp_expression_eval(rp_ctr_num_left(c),b))|| !(rp_expression_eval(rp_ctr_num_right(c),b))) { /* at least one expression has an empty range over b */ res = 0; } else { /* inner if left is smaller than right */ res = (rp_bsup(rp_expression_val(rp_ctr_num_left(c))) <= rp_binf(rp_expression_val(rp_ctr_num_right(c)))); } return( res ); }
/* Returns true if no point of b is solution of c */ int rp_ctr_numinf_unfeasible(rp_ctr_num c, rp_box b) { int res; if ((!rp_expression_eval(rp_ctr_num_left(c),b)) || (!rp_expression_eval(rp_ctr_num_right(c),b))) { /* at least one expression has an empty range over b */ res = 1; } else { /* unfeasible if left is entirely greater than right */ res = (rp_binf(rp_expression_val(rp_ctr_num_left(c))) > rp_bsup(rp_expression_val(rp_ctr_num_right(c)))); } return( res ); }
/* Returns true if all the points of b are solutions of c */ int rp_ctr_numeq_inner(rp_ctr_num c, rp_box b) { int res; if ((!rp_expression_eval(rp_ctr_num_left(c),b))|| (!rp_expression_eval(rp_ctr_num_right(c),b))) { /* at least one expression has an empty range over b */ res = 0; } else { /* inner if the value of both expressions is a number */ res = (rp_interval_point(rp_expression_val(rp_ctr_num_left(c))) && rp_interval_equal(rp_expression_val(rp_ctr_num_left(c)), rp_expression_val(rp_ctr_num_right(c)))); } return( res ); }
/* Returns true if no point of b is solution of c */ int rp_ctr_numeq_unfeasible(rp_ctr_num c, rp_box b) { int res; if ((!rp_expression_eval(rp_ctr_num_left(c),b)) || (!rp_expression_eval(rp_ctr_num_right(c),b))) { /* at least one expression has an empty range over b */ res = 1; } else { /* unfeasible if empty intersection */ rp_interval i; rp_interval_inter(i,rp_expression_val(rp_ctr_num_left(c)), rp_expression_val(rp_ctr_num_right(c))); res = rp_interval_empty(i); } return( res ); }
int rp_operator_newton::compute_negfmid() { for (int i=0; i<_arity; ++i) { if (!rp_expression_eval(_f[i],_midpoint)) { return( 0 ); } else { rp_interval_neg(rp_ivector_elem(_negfmid,i),rp_expression_val(_f[i])); } } return( 1 ); }