in which case the result will have as parameters the union of the parameters of
the arguments.
-Given the identifier of a dimension (typically a parameter),
+Given the identifier or name of a dimension (typically a parameter),
its position can be obtained from the following function.
#include <isl/space.h>
int isl_space_find_dim_by_id(__isl_keep isl_space *space,
enum isl_dim_type type, __isl_keep isl_id *id);
+ int isl_space_find_dim_by_name(__isl_keep isl_space *space,
+ enum isl_dim_type type, const char *name);
The identifiers or names of entire spaces may be set or read off
using the following functions.
int isl_space_find_dim_by_id(__isl_keep isl_space *dim, enum isl_dim_type type,
__isl_keep isl_id *id);
+int isl_space_find_dim_by_name(__isl_keep isl_space *space,
+ enum isl_dim_type type, const char *name);
__isl_give isl_space *isl_space_set_dim_name(__isl_take isl_space *dim,
enum isl_dim_type type, unsigned pos,
return -1;
}
+int isl_space_find_dim_by_name(__isl_keep isl_space *space,
+ enum isl_dim_type type, const char *name)
+{
+ int i;
+ int offset;
+ int n;
+
+ if (!space || !name)
+ return -1;
+
+ offset = isl_space_offset(space, type);
+ n = isl_space_dim(space, type);
+ for (i = 0; i < n && offset + i < space->n_id; ++i)
+ if (space->ids[offset + i]->name &&
+ !strcmp(space->ids[offset + i]->name, name))
+ return i;
+
+ return -1;
+}
+
static __isl_keep isl_id *tuple_id(__isl_keep isl_space *dim,
enum isl_dim_type type)
{