Next: Tree expressions of level 1, Previous: Linear constraints of level 1, Up: Level 1 of the interface
Datatype for generators.
For information:
typedef struct ap_generator1_t { ap_generator0_t generator0; ap_environment_t* env; } ap_generator1_t;
Generators are meant to be manipulated freely via their components. Creating the ray generator x+2/3y
and then freeing it can be done with
ap_generator1_t gen = ap_generator1_make(AP_GEN_RAY, ap_linexpr1_alloc(env,AP_LINEXPR_SPARSE,2)); ap_generator1_set_list(&gen, AP_COEFF_S_INT, 1, "x", AP_COEFF_S_FRAC, 2,3, "y", AP_END); ap_generator1_clear(&gen);
typedef struct ap_generator1_array_t { ap_generator0_array_t generator0_array; ap_environment_t* env; } ap_generator1_array_t;
Datatype for arrays of generators.
Arrays at level 1 cannot be accessed directly, for example by writing
array->p[i]
, but should instead be accessed with functions
ap_generator1_array_get
and ap_generator1_array_set
.
• Allocating generators of level 1 | ||
• Access to generators of level 1 | ||
• Change of dimensions and permutations of generators of level 1 | ||
• Arrays of generators of level 1 |
Next: Access to generators of level 1, Previous: Generators of level 1, Up: Generators of level 1
Create a generator of type gentyp with the expression linexpr.
The expression is not duplicated, just pointed to, so it becomes managed via the generator.
Duplication
Clear the generator and set pointers to NULL.
Print the linear generator on stream stream.
Next: Change of dimensions and permutations of generators of level 1, Previous: Allocating generators of level 1, Up: Generators of level 1
Get a reference to the environment. Do not free it.
Get a reference to the type of generator. You may use the reference to modify the generator type.
Get a reference to the underlying expression of the generator. Do not free it: nothing is duplicated. Modifying the argument or the result is equivalent, except for change of dimensions/environment.
Identical to corresponding ap_linexpr1_XXX
functions
(see Access to linear expressions of level 1).
Return underlying generator of level 0. Do not free it: nothing is duplicated. Modifying the argument or the result is equivalent, except for change of dimensions/envionment.
Next: Arrays of generators of level 1, Previous: Access to generators of level 1, Up: Generators of level 1
Identical to corresponding ap_linexpr1_XXX
functions
(see Change of dimensions and permutations of linear expressions of level 1).
Allocate an array of generators of size size, defined on the environment env.
The generators are initialized with NULL pointers for underlying expressions.
Clear the generators of the array, and then the array itself.
Print the array on the stream.
Return the size of the array.
Get a reference to the environment. Do not free it.
Return the linear generator of the given index Nothing is duplicated, and the result should never be cleared. Modifying the argument or the result is equivalent, except for change of environments
Fill the index of the array with the generator. Assumes
array->env==gen->env
. Nothing is duplicated. The argument should
never be cleared. (its environment is dereferenced). If a generator
was already stored, it is first cleared. Return true iff problem
(index or array->env!=gen->env
)
Clear the generator at index index.
Identical to corresponding ap_linexpr1_XXX
functions (see Change of dimensions and permutations of linear expressions of level 1).