Next: , Previous: , Up: Scalars & Intervals & Coefficients  

Intervals (ap_interval.h)

datatype: ap_interval_t
typedef struct ap_interval_t {
  ap_scalar_t* inf;
  ap_scalar_t* sup;
} ap_interval_t;

Intervals on scalars.


Next: , Previous: , Up: Intervals  

Initializing intervals

Function: void ap_interval_alloc ()

Allocate an interval (with scalars of default type DOUBLE, the most economical).

Function: void ap_interval_free (ap_interval_t* op)

Deallocate an interval.

Function: 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).


Next: , Previous: , Up: Intervals  

Assigning intervals

Function: void ap_interval_set (ap_interval_t* rop, ap_interval_t* op)

Set the value of rop from op.

Function: 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].

Function: void ap_interval_set_mpq (ap_interval_t* rop, mpq_t inf, mpq_t sup)
Function: void ap_interval_set_int (ap_interval_t* rop, int inf, int sup)
Function: 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.

Function: 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.

Function: void ap_interval_set_top (ap_interval_t* op)
Function: 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].

Function: ap_interval_t* ap_interval_alloc_set (ap_interval_t* op)

Combined allocation and assignement.


Next: , Previous: , Up: Intervals  

Comparing intervals

Function: bool ap_interval_is_top (ap_interval_t* op)
Function: 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.

Function: 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.

Function: bool ap_interval_equal (ap_interval_t* op1, ap_interval_t* op2)

Equality test.

Return true if the interval op1 is included in op2.

Function: 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

Next: , Previous: , Up: Intervals  

Other operations on intervals

Function: void ap_interval_neg (ap_interval_t* rop, ap_interval_t* op)

Negation.

Function: void ap_interval_swap (ap_interval_t* op1, ap_interval_t* op2)

Exchange the values of op1 and op2.

Function: int ap_interval_hash (ap_interval_t* op)

Return an hash code (for instance for OCaml interface).

Function: void ap_interval_fprint (FILE* stream, ap_interval_t* op)

Print op on the stream stream.


Previous: , Up: Intervals  

Array of intervals

Function: ap_interval_t** ap_interval_array_alloc (size_t size)

Allocate an array of intervals, initialized with [0,0] values.

Function: void ap_interval_array_free (ap_interval_t** array, size_t size)

Clearing and deallocating an array of intervals.


Previous: , Up: Intervals