[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Environments bind variables (of level 1) to dimensions (of level 0).
For information, the definition is:
typedef struct ap_environment_t { ap_var_t* var_of_dim; /* Array of size intdim+realdim, indexed by dimensions. - It should not contain identical strings.. - Slice [0..intdim-1] is lexicographically sorted, and denotes integer variables. - Slice [intdim..intdim+realdim-1] is lexicographically sorted, and denotes real variables. - The memory allocated for the variables are attached to the structure (they are freed when the structure is no longer in use) */ size_t intdim; /* Number of integer variables */ size_t realdim;/* Number of real variables */ size_t count; /* For reference counting */ } ap_environment_t; |
(copy
is cheap, as environments are managed with reference
counters).
environment: dim = (..,..), count = .. 0: name0 1: name1 ... |
var_of_intdim is an array of variables of size intdim,
var_of_realdim is an array of variables of size
realdim. Pointers to arrays may be NULL
if their size is
0.
Variables are duplicated in the result, so it is the responsability of the user to free the variables he provides.
If some variables are duplicated, return NULL
.
ap_environment_alloc
function apply. If the result is
non-sense (or in case of attempt to remove an unknwon variable),
return NULL
.
AP_DIM_MAX
.
The remaining functions are much less useful for normal user.
-2
-1
0
+1
+2
ap_environment_is_eq(env1,env2)==false
*dimchange1==NULL
. Otherwise, the function allocates the
*dimchange1
with ap_dimchange_alloc
.
*ptdimchange==NULL
.
Otherwise, compute in *ptdimchange
the conversion permutations
tenv[i]
, this implies that the
result is actually tenv[i]
. In this case,
(*ptdimchange)[i]==NULL
. Otherwise, the function allocates the
(*ptdimchange)[i]
with ap_dimchange_alloc
.
ap_dimperm_t
.
The function applies the variable substitution tvar1[i]->tvar2[i]
to the environment, and returns the resulting environment and the
allocated transformation permutation in *perm
.
If the parameters are not valid, return NULL
with
perm->dim==NULL
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |