Next: , Previous: , Up: Level 0 of the interface  

Generators of level 0 (ap_generator0.h)

Datatypes and functions are almost isomorphic to datatypes and functions for linear constraints.

datatype: ap_gentyp_t
typedef enum ap_gentyp_t {
  AP_GEN_LINE,
  AP_GEN_RAY,
  AP_GEN_VERTEX,
  AP_GEN_LINEMOD,
  AP_GEN_RAYMOD
} ap_gentyp_t;

Datatype for type of generators.

datatype: ap_generator0_t
typedef struct ap_generator0_t {
  ap_linexpr0_t* linexpr0; /* underlying expression.  */
  ap_gentyp_t gentyp;      /* type of generator */
} ap_generator0_t;

Datatype for generators.

The constant of the expression is ignored, and the expression is assumed to be truly linear (without intervals).

datatype: ap_generator0_array_t
typedef struct ap_generator0_array_t {
  ap_generator0_t* p;
  size_t size;
} ap_generator0_array_t;

Datatype for arrays of generators.


Next: , Previous: , Up: Generators of level 0  

Allocating generators of level 0

Function: ap_generator0_t ap_generator0_make (ap_gentyp_t gentyp, ap_linexpr0_t* linexpr)

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.

Function: ap_generator0_t ap_generator0_copy (gent ap_generator0_t* gen)

Duplication

Function: void ap_generator0_clear (ap_generator0_t* gen)

Clear the generator.

Function: void ap_generator0_fprint (FILE* stream, gent ap_generator0_t* gen, char** name_of_dim);

Print the linear generator on stream stream, using the array name_of_dim to convert dimensions to variable names. If name_of_dim is NULL, the dimensions are named x0,x1,....


Next: , Previous: , Up: Generators of level 0  

Arrays of generators of level 0

Arrays are accessed directly, for example by writing array->p[i] (of type ap_generator0_t), array->p[i].gentyp and array->p[i].linexpr0.

One can assign a generator to the index index by writing: array->p[index] = ap_generator0_make(gentyp,expr).

Function: ap_generator0_array_t ap_generator0_array_make (size_t size)

Allocate an array of size generators. The generators are initialized with NULL pointers for underlying expressions.

Function: void ap_generator0_array_clear (ap_generator0_array_t* array)

Clear the generators of the array, and then the array itself.

Function: void ap_generator0_array_fprint (FILE* stream, gent ap_generator0_array_t* array, char** name_of_dim)

Print the array on the stream.


Previous: , Up: Generators of level 0  

Change of dimensions and permutations of generators of level 0

Function: void ap_generator0_add_dimensions_with (ap_generator0_t* gen, gent ap_dimchange_t* dimchange)
Function: ap_generator0_t ap_generator0_add_dimensions (gent ap_generator0_t* gen, gent ap_dimchange_t* dimchange)

These two functions add dimensions to the generator, following the semantics of dimchange (see the type definition of ap_dimchange_t).

Function: void ap_generator0_permute_dimensions_with (ap_generator0_t* gen, gent ap_dimperm_t* perm)
Function: ap_generator0_t ap_generator0_permute_dimensions (gent ap_generator0_t* gen, gent ap_dimperm_t* perm)

These two functions apply the given permutation to the dimensions of gen.

Function: void ap_generator0_array_add_dimensions_with (ap_generator0_array_t* gen, gent ap_dimchange_t* dimchange)
Function: ap_generator0_array_t ap_generator0_array_add_dimensions (gent ap_generator0_array_t* gen, gent ap_dimchange_t* dimchange)
Function: void ap_generator0_array_permute_dimensions_with (ap_generator0_array_t* gen, gent ap_dimperm_t* perm)
Function: ap_generator0_array_t ap_generator0_array_permute_dimensions (gent ap_generator0_array_t* gen, gent ap_dimperm_t* perm)

Extension to arrays of the corresponding functions on generators.


Previous: , Up: Generators of level 0