add isl_*_list_from_*
[platform/upstream/isl.git] / doc / user.pod
index 3c3a324..d500627 100644 (file)
@@ -93,6 +93,15 @@ but they will be removed in the future.
 
 =back
 
+=head3 Changes since isl-0.07
+
+=over
+
+=item * The function C<isl_pw_aff_max> has been renamed to
+C<isl_pw_aff_union_max>.
+
+=back
+
 =head1 Installation
 
 The source of C<isl> can be obtained either as a tarball
@@ -419,6 +428,32 @@ a C<NULL> value for an C<__isl_take> argument.
 
 =back
 
+=head2 Identifiers
+
+Identifiers are used to identify both individual dimensions
+and tuples of dimensions.  They consist of a name and an optional
+pointer.  Identifiers with the same name but different pointer values
+are considered to be distinct.
+Identifiers can be constructed, copied, freed, inspected and printed
+using the following functions.
+
+       #include <isl/id.h>
+       __isl_give isl_id *isl_id_alloc(isl_ctx *ctx,
+               __isl_keep const char *name, void *user);
+       __isl_give isl_id *isl_id_copy(isl_id *id);
+       void *isl_id_free(__isl_take isl_id *id);
+
+       isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id);
+       void *isl_id_get_user(__isl_keep isl_id *id);
+       __isl_keep const char *isl_id_get_name(__isl_keep isl_id *id);
+
+       __isl_give isl_printer *isl_printer_print_id(
+               __isl_take isl_printer *p, __isl_keep isl_id *id);
+
+Note that C<isl_id_get_name> returns a pointer to some internal
+data structure, so the result can only be used while the
+corresponding C<isl_id> is alive.
+
 =head2 Dimension Specifications
 
 Whenever a new set or relation is created from scratch,
@@ -496,10 +531,17 @@ specification of the original object.
        __isl_give isl_dim *isl_point_get_dim(
                __isl_keep isl_point *pnt);
 
-The names of the individual dimensions may be set or read off
+The identifiers or names of the individual dimensions may be set or read off
 using the following functions.
 
        #include <isl/dim.h>
+       __isl_give isl_dim *isl_dim_set_dim_id(
+               __isl_take isl_dim *dim,
+               enum isl_dim_type type, unsigned pos,
+               __isl_take isl_id *id);
+       __isl_give isl_id *isl_dim_get_dim_id(
+               __isl_keep isl_dim *dim,
+               enum isl_dim_type type, unsigned pos);
        __isl_give isl_dim *isl_dim_set_name(__isl_take isl_dim *dim,
                                 enum isl_dim_type type, unsigned pos,
                                 __isl_keep const char *name);
@@ -513,15 +555,29 @@ Also note that every function that operates on two sets or relations
 requires that both arguments have the same parameters.  This also
 means that if one of the arguments has named parameters, then the
 other needs to have named parameters too and the names need to match.
-Pairs of C<isl_union_set> and/or C<isl_union_map> arguments may
-have different parameters (as long as they are named), in which case
-the result will have as parameters the union of the parameters of
+Pairs of C<isl_set>, C<isl_map>, C<isl_union_set> and/or C<isl_union_map>
+arguments may have different parameters (as long as they are named),
+in which case the result will have as parameters the union of the parameters of
 the arguments.
 
-The names of entire spaces may be set or read off
+Given the identifier of a dimension (typically a parameter),
+its position can be obtained from the following function.
+
+       #include <isl/dim.h>
+       int isl_dim_find_dim_by_id(__isl_keep isl_dim *dim,
+               enum isl_dim_type type, __isl_keep isl_id *id);
+
+The identifiers or names of entire spaces may be set or read off
 using the following functions.
 
        #include <isl/dim.h>
+       __isl_give isl_dim *isl_dim_set_tuple_id(
+               __isl_take isl_dim *dim,
+               enum isl_dim_type type, __isl_take isl_id *id);
+       __isl_give isl_dim *isl_dim_reset_tuple_id(
+               __isl_take isl_dim *dim, enum isl_dim_type type);
+       __isl_give isl_id *isl_dim_get_tuple_id(
+               __isl_keep isl_dim *dim, enum isl_dim_type type);
        __isl_give isl_dim *isl_dim_set_tuple_name(
                __isl_take isl_dim *dim,
                enum isl_dim_type type, const char *s);
@@ -967,11 +1023,16 @@ using the following functions.
                __isl_take isl_dim *dim);
        __isl_give isl_constraint *isl_inequality_alloc(
                __isl_take isl_dim *dim);
-       void isl_constraint_set_constant(
-               __isl_keep isl_constraint *constraint, isl_int v);
-       void isl_constraint_set_coefficient(
-               __isl_keep isl_constraint *constraint,
+       __isl_give isl_constraint *isl_constraint_set_constant(
+               __isl_take isl_constraint *constraint, isl_int v);
+       __isl_give isl_constraint *isl_constraint_set_constant_si(
+               __isl_take isl_constraint *constraint, int v);
+       __isl_give isl_constraint *isl_constraint_set_coefficient(
+               __isl_take isl_constraint *constraint,
                enum isl_dim_type type, int pos, isl_int v);
+       __isl_give isl_constraint *isl_constraint_set_coefficient_si(
+               __isl_take isl_constraint *constraint,
+               enum isl_dim_type type, int pos, int v);
        __isl_give isl_basic_map *isl_basic_map_add_constraint(
                __isl_take isl_basic_map *bmap,
                __isl_take isl_constraint *constraint);
@@ -1258,8 +1319,20 @@ constraints.  Instead the following functions can be used.
        int isl_map_involves_dims(__isl_keep isl_map *map,
                enum isl_dim_type type, unsigned first, unsigned n);
 
-The names of the domain and range spaces of a set or relation can be
-read off or set using the following functions.
+The identifiers or names of the domain and range spaces of a set
+or relation can be read off or set using the following functions.
+
+       __isl_give isl_set *isl_set_set_tuple_id(
+               __isl_take isl_set *set, __isl_take isl_id *id);
+       __isl_give isl_id *isl_set_get_tuple_id(
+               __isl_keep isl_set *set);
+       __isl_give isl_map *isl_map_set_tuple_id(
+               __isl_take isl_map *map, enum isl_dim_type type,
+               __isl_take isl_id *id);
+       __isl_give isl_map *isl_map_reset_tuple_id(
+               __isl_take isl_map *map, enum isl_dim_type type);
+       __isl_give isl_id *isl_map_get_tuple_id(
+               __isl_keep isl_map *map, enum isl_dim_type type);
 
        const char *isl_basic_set_get_tuple_name(
                __isl_keep isl_basic_set *bset);
@@ -1276,8 +1349,26 @@ read off or set using the following functions.
 
 As with C<isl_dim_get_tuple_name>, the value returned points to
 an internal data structure.
-The names of individual dimensions can be read off using
-the following functions.
+The identifiers, positions or names of individual dimensions can be
+read off using the following functions.
+
+       __isl_give isl_set *isl_set_set_dim_id(
+               __isl_take isl_set *set, enum isl_dim_type type,
+               unsigned pos, __isl_take isl_id *id);
+       __isl_give isl_id *isl_set_get_dim_id(
+               __isl_keep isl_set *set, enum isl_dim_type type,
+               unsigned pos);
+       __isl_give isl_map *isl_map_set_dim_id(
+               __isl_take isl_map *map, enum isl_dim_type type,
+               unsigned pos, __isl_take isl_id *id);
+       __isl_give isl_id *isl_map_get_dim_id(
+               __isl_keep isl_map *map, enum isl_dim_type type,
+               unsigned pos);
+
+       int isl_set_find_dim_by_id(__isl_keep isl_set *set,
+               enum isl_dim_type type, __isl_keep isl_id *id);
+       int isl_map_find_dim_by_id(__isl_keep isl_map *map,
+               enum isl_dim_type type, __isl_keep isl_id *id);
 
        const char *isl_constraint_get_dim_name(
                __isl_keep isl_constraint *constraint,
@@ -1295,8 +1386,8 @@ the following functions.
                __isl_keep isl_map *map,
                enum isl_dim_type type, unsigned pos);
 
-These functions are mostly useful to obtain the names
-of the parameters.
+These functions are mostly useful to obtain the identifiers, positions
+or names of the parameters.
 
 =head2 Properties
 
@@ -2170,6 +2261,8 @@ Here we take lists of C<isl_set>s as an example.
 Lists can be created, copied and freed using the following functions.
 
        #include <isl/list.h>
+       __isl_give isl_set_list *isl_set_list_from_set(
+               __isl_take struct isl_set *el);
        __isl_give isl_set_list *isl_set_list_alloc(
                isl_ctx *ctx, int n);
        __isl_give isl_set_list *isl_set_list_copy(
@@ -2177,10 +2270,11 @@ Lists can be created, copied and freed using the following functions.
        __isl_give isl_set_list *isl_set_list_add(
                __isl_take isl_set_list *list,
                __isl_take isl_set *el);
-       void isl_set_list_free(__isl_take isl_set_list *list);
+       void *isl_set_list_free(__isl_take isl_set_list *list);
 
 C<isl_set_list_alloc> creates an empty list with a capacity for
-C<n> elements.
+C<n> elements.  C<isl_set_list_from_set> creates a list with a single
+element.
 
 Lists can be inspected using the following functions.
 
@@ -2260,6 +2354,8 @@ be created using the following functions.
                __isl_take isl_dim *dim);
        __isl_give isl_pw_aff *isl_pw_aff_alloc(
                __isl_take isl_set *set, __isl_take isl_aff *aff);
+       __isl_give isl_pw_aff *isl_pw_aff_from_aff(
+               __isl_take isl_aff *aff);
 
 Quasi affine expressions can be copied and freed using
 
@@ -2315,6 +2411,9 @@ The expression can be inspected using
        __isl_give isl_div *isl_aff_get_div(
                __isl_keep isl_aff *aff, int pos);
 
+       int isl_aff_is_cst(__isl_keep isl_aff *aff);
+       int isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff);
+
        int isl_aff_involves_dims(__isl_keep isl_aff *aff,
                enum isl_dim_type type, unsigned first, unsigned n);
        int isl_pw_aff_involves_dims(__isl_keep isl_pw_aff *pwaff,
@@ -2328,6 +2427,9 @@ The expression can be inspected using
 It can be modified using
 
        #include <isl/aff.h>
+       __isl_give isl_pw_aff *isl_pw_aff_set_tuple_id(
+               __isl_take isl_pw_aff *pwaff,
+               __isl_take isl_id *id);
        __isl_give isl_aff *isl_aff_set_dim_name(
                __isl_take isl_aff *aff, enum isl_dim_type type,
                unsigned pos, const char *s);
@@ -2395,6 +2497,12 @@ Operations include
        __isl_give isl_pw_aff *isl_pw_aff_add(
                __isl_take isl_pw_aff *pwaff1,
                __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_pw_aff *isl_pw_aff_min(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_pw_aff *isl_pw_aff_max(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
        __isl_give isl_aff *isl_aff_sub(__isl_take isl_aff *aff1,
                __isl_take isl_aff *aff2);
        __isl_give isl_pw_aff *isl_pw_aff_sub(
@@ -2436,11 +2544,24 @@ Operations include
        __isl_give isl_set *isl_pw_aff_domain(
                __isl_take isl_pw_aff *pwaff);
 
+       __isl_give isl_aff *isl_aff_mul(__isl_take isl_aff *aff1,
+               __isl_take isl_aff *aff2);
+       __isl_give isl_pw_aff *isl_pw_aff_mul(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+
+When multiplying two affine expressions, at least one of the two needs
+to be a constant.
+
+       #include <isl/aff.h>
        __isl_give isl_basic_set *isl_aff_ge_basic_set(
                __isl_take isl_aff *aff1, __isl_take isl_aff *aff2);
        __isl_give isl_set *isl_pw_aff_eq_set(
                __isl_take isl_pw_aff *pwaff1,
                __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_set *isl_pw_aff_ne_set(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
        __isl_give isl_set *isl_pw_aff_le_set(
                __isl_take isl_pw_aff *pwaff1,
                __isl_take isl_pw_aff *pwaff2);
@@ -2464,6 +2585,10 @@ of C<pwaff1> and C<pwaff2> where C<pwaff1> is greater than or equal to C<pwaff2>
        #include <isl/aff.h>
        __isl_give isl_set *isl_pw_aff_nonneg_set(
                __isl_take isl_pw_aff *pwaff);
+       __isl_give isl_set *isl_pw_aff_zero_set(
+               __isl_take isl_pw_aff *pwaff);
+       __isl_give isl_set *isl_pw_aff_non_zero_set(
+               __isl_take isl_pw_aff *pwaff);
 
 The function C<isl_pw_aff_nonneg_set> returns a set
 containing those elements in the domain
@@ -2481,11 +2606,11 @@ for elements in C<cond> and equal to C<pwaff_false> for elements
 not in C<cond>.
 
        #include <isl/aff.h>
-       __isl_give isl_pw_aff *isl_pw_aff_max(
+       __isl_give isl_pw_aff *isl_pw_aff_union_max(
                __isl_take isl_pw_aff *pwaff1,
                __isl_take isl_pw_aff *pwaff2);
 
-The function C<isl_pw_aff_max> computes a piecewise quasi-affine
+The function C<isl_pw_aff_union_max> computes a piecewise quasi-affine
 expression with a domain that is the union of those of C<pwaff1> and
 C<pwaff2> and such that on each cell, the quasi-affine expression is
 the maximum of those of C<pwaff1> and C<pwaff2>.  If only one of