[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
typedef enum ap_constyp_t { AP_CONS_EQ, /* equality constraint */ AP_CONS_SUPEQ, /* >= constraint */ AP_CONS_SUP, /* > constraint */ AP_CONS_EQMOD, /* congruence equality constraint */ AP_CONS_DISEQ /* disequality constraint */ } ap_constyp_t; |
typedef struct ap_lincons0_t { ap_linexpr0_t* linexpr0; /* expression */ ap_constyp_t constyp; /* type of constraint */ ap_scalar_t* scalar; /* maybe NULL. For EQMOD constraint, indicates the modulo */ } ap_lincons0_t; |
Constraints are meant to be manipulated freely via their components. Creating the constraint [1,2]x0 + 5/2x1 >=0
and then freeing it can be done with
ap_lincons0_t cons = ap_lincons0_make(AP_CONS_SUPEQ, ap_linexpr0_alloc(AP_LINEXPR_SPARSE,2), NULL); ap_linexpr0_set_list(cons.linexpr0, AP_COEFF_I_INT, 1,2, 0, AP_COEFF_S_FRAC, 5,2, 1, AP_END); ap_lincons0_clear(&cons); |
typedef struct ap_lincons0_array_t { ap_lincons0_t* p; size_t size; } ap_lincons0_array_t; |
Arrays are accessed directly, for example by writing
array->p[i]
(of type ap_lincons0_t
),
array->p[i].constyp
and array->p[i].linexpr0
.
One can assign a constraint to the index index by writing:
array->p[index] = ap_lincons0_make(constyp,expr)
.
Allocating linear constraints of level 0 Tests on linear constraints of level 0 Arrays of linear constraints of level 0 Change of dimensions and permutations of linear constraints of level 0