typedef struct ap_interval_t { ap_scalar_t* inf; ap_scalar_t* sup; } ap_interval_t;
Intervals on scalars.
void
ap_interval_alloc ()
¶Allocate an interval (with scalars of default type DOUBLE, the most economical).
void
ap_interval_free (ap_interval_t* op)
¶Deallocate an interval.
void
ap_interval_reinit (ap_interval_t* op, ap_scalar_discr_t discr)
¶Change the type of the bounds of the interval (mainly for internal use).
void
ap_interval_set (ap_interval_t* rop, ap_interval_t* op)
¶Set the value of rop from op.
void
ap_interval_set_scalar (ap_interval_t* rop, ap_scalar_t* inf, ap_scalar_t* sup)
¶Set the value of rop from the interval [inf,sup].
void
ap_interval_set_mpq (ap_interval_t* rop, mpq_t inf, mpq_t sup)
¶void
ap_interval_set_int (ap_interval_t* rop, int inf, int sup)
¶void
ap_interval_set_frac (ap_interval_t* rop, int numinf, int deninf, int numsup, int densup)
¶Set the value of rop from the interval [inf,sup] or [numinf/deninf,numsup/densup]. The scalars are of type MPQ.
void
ap_interval_set_double (ap_interval_t* rop, double inf, double sup)
¶Set the value of rop from the interval [inf,sup]. The scalars are of type DOUBLE.
void
ap_interval_set_top (ap_interval_t* op)
¶void
ap_interval_set_bottom (ap_interval_t* op)
¶Set the value of rop resp. to the top interval [-oo,+oo] or to the empty interval [+1,-1].
ap_interval_t*
ap_interval_alloc_set (ap_interval_t* op)
¶Combined allocation and assignement.
bool
ap_interval_is_top (ap_interval_t* op)
¶bool
ap_interval_is_bottom (ap_interval_t* op)
¶Return true
if the interval is resp. the universe interval
([-oo,+oo]) or an empty interval.
bool
ap_interval_is_leq (ap_interval_t* op1, ap_interval_t* op2)
¶Inclusion test.
Return true if the interval op1 is included in op2.
bool
ap_interval_equal (ap_interval_t* op1, ap_interval_t* op2)
¶Equality test.
Return true if the interval op1 is included in op2.
int
ap_interval_cmp (ap_interval_t* op1, ap_interval_t* op2)
¶Non-total comparison.
0 equality
-1 op1 included in op2
+1 op2 included in op1
-2 op1.inf less than op2.inf
+2 op1.inf greater than op2.inf
void
ap_interval_neg (ap_interval_t* rop, ap_interval_t* op)
¶Negation.
void
ap_interval_swap (ap_interval_t* op1, ap_interval_t* op2)
¶Exchange the values of op1 and op2.
int
ap_interval_hash (ap_interval_t* op)
¶Return an hash code (for instance for OCaml interface).
void
ap_interval_fprint (FILE* stream, ap_interval_t* op)
¶Print op on the stream stream.