X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=doc%2Fuser.pod;h=1815c17086278060d23ee7515bc73512ce8ebf82;hb=19596bc4e5cd282b2e75d17077b1aaaeacbfd6f9;hp=6410eec312afd6f5cf1e0b28902735a271cb1590;hpb=a9f0521e8990ca7c6bafc89abb0b8bb42d4094dd;p=platform%2Fupstream%2Fisl.git diff --git a/doc/user.pod b/doc/user.pod index 6410eec..1815c17 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -363,8 +363,14 @@ Specific integer values can be created using the following functions. long i); __isl_give isl_val *isl_val_int_from_ui(isl_ctx *ctx, unsigned long u); + __isl_give isl_val *isl_val_int_from_chunks(isl_ctx *ctx, + size_t n, size_t size, const void *chunks); -They can be copied and freed using the following functions. +The function C constructs an C +from the C I, each consisting of C bytes, stored at C. +The least significant digit is assumed to be stored first. + +Value objects can be copied and freed using the following functions. #include __isl_give isl_val *isl_val_copy(__isl_keep isl_val *v); @@ -377,9 +383,20 @@ They can be inspected using the following functions. long isl_val_get_num_si(__isl_keep isl_val *v); long isl_val_get_den_si(__isl_keep isl_val *v); double isl_val_get_d(__isl_keep isl_val *v); - -Note that C, C and -C can only be applied to rational values. + size_t isl_val_n_abs_num_chunks(__isl_keep isl_val *v, + size_t size); + int isl_val_get_abs_num_chunks(__isl_keep isl_val *v, + size_t size, void *chunks); + +C returns the number of I +of C bytes needed to store the absolute value of the +numerator of C. +C stores these digits at C, +which is assumed to have been preallocated by the caller. +The least significant digit is stored first. +Note that C, C, +C, C +and C can only be applied to rational values. An C can be modified using the following function. @@ -520,16 +537,27 @@ C values using the following functions. int isl_val_get_num_gmp(__isl_keep isl_val *v, mpz_t z); int isl_val_get_den_gmp(__isl_keep isl_val *v, mpz_t z); +=head3 Conversion from C + +The following functions are only temporarily available to ease +the transition from C to C. They will be removed +in the next release. + + #include + __isl_give isl_val *isl_val_int_from_isl_int(isl_ctx *ctx, + isl_int n); + int isl_val_get_num_isl_int(__isl_keep isl_val *v, + isl_int *n); + =head2 Integers (obsolescent) -All operations on integers, mainly the coefficients -of the constraints describing the sets and relations, -are performed in exact integer arithmetic using C. -However, to allow future versions of C to optionally -support fixed integer arithmetic, all calls to C -are wrapped inside C specific macros. -The basic type is C and the operations below -are available on this type. +In previous versions of C, integers were represented +in the external interface using the C type. +This type has now been superseded by C. +The C type will be removed from the external interface +in future releases. New code should not use C. + +The operations below are currently available on Cs. The meanings of these operations are essentially the same as their C C counterparts. As always with C types, Cs need to be @@ -2060,6 +2088,36 @@ is already known to be empty. Check if the relation obviously lies on a hyperplane where the given dimension has a fixed value and if so, return that value in C<*val>. + __isl_give isl_val * + isl_basic_map_plain_get_val_if_fixed( + __isl_keep isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos); + __isl_give isl_val *isl_set_plain_get_val_if_fixed( + __isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); + __isl_give isl_val *isl_map_plain_get_val_if_fixed( + __isl_keep isl_map *map, + enum isl_dim_type type, unsigned pos); + +If the set or relation obviously lies on a hyperplane where the given dimension +has a fixed value, then return that value. +Otherwise return NaN. + +=item * Stride + + int isl_set_dim_residue_class_val( + __isl_keep isl_set *set, + int pos, __isl_give isl_val **modulo, + __isl_give isl_val **residue); + +Check if the values of the given set dimension are equal to a fixed +value modulo some integer value. If so, assign the modulo to C<*modulo> +and the fixed value to C<*residue>. If the given dimension attains only +a single value, then assign C<0> to C<*modulo> and the fixed value to +C<*residue>. +If the dimension does not attain only a single value and if no modulo +can be found then assign C<1> to C<*modulo> and C<1> to C<*residue>. + =item * Space To check whether a set is a parameter domain, use this function: @@ -2283,19 +2341,35 @@ without removing the dimensions. __isl_give isl_basic_set *isl_basic_set_fix_si( __isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_basic_set *isl_basic_set_fix_val( + __isl_take isl_basic_set *bset, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *v); __isl_give isl_set *isl_set_fix(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, isl_int value); __isl_give isl_set *isl_set_fix_si(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_set *isl_set_fix_val( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *v); __isl_give isl_basic_map *isl_basic_map_fix_si( __isl_take isl_basic_map *bmap, enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_basic_map *isl_basic_map_fix_val( + __isl_take isl_basic_map *bmap, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *v); __isl_give isl_map *isl_map_fix(__isl_take isl_map *map, enum isl_dim_type type, unsigned pos, isl_int value); __isl_give isl_map *isl_map_fix_si(__isl_take isl_map *map, enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_map *isl_map_fix_val( + __isl_take isl_map *map, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *v); Intersect the set or relation with the hyperplane where the given dimension has the fixed given value. @@ -2313,6 +2387,10 @@ dimension has the fixed given value. __isl_give isl_set *isl_set_lower_bound_si( __isl_take isl_set *set, enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_set *isl_set_lower_bound_val( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *value); __isl_give isl_map *isl_map_lower_bound_si( __isl_take isl_map *map, enum isl_dim_type type, unsigned pos, int value); @@ -2323,12 +2401,16 @@ dimension has the fixed given value. __isl_give isl_set *isl_set_upper_bound_si( __isl_take isl_set *set, enum isl_dim_type type, unsigned pos, int value); + __isl_give isl_set *isl_set_upper_bound_val( + __isl_take isl_set *set, + enum isl_dim_type type, unsigned pos, + __isl_take isl_val *value); __isl_give isl_map *isl_map_upper_bound_si( __isl_take isl_map *map, enum isl_dim_type type, unsigned pos, int value); Intersect the set or relation with the half-space where the given -dimension has a value bounded by the fixed given value. +dimension has a value bounded by the fixed given integer value. __isl_give isl_set *isl_set_equate(__isl_take isl_set *set, enum isl_dim_type type1, int pos1, @@ -2576,15 +2658,28 @@ a singleton subset of the input. Otherwise, return an empty set. enum isl_lp_result isl_basic_set_max( __isl_keep isl_basic_set *bset, __isl_keep isl_aff *obj, isl_int *opt) + __isl_give isl_val *isl_basic_set_max_val( + __isl_keep isl_basic_set *bset, + __isl_keep isl_aff *obj); enum isl_lp_result isl_set_min(__isl_keep isl_set *set, __isl_keep isl_aff *obj, isl_int *opt); + __isl_give isl_val *isl_set_min_val( + __isl_keep isl_set *set, + __isl_keep isl_aff *obj); enum isl_lp_result isl_set_max(__isl_keep isl_set *set, __isl_keep isl_aff *obj, isl_int *opt); + __isl_give isl_val *isl_set_max_val( + __isl_keep isl_set *set, + __isl_keep isl_aff *obj); Compute the minimum or maximum of the integer affine expression C over the points in C, returning the result in C. The return value may be one of C, -C, C or C. +C, C or C, in case of +an C. If the result is an C then +the result is C in case of an error, the optimal value in case +there is one, negative infinity or infinity if the problem is unbounded and +NaN if the problem is empty. =item * Parametric optimization @@ -2630,8 +2725,15 @@ dualization algorithms or skip the elimination step. __isl_give isl_map *isl_map_fixed_power( __isl_take isl_map *map, isl_int exp); + __isl_give isl_map *isl_map_fixed_power_val( + __isl_take isl_map *map, + __isl_take isl_val *exp); __isl_give isl_union_map *isl_union_map_fixed_power( __isl_take isl_union_map *umap, isl_int exp); + __isl_give isl_union_map * + isl_union_map_fixed_power_val( + __isl_take isl_union_map *umap, + __isl_take isl_val *exp); Compute the given power of C, where C is assumed to be non-zero. If the exponent C is negative, then the -C th power of the inverse @@ -3437,6 +3539,12 @@ Operations include __isl_give isl_multi_val *isl_multi_val_mod_val( __isl_take isl_multi_val *mv, __isl_take isl_val *v); + __isl_give isl_multi_val *isl_multi_val_scale_val( + __isl_take isl_multi_val *mv, + __isl_take isl_val *v); + __isl_give isl_multi_val *isl_multi_val_scale_multi_val( + __isl_take isl_multi_val *mv1, + __isl_take isl_multi_val *mv2); =head2 Vectors @@ -3470,6 +3578,8 @@ The elements can be changed and inspected using the following functions. int v); __isl_give isl_vec *isl_vec_set_val( __isl_take isl_vec *vec, __isl_take isl_val *v); + int isl_vec_cmp_element(__isl_keep isl_vec *vec1, + __isl_keep isl_vec *vec2, int pos); __isl_give isl_vec *isl_vec_fdiv_r(__isl_take isl_vec *vec, isl_int m); @@ -3623,10 +3733,17 @@ The expression can be inspected using enum isl_dim_type type); int isl_aff_get_constant(__isl_keep isl_aff *aff, isl_int *v); + __isl_give isl_val *isl_aff_get_constant_val( + __isl_keep isl_aff *aff); int isl_aff_get_coefficient(__isl_keep isl_aff *aff, enum isl_dim_type type, int pos, isl_int *v); + __isl_give isl_val *isl_aff_get_coefficient_val( + __isl_keep isl_aff *aff, + enum isl_dim_type type, int pos); int isl_aff_get_denominator(__isl_keep isl_aff *aff, isl_int *v); + __isl_give isl_val *isl_aff_get_denominator_val( + __isl_keep isl_aff *aff); __isl_give isl_aff *isl_aff_get_div( __isl_keep isl_aff *aff, int pos); @@ -3677,6 +3794,10 @@ It can be modified using __isl_give isl_aff *isl_aff_set_coefficient_si( __isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v); + __isl_give isl_aff *isl_aff_set_coefficient_val( + __isl_take isl_aff *aff, + enum isl_dim_type type, int pos, + __isl_take isl_val *v); __isl_give isl_aff *isl_aff_set_denominator( __isl_take isl_aff *aff, isl_int v); @@ -3684,6 +3805,8 @@ It can be modified using __isl_take isl_aff *aff, isl_int v); __isl_give isl_aff *isl_aff_add_constant_si( __isl_take isl_aff *aff, int v); + __isl_give isl_aff *isl_aff_add_constant_val( + __isl_take isl_aff *aff, __isl_take isl_val *v); __isl_give isl_aff *isl_aff_add_constant_num( __isl_take isl_aff *aff, isl_int v); __isl_give isl_aff *isl_aff_add_constant_num_si( @@ -3694,6 +3817,10 @@ It can be modified using __isl_give isl_aff *isl_aff_add_coefficient_si( __isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v); + __isl_give isl_aff *isl_aff_add_coefficient_val( + __isl_take isl_aff *aff, + enum isl_dim_type type, int pos, + __isl_take isl_val *v); __isl_give isl_aff *isl_aff_insert_dims( __isl_take isl_aff *aff, @@ -3717,8 +3844,10 @@ It can be modified using Note that C, C, C and C set the I of the constant or coefficient, while -C sets the constant as a whole. -C and C add an integer value to +C and C set +the constant or coefficient as a whole. +The C and C functions add an integer +or rational value to the possibly rational constant or coefficient. The C functions add an integer value to the numerator. @@ -3764,18 +3893,32 @@ Operations include __isl_take isl_pw_aff *pwaff); __isl_give isl_aff *isl_aff_mod(__isl_take isl_aff *aff, isl_int mod); + __isl_give isl_aff *isl_aff_mod_val(__isl_take isl_aff *aff, + __isl_take isl_val *mod); __isl_give isl_pw_aff *isl_pw_aff_mod( __isl_take isl_pw_aff *pwaff, isl_int mod); + __isl_give isl_pw_aff *isl_pw_aff_mod_val( + __isl_take isl_pw_aff *pa, + __isl_take isl_val *mod); __isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff, isl_int f); + __isl_give isl_aff *isl_aff_scale_val(__isl_take isl_aff *aff, + __isl_take isl_val *v); __isl_give isl_pw_aff *isl_pw_aff_scale( __isl_take isl_pw_aff *pwaff, isl_int f); + __isl_give isl_pw_aff *isl_pw_aff_scale_val( + __isl_take isl_pw_aff *pa, __isl_take isl_val *v); __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f); __isl_give isl_aff *isl_aff_scale_down_ui( __isl_take isl_aff *aff, unsigned f); + __isl_give isl_aff *isl_aff_scale_down_val( + __isl_take isl_aff *aff, __isl_take isl_val *v); __isl_give isl_pw_aff *isl_pw_aff_scale_down( __isl_take isl_pw_aff *pwaff, isl_int f); + __isl_give isl_pw_aff *isl_pw_aff_scale_down_val( + __isl_take isl_pw_aff *pa, + __isl_take isl_val *f); __isl_give isl_pw_aff *isl_pw_aff_list_min( __isl_take isl_pw_aff_list *list); @@ -4233,18 +4376,33 @@ C subtracts the second argument from the first. __isl_give isl_multi_aff *isl_multi_aff_scale( __isl_take isl_multi_aff *maff, isl_int f); - __isl_give isl_multi_aff *isl_multi_aff_scale_vec( + __isl_give isl_multi_aff *isl_multi_aff_scale_val( __isl_take isl_multi_aff *ma, - __isl_take isl_vec *v); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_vec( + __isl_take isl_val *v); + __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_val( + __isl_take isl_pw_multi_aff *pma, + __isl_take isl_val *v); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_scale_val( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_val *v); + __isl_give isl_multi_aff *isl_multi_aff_scale_multi_val( + __isl_take isl_multi_aff *ma, + __isl_take isl_multi_val *mv); + __isl_give isl_pw_multi_aff * + isl_pw_multi_aff_scale_multi_val( __isl_take isl_pw_multi_aff *pma, - __isl_take isl_vec *v); - __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_scale_vec( + __isl_take isl_multi_val *mv); + __isl_give isl_multi_pw_aff * + isl_multi_pw_aff_scale_multi_val( + __isl_take isl_multi_pw_aff *mpa, + __isl_take isl_multi_val *mv); + __isl_give isl_union_pw_multi_aff * + isl_union_pw_multi_aff_scale_multi_val( __isl_take isl_union_pw_multi_aff *upma, - __isl_take isl_vec *v); + __isl_take isl_multi_val *mv); -C scales the first elements of C -by the corresponding elements of C. +C scales the elements of C +by the corresponding elements of C. __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_params( __isl_take isl_pw_multi_aff *pma, @@ -4571,6 +4729,9 @@ on the resulting quasipolynomials __isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain( __isl_take isl_space *domain, const isl_int n, const isl_int d); + __isl_give isl_qpolynomial *isl_qpolynomial_val_on_domain( + __isl_take isl_space *domain, + __isl_take isl_val *val); __isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain( __isl_take isl_space *domain, enum isl_dim_type type, unsigned pos); @@ -4665,6 +4826,11 @@ will not have any existentially quantified variables, but that the dimensions of the sets may be different for different invocations of C. +The constant term of a quasipolynomial can be extracted using + + __isl_give isl_val *isl_qpolynomial_get_constant_val( + __isl_keep isl_qpolynomial *qp); + To iterate over all terms in a quasipolynomial, use @@ -4682,6 +4848,8 @@ these functions isl_int *n); void isl_term_get_den(__isl_keep isl_term *term, isl_int *d); + __isl_give isl_val *isl_term_get_coefficient_val( + __isl_keep isl_term *term); int isl_term_get_exp(__isl_keep isl_term *term, enum isl_dim_type type, unsigned pos); __isl_give isl_aff *isl_term_get_div( @@ -4718,6 +4886,9 @@ obviously equal, use __isl_give isl_qpolynomial *isl_qpolynomial_scale( __isl_take isl_qpolynomial *qp, isl_int v); + __isl_give isl_qpolynomial *isl_qpolynomial_scale_val( + __isl_take isl_qpolynomial *qp, + __isl_take isl_val *v); __isl_give isl_qpolynomial *isl_qpolynomial_neg( __isl_take isl_qpolynomial *qp); __isl_give isl_qpolynomial *isl_qpolynomial_add( @@ -4732,6 +4903,14 @@ obviously equal, use __isl_give isl_qpolynomial *isl_qpolynomial_pow( __isl_take isl_qpolynomial *qp, unsigned exponent); + __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fix_val( + __isl_take isl_pw_qpolynomial *pwqp, + enum isl_dim_type type, unsigned n, + __isl_take isl_val *v); + __isl_give isl_pw_qpolynomial * + isl_pw_qpolynomial_scale_val( + __isl_take isl_pw_qpolynomial *pwqp, + __isl_take isl_val *v); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add( __isl_take isl_pw_qpolynomial *pwqp1, __isl_take isl_pw_qpolynomial *pwqp2); @@ -4749,6 +4928,10 @@ obviously equal, use __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_pow( __isl_take isl_pw_qpolynomial *pwqp, unsigned exponent); + __isl_give isl_union_pw_qpolynomial * + isl_union_pw_qpolynomial_scale_val( + __isl_take isl_union_pw_qpolynomial *upwqp, + __isl_take isl_val *v); __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add( __isl_take isl_union_pw_qpolynomial *upwqp1, __isl_take isl_union_pw_qpolynomial *upwqp2); @@ -4954,6 +5137,17 @@ obviously equal, use __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale( __isl_take isl_qpolynomial_fold *fold, isl_int v); + __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale_val( + __isl_take isl_qpolynomial_fold *fold, + __isl_take isl_val *v); + __isl_give isl_pw_qpolynomial_fold * + isl_pw_qpolynomial_fold_scale_val( + __isl_take isl_pw_qpolynomial_fold *pwf, + __isl_take isl_val *v); + __isl_give isl_union_pw_qpolynomial_fold * + isl_union_pw_qpolynomial_fold_scale_val( + __isl_take isl_union_pw_qpolynomial_fold *upwf, + __isl_take isl_val *v); __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add( __isl_take isl_pw_qpolynomial_fold *pwf1, @@ -5846,10 +6040,13 @@ Return the identifier represented by the AST expression. #include int isl_ast_expr_get_int(__isl_keep isl_ast_expr *expr, isl_int *v); + __isl_give isl_val *isl_ast_expr_get_val( + __isl_keep isl_ast_expr *expr); Return the integer represented by the AST expression. -Note that the integer is returned through the C argument. -The return value of the function itself indicates whether the +Note that the integer is returned by C +through the C argument. +The return value of this function itself indicates whether the operation was performed successfully. =head3 Manipulating and printing the AST @@ -5872,6 +6069,8 @@ New AST expressions can be created either directly or within the context of an C. #include + __isl_give isl_ast_expr *isl_ast_expr_from_val( + __isl_take isl_val *v); __isl_give isl_ast_expr *isl_ast_expr_from_id( __isl_take isl_id *id); __isl_give isl_ast_expr *isl_ast_expr_neg(