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

Dimensions and related operations (ap_dimension.h)

datatype: ap_dim_t
typedef unsigned int ap_dim_t;

Datatype for dimensions.

Macro: AP_DIM_MAX

Special value used for sparse representations, means: "to be ignored". Also used as a result when an error occurs.

datatype: ap_dimension_t
typedef struct ap_dimension_t {
  size_t intdim;  /* Number of integer dimensions */
  size_t realdim; /* Number of real dimensions */
} ap_dimension_t;

Datatype for specifying the dimensionality of an abstract value.

datatype: ap_dimchange_t
typedef struct ap_dimchange_t {
  ap_dim_t* dim;  /* Assumed to be an array of size intdim+realdim */
  size_t intdim ; /* Number of integer dimensions to add/remove */
  size_t realdim; /* Number of real dimensions to add/remove */
} ap_dimchange_t;

Datatype for specifying change of dimension.

The semantics is the following:

Addition of dimensions

dimchange.dim[k] means: add one dimension at dimension k and shift the already existing dimensions greater than or equal to k one step on the right (or increment them).

if k is equal to the size of the vector, then it means: add a dimension at the end.

Repetion are allowed, and means that one inserts more than one dimensions.

Example: linexpr0_add_dimensions([i0 i1 r0 r1], { [0 1 2 2 4],3,1 }) returns [0 i0 0 i1 0 0 r0 r1 0], considered as a vector with 5 integer dimensions and 4 real dimensions.

Removal of dimensions

dimchange.dim[k]: remove the dimension k and shift the dimensions greater than k one step on the left (or decrement them).

Repetitions are meaningless (and are not correct specification).

Example: linexpr0_remove_dimensions([i0 i1 i2 r0 r1 r2], { [0 2 4],2,1 }) returns [i1 r0 r2], considered as a vector with 1 integer dimensions and 2 real dimensions.

datatype: ap_dimchange2_t
typedef struct ap_dimchange_2t {
  ap_dimchange_t* add;    /* If not NULL, specifies the adding new dimensions */
  ap_dimchange_t* remove; /* If not NULL, specifies the removal of dimensions */
} ap_dimchange2_t;

Datatype for specifying a transformation composed of the addition and the removal of dimensions. Used by functions ap_abstract0_apply_dimchange2, ap_environment_dimchange2, and ap_abstract1_change_environment..

datatype: ap_dimperm_t
typedef struct ap_dimperm_t {
  ap_dim_t* dim; /* Array assumed to be of size size */
  size_t size;
} ap_dimperm_t;

Datatype for permutations.

Represents the permutation i -> dimperm.p[i] for 0<=i<dimperm.size.


Next: , Previous: , Up: Dimensions and related operations  

Manipulating changes of dimensions

Function: void ap_dimchange_init (ap_dimchange_t* dimchange, size_t intdim, size_t realdim)
Function: void ap_dimchange_clear (ap_dimchange_t* dimchange)

Initialize and clear a dimchange structure.

Function: ap_dimchange_t* ap_dimchange_alloc (size_t intdim, size_t realdim)
Function: void ap_dimchange_free (ap_dimchange_t* dimchange)

Allocate and free a dimchange structure.

Function: void ap_dimchange_fprint (FILE* stream, ap_dimchange_t* dimchange)

Print the change of dimension.

Function: void ap_dimchange_add_invert (ap_dimchange_t* dimchange)

Assuming that dimchange is a transformation for the addition of dimensions, invert it to obtain the inverse transformation for removing dimensions.

Function: void ap_dimchange2_init (ap_dimchange2_t* dimchange2, ap_dimchange_t* add, ap_dimchange_t* remove)
Function: void ap_dimchange2_clear (ap_dimchange2_t* dimchange2)

Initialize (with add and remove) and clear a dimchange2 structure.

Function: ap_dimchange2_t* ap_dimchange2_alloc (ap_dimchange_t* add, ap_dimchange_t* remove)
Function: void ap_dimchange2_free (ap_dimchange2_t* dimchange2)

Allocate and free a dimchange2 structure.

Function: void ap_dimchange2_fprint (FILE* stream, ap_dimchange2_t* dimchange2)

Print the change of dimension.


Previous: , Up: Dimensions and related operations  

Manipulating permutations of dimensions

Function: void ap_dimperm_init (ap_dimperm_t* perm, size_t size)
Function: void ap_dimperm_clear (ap_dimperm_t* perm)

Initialize and clear a dimperm structure.

Function: ap_dimperm_t* ap_dimperm_alloc (size_t size)
Function: void ap_dimperm_free (ap_dimperm_t* perm)

Allocate and free a dimperm structure.

Function: void ap_dimperm_fprint (FILE* stream, ap_dimperm_t* perm)

Print the permutation.

Function: void ap_dimperm_set_id (ap_dimperm_t* perm)

Fill the already allocated perm with the identity permutation.

Function: void ap_dimperm_compose (ap_dimperm_t* perm, ap_dimperm_t* perm1, ap_dimperm_t* perm2)

Compose the 2 permutations perm1 and perm2 (in this order) and store the result the already allocated perm. The sizes of permutations are supposed to be equal. At exit, we have perm.dim[i] = perm2.dim[perm1.dim[i]].

Function: void ap_dimperm_invert (ap_dimperm_t* nperm, ap_dimperm_t* perm)

Invert the permutation perm and store it in the already allocated nperm. The sizes of permutations are supposed to be equal.


Previous: , Up: Dimensions and related operations