typedef enum ap_coeff_discr_t { AP_COEFF_SCALAR, AP_COEFF_INTERVAL } ap_coeff_discr_t;
Discriminant indicating the underlying type of a coefficient.
typedef struct ap_coeff_t { ap_coeff_discr_t discr; union { ap_scalar_t* scalar; ap_interval_t* interval; } val; } ap_coeff_t;
A coefficient is either a scalar or an interval.
void
ap_coeff_alloc (ap_coeff_discr_t discr)
¶Allocate a coefficient, using discr to specify the type of coefficient (scalar or interval).
void
ap_coeff_free (ap_coeff_t* op)
¶Deallocate a coefficient.
void
ap_coeff_reinit (ap_coeff_t* op, ap_coeff_discr_t discr1, ap_scalar_discr_t discr2)
¶Changing the type of the coefficient and also the type of the underlting scalar(s).
void
ap_coeff_reduce (ap_coeff_t* op)
¶If the coefficient is an interval [a;a], convert it to a scalar. */
void
ap_coeff_init (ap_coeff_t* rop, ap_coeff_discr_t discr)
¶void
ap_coeff_init_set (ap_coeff_t* rop, ap_coeff_t* op)
¶void
ap_coeff_clear (ap_coeff_t* rop)
¶Initialize, initialize and assign, and clear a scalar \‘a la GMP (internal use).
void
ap_coeff_set (ap_coeff_t* rop, ap_coeff_t* op)
¶Set the value of rop from op.
void
ap_coeff_set_scalar (ap_coeff_t* rop, ap_scalar_t* op)
¶void
ap_coeff_set_scalar_mpq (ap_coeff_t* rop, mpq_t mpq)
¶void
ap_coeff_set_scalar_int (ap_coeff_t* rop, long int i)
¶void
ap_coeff_set_scalar_frac (ap_coeff_t* rop, long int i, unsigned long int j)
¶void
ap_coeff_set_scalar_double (ap_coeff_t* rop, double k)
¶Set the type of rop to scalar, and sets its value as the
functions ap_scalar_set_XXX
.
void
ap_coeff_set_interval (ap_coeff_t* rop, ap_interval_t* op)
¶void
ap_coeff_set_interval_scalar (ap_coeff_t* rop, ap_scalar_t* inf, ap_scalar_t* sup)
¶void
ap_coeff_set_interval_mpq (ap_coeff_t* rop, mpq_t inf, mpq_t sup)
¶void
ap_coeff_set_interval_int (ap_coeff_t* rop, int inf, int sup)
¶void
ap_coeff_set_interval_frac (ap_coeff_t* rop, int numinf, int deninf, int numsup, int densup)
¶void
ap_coeff_set_interval_double (ap_coeff_t* rop, double inf, double sup)
¶Set the type of rop to interval, and sets its value as the
functions ap_interval_set_XXX
.
ap_coeff_t*
ap_coeff_alloc_set (ap_coeff_t* op)
¶ap_coeff_t*
ap_coeff_alloc_set_scalar (ap_scalar_t* scalar)
¶ap_coeff_t*
ap_coeff_alloc_set_interval (ap_interval_t* interval)
¶Combined allocation and assignement.
int
ap_coeff_cmp (ap_coeff_t* op1, ap_coeff_t* op2)
¶Non-total comparison.
ap_scalar_cmp
.
ap_interval_cmp
.
bool
ap_coeff_equal (ap_coeff_t* op1, ap_coeff_t* op2)
¶Equality test.
bool
ap_coeff_zero (ap_coeff_t* op)
¶Return true iff coeff is a zero scalar or an interval with zero bounds.
void
ap_coeff_neg (ap_coeff_t* rop, ap_coeff_t* op)
¶Negation.
void
ap_coeff_swap (ap_coeff_t* op1, ap_coeff_t* op2)
¶Exchange the values of op1 and op2.
int
ap_coeff_hash (ap_coeff_t* op)
¶Return an hash code (for instance for OCaml interface).
void
ap_coeff_fprint (FILE* stream, ap_coeff_t* op)
¶Print op on the stream stream.