~ubuntu-branches/ubuntu/trusty/cloog/trusty

« back to all changes in this revision

Viewing changes to isl/doc/user.pod

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-10-17 15:54:24 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20131017155424-3q1gw7yhddylfkpj
Tags: 0.18.1-1
* New upstream version.
* Add a comment to build-depend on libpod-latex-perl | perl (<< 5.17.0),
  when the documentation is built. Closes: #711681.
* Use dh_autotools-dev to update config.{sub,guess}. Closes: #719957.

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
        isl_ctx *isl_ctx_alloc();
344
344
        void isl_ctx_free(isl_ctx *ctx);
345
345
 
346
 
=head2 Integers
347
 
 
348
 
All operations on integers, mainly the coefficients
349
 
of the constraints describing the sets and relations,
350
 
are performed in exact integer arithmetic using C<GMP>.
351
 
However, to allow future versions of C<isl> to optionally
352
 
support fixed integer arithmetic, all calls to C<GMP>
353
 
are wrapped inside C<isl> specific macros.
354
 
The basic type is C<isl_int> and the operations below
355
 
are available on this type.
 
346
=head2 Values
 
347
 
 
348
An C<isl_val> represents an integer value, a rational value
 
349
or one of three special values, infinity, negative infinity and NaN.
 
350
Some predefined values can be created using the following functions.
 
351
 
 
352
        #include <isl/val.h>
 
353
        __isl_give isl_val *isl_val_zero(isl_ctx *ctx);
 
354
        __isl_give isl_val *isl_val_one(isl_ctx *ctx);
 
355
        __isl_give isl_val *isl_val_nan(isl_ctx *ctx);
 
356
        __isl_give isl_val *isl_val_infty(isl_ctx *ctx);
 
357
        __isl_give isl_val *isl_val_neginfty(isl_ctx *ctx);
 
358
 
 
359
Specific integer values can be created using the following functions.
 
360
 
 
361
        #include <isl/val.h>
 
362
        __isl_give isl_val *isl_val_int_from_si(isl_ctx *ctx,
 
363
                long i);
 
364
        __isl_give isl_val *isl_val_int_from_ui(isl_ctx *ctx,
 
365
                unsigned long u);
 
366
        __isl_give isl_val *isl_val_int_from_chunks(isl_ctx *ctx,
 
367
                size_t n, size_t size, const void *chunks);
 
368
 
 
369
The function C<isl_val_int_from_chunks> constructs an C<isl_val>
 
370
from the C<n> I<digits>, each consisting of C<size> bytes, stored at C<chunks>.
 
371
The least significant digit is assumed to be stored first.
 
372
 
 
373
Value objects can be copied and freed using the following functions.
 
374
 
 
375
        #include <isl/val.h>
 
376
        __isl_give isl_val *isl_val_copy(__isl_keep isl_val *v);
 
377
        void *isl_val_free(__isl_take isl_val *v);
 
378
 
 
379
They can be inspected using the following functions.
 
380
 
 
381
        #include <isl/val.h>
 
382
        isl_ctx *isl_val_get_ctx(__isl_keep isl_val *val);
 
383
        long isl_val_get_num_si(__isl_keep isl_val *v);
 
384
        long isl_val_get_den_si(__isl_keep isl_val *v);
 
385
        double isl_val_get_d(__isl_keep isl_val *v);
 
386
        size_t isl_val_n_abs_num_chunks(__isl_keep isl_val *v,
 
387
                size_t size);
 
388
        int isl_val_get_abs_num_chunks(__isl_keep isl_val *v,
 
389
                size_t size, void *chunks);
 
390
 
 
391
C<isl_val_n_abs_num_chunks> returns the number of I<digits>
 
392
of C<size> bytes needed to store the absolute value of the
 
393
numerator of C<v>.
 
394
C<isl_val_get_abs_num_chunks> stores these digits at C<chunks>,
 
395
which is assumed to have been preallocated by the caller.
 
396
The least significant digit is stored first.
 
397
Note that C<isl_val_get_num_si>, C<isl_val_get_den_si>,
 
398
C<isl_val_get_d>, C<isl_val_n_abs_num_chunks>
 
399
and C<isl_val_get_abs_num_chunks> can only be applied to rational values.
 
400
 
 
401
An C<isl_val> can be modified using the following function.
 
402
 
 
403
        #include <isl/val.h>
 
404
        __isl_give isl_val *isl_val_set_si(__isl_take isl_val *v,
 
405
                long i);
 
406
 
 
407
The following unary properties are defined on C<isl_val>s.
 
408
 
 
409
        #include <isl/val.h>
 
410
        int isl_val_sgn(__isl_keep isl_val *v);
 
411
        int isl_val_is_zero(__isl_keep isl_val *v);
 
412
        int isl_val_is_one(__isl_keep isl_val *v);
 
413
        int isl_val_is_negone(__isl_keep isl_val *v);
 
414
        int isl_val_is_nonneg(__isl_keep isl_val *v);
 
415
        int isl_val_is_nonpos(__isl_keep isl_val *v);
 
416
        int isl_val_is_pos(__isl_keep isl_val *v);
 
417
        int isl_val_is_neg(__isl_keep isl_val *v);
 
418
        int isl_val_is_int(__isl_keep isl_val *v);
 
419
        int isl_val_is_rat(__isl_keep isl_val *v);
 
420
        int isl_val_is_nan(__isl_keep isl_val *v);
 
421
        int isl_val_is_infty(__isl_keep isl_val *v);
 
422
        int isl_val_is_neginfty(__isl_keep isl_val *v);
 
423
 
 
424
Note that the sign of NaN is undefined.
 
425
 
 
426
The following binary properties are defined on pairs of C<isl_val>s.
 
427
 
 
428
        #include <isl/val.h>
 
429
        int isl_val_lt(__isl_keep isl_val *v1,
 
430
                __isl_keep isl_val *v2);
 
431
        int isl_val_le(__isl_keep isl_val *v1,
 
432
                __isl_keep isl_val *v2);
 
433
        int isl_val_gt(__isl_keep isl_val *v1,
 
434
                __isl_keep isl_val *v2);
 
435
        int isl_val_ge(__isl_keep isl_val *v1,
 
436
                __isl_keep isl_val *v2);
 
437
        int isl_val_eq(__isl_keep isl_val *v1,
 
438
                __isl_keep isl_val *v2);
 
439
        int isl_val_ne(__isl_keep isl_val *v1,
 
440
                __isl_keep isl_val *v2);
 
441
 
 
442
For integer C<isl_val>s we additionally have the following binary property.
 
443
 
 
444
        #include <isl/val.h>
 
445
        int isl_val_is_divisible_by(__isl_keep isl_val *v1,
 
446
                __isl_keep isl_val *v2);
 
447
 
 
448
An C<isl_val> can also be compared to an integer using the following
 
449
function.  The result is undefined for NaN.
 
450
 
 
451
        #include <isl/val.h>
 
452
        int isl_val_cmp_si(__isl_keep isl_val *v, long i);
 
453
 
 
454
The following unary operations are available on C<isl_val>s.
 
455
 
 
456
        #include <isl/val.h>
 
457
        __isl_give isl_val *isl_val_abs(__isl_take isl_val *v);
 
458
        __isl_give isl_val *isl_val_neg(__isl_take isl_val *v);
 
459
        __isl_give isl_val *isl_val_floor(__isl_take isl_val *v);
 
460
        __isl_give isl_val *isl_val_ceil(__isl_take isl_val *v);
 
461
        __isl_give isl_val *isl_val_trunc(__isl_take isl_val *v);
 
462
 
 
463
The following binary operations are available on C<isl_val>s.
 
464
 
 
465
        #include <isl/val.h>
 
466
        __isl_give isl_val *isl_val_abs(__isl_take isl_val *v);
 
467
        __isl_give isl_val *isl_val_neg(__isl_take isl_val *v);
 
468
        __isl_give isl_val *isl_val_floor(__isl_take isl_val *v);
 
469
        __isl_give isl_val *isl_val_ceil(__isl_take isl_val *v);
 
470
        __isl_give isl_val *isl_val_trunc(__isl_take isl_val *v);
 
471
        __isl_give isl_val *isl_val_2exp(__isl_take isl_val *v);
 
472
        __isl_give isl_val *isl_val_min(__isl_take isl_val *v1,
 
473
                __isl_take isl_val *v2);
 
474
        __isl_give isl_val *isl_val_max(__isl_take isl_val *v1,
 
475
                __isl_take isl_val *v2);
 
476
        __isl_give isl_val *isl_val_add(__isl_take isl_val *v1,
 
477
                __isl_take isl_val *v2);
 
478
        __isl_give isl_val *isl_val_add_ui(__isl_take isl_val *v1,
 
479
                unsigned long v2);
 
480
        __isl_give isl_val *isl_val_sub(__isl_take isl_val *v1,
 
481
                __isl_take isl_val *v2);
 
482
        __isl_give isl_val *isl_val_sub_ui(__isl_take isl_val *v1,
 
483
                unsigned long v2);
 
484
        __isl_give isl_val *isl_val_mul(__isl_take isl_val *v1,
 
485
                __isl_take isl_val *v2);
 
486
        __isl_give isl_val *isl_val_mul_ui(__isl_take isl_val *v1,
 
487
                unsigned long v2);
 
488
        __isl_give isl_val *isl_val_div(__isl_take isl_val *v1,
 
489
                __isl_take isl_val *v2);
 
490
 
 
491
On integer values, we additionally have the following operations.
 
492
 
 
493
        #include <isl/val.h>
 
494
        __isl_give isl_val *isl_val_2exp(__isl_take isl_val *v);
 
495
        __isl_give isl_val *isl_val_mod(__isl_take isl_val *v1,
 
496
                __isl_take isl_val *v2);
 
497
        __isl_give isl_val *isl_val_gcd(__isl_take isl_val *v1,
 
498
                __isl_take isl_val *v2);
 
499
        __isl_give isl_val *isl_val_gcdext(__isl_take isl_val *v1,
 
500
                __isl_take isl_val *v2, __isl_give isl_val **x,
 
501
                __isl_give isl_val **y);
 
502
 
 
503
The function C<isl_val_gcdext> returns the greatest common divisor g
 
504
of C<v1> and C<v2> as well as two integers C<*x> and C<*y> such
 
505
that C<*x> * C<v1> + C<*y> * C<v2> = g.
 
506
 
 
507
A value can be read from input using
 
508
 
 
509
        #include <isl/val.h>
 
510
        __isl_give isl_val *isl_val_read_from_str(isl_ctx *ctx,
 
511
                const char *str);
 
512
 
 
513
A value can be printed using
 
514
 
 
515
        #include <isl/val.h>
 
516
        __isl_give isl_printer *isl_printer_print_val(
 
517
                __isl_take isl_printer *p, __isl_keep isl_val *v);
 
518
 
 
519
=head3 GMP specific functions
 
520
 
 
521
These functions are only available if C<isl> has been compiled with C<GMP>
 
522
support.
 
523
 
 
524
Specific integer and rational values can be created from C<GMP> values using
 
525
the following functions.
 
526
 
 
527
        #include <isl/val_gmp.h>
 
528
        __isl_give isl_val *isl_val_int_from_gmp(isl_ctx *ctx,
 
529
                mpz_t z);
 
530
        __isl_give isl_val *isl_val_from_gmp(isl_ctx *ctx,
 
531
                const mpz_t n, const mpz_t d);
 
532
 
 
533
The numerator and denominator of a rational value can be extracted as
 
534
C<GMP> values using the following functions.
 
535
 
 
536
        #include <isl/val_gmp.h>
 
537
        int isl_val_get_num_gmp(__isl_keep isl_val *v, mpz_t z);
 
538
        int isl_val_get_den_gmp(__isl_keep isl_val *v, mpz_t z);
 
539
 
 
540
=head3 Conversion from C<isl_int>
 
541
 
 
542
The following functions are only temporarily available to ease
 
543
the transition from C<isl_int> to C<isl_val>.  They will be removed
 
544
in the next release.
 
545
 
 
546
        #include <isl/val_int.h>
 
547
        __isl_give isl_val *isl_val_int_from_isl_int(isl_ctx *ctx,
 
548
                isl_int n);
 
549
        int isl_val_get_num_isl_int(__isl_keep isl_val *v,
 
550
                isl_int *n);
 
551
 
 
552
=head2 Integers (obsolescent)
 
553
 
 
554
In previous versions of C<isl>, integers were represented
 
555
in the external interface using the C<isl_int> type.
 
556
This type has now been superseded by C<isl_val>.
 
557
The C<isl_int> type will be removed from the external interface
 
558
in future releases.  New code should not use C<isl_int>.
 
559
 
 
560
The operations below are currently available on C<isl_int>s.
356
561
The meanings of these operations are essentially the same
357
562
as their C<GMP> C<mpz_> counterparts.
358
563
As always with C<GMP> types, C<isl_int>s need to be
734
939
        __isl_give isl_space *isl_union_pw_qpolynomial_fold_get_space(
735
940
                __isl_keep isl_union_pw_qpolynomial_fold *upwf);
736
941
 
 
942
        #include <isl/val.h>
 
943
        __isl_give isl_space *isl_multi_val_get_space(
 
944
                __isl_keep isl_multi_val *mv);
 
945
 
737
946
        #include <isl/aff.h>
738
947
        __isl_give isl_space *isl_aff_get_domain_space(
739
948
                __isl_keep isl_aff *aff);
950
1159
                __isl_keep isl_local_space *ls);
951
1160
        void *isl_local_space_free(__isl_take isl_local_space *ls);
952
1161
 
 
1162
Note that C<isl_local_space_get_div> can only be used on local spaces
 
1163
of sets.
 
1164
 
953
1165
Two local spaces can be compared using
954
1166
 
955
1167
        int isl_local_space_is_equal(__isl_keep isl_local_space *ls1,
1325
1537
                __isl_take isl_constraint *constraint, isl_int v);
1326
1538
        __isl_give isl_constraint *isl_constraint_set_constant_si(
1327
1539
                __isl_take isl_constraint *constraint, int v);
 
1540
        __isl_give isl_constraint *isl_constraint_set_constant_val(
 
1541
                __isl_take isl_constraint *constraint,
 
1542
                __isl_take isl_val *v);
1328
1543
        __isl_give isl_constraint *isl_constraint_set_coefficient(
1329
1544
                __isl_take isl_constraint *constraint,
1330
1545
                enum isl_dim_type type, int pos, isl_int v);
1331
1546
        __isl_give isl_constraint *isl_constraint_set_coefficient_si(
1332
1547
                __isl_take isl_constraint *constraint,
1333
1548
                enum isl_dim_type type, int pos, int v);
 
1549
        __isl_give isl_constraint *
 
1550
        isl_constraint_set_coefficient_val(
 
1551
                __isl_take isl_constraint *constraint,
 
1552
                enum isl_dim_type type, int pos, isl_val *v);
1334
1553
        __isl_give isl_basic_map *isl_basic_map_add_constraint(
1335
1554
                __isl_take isl_basic_map *bmap,
1336
1555
                __isl_take isl_constraint *constraint);
1602
1821
                enum isl_dim_type type, unsigned pos);
1603
1822
        void isl_constraint_get_constant(
1604
1823
                __isl_keep isl_constraint *constraint, isl_int *v);
 
1824
        __isl_give isl_val *isl_constraint_get_constant_val(
 
1825
                __isl_keep isl_constraint *constraint);
1605
1826
        void isl_constraint_get_coefficient(
1606
1827
                __isl_keep isl_constraint *constraint,
1607
1828
                enum isl_dim_type type, int pos, isl_int *v);
 
1829
        __isl_give isl_val *isl_constraint_get_coefficient_val(
 
1830
                __isl_keep isl_constraint *constraint,
 
1831
                enum isl_dim_type type, int pos);
1608
1832
        int isl_constraint_involves_dims(
1609
1833
                __isl_keep isl_constraint *constraint,
1610
1834
                enum isl_dim_type type, unsigned first, unsigned n);
1864
2088
Check if the relation obviously lies on a hyperplane where the given dimension
1865
2089
has a fixed value and if so, return that value in C<*val>.
1866
2090
 
 
2091
        __isl_give isl_val *
 
2092
        isl_basic_map_plain_get_val_if_fixed(
 
2093
                __isl_keep isl_basic_map *bmap,
 
2094
                enum isl_dim_type type, unsigned pos);
 
2095
        __isl_give isl_val *isl_set_plain_get_val_if_fixed(
 
2096
                __isl_keep isl_set *set,
 
2097
                enum isl_dim_type type, unsigned pos);
 
2098
        __isl_give isl_val *isl_map_plain_get_val_if_fixed(
 
2099
                __isl_keep isl_map *map,
 
2100
                enum isl_dim_type type, unsigned pos);
 
2101
 
 
2102
If the set or relation obviously lies on a hyperplane where the given dimension
 
2103
has a fixed value, then return that value.
 
2104
Otherwise return NaN.
 
2105
 
 
2106
=item * Stride
 
2107
 
 
2108
        int isl_set_dim_residue_class_val(
 
2109
                __isl_keep isl_set *set,
 
2110
                int pos, __isl_give isl_val **modulo,
 
2111
                __isl_give isl_val **residue);
 
2112
 
 
2113
Check if the values of the given set dimension are equal to a fixed
 
2114
value modulo some integer value.  If so, assign the modulo to C<*modulo>
 
2115
and the fixed value to C<*residue>.  If the given dimension attains only
 
2116
a single value, then assign C<0> to C<*modulo> and the fixed value to
 
2117
C<*residue>.
 
2118
If the dimension does not attain only a single value and if no modulo
 
2119
can be found then assign C<1> to C<*modulo> and C<1> to C<*residue>.
 
2120
 
1867
2121
=item * Space
1868
2122
 
1869
2123
To check whether a set is a parameter domain, use this function:
2087
2341
        __isl_give isl_basic_set *isl_basic_set_fix_si(
2088
2342
                __isl_take isl_basic_set *bset,
2089
2343
                enum isl_dim_type type, unsigned pos, int value);
 
2344
        __isl_give isl_basic_set *isl_basic_set_fix_val(
 
2345
                __isl_take isl_basic_set *bset,
 
2346
                enum isl_dim_type type, unsigned pos,
 
2347
                __isl_take isl_val *v);
2090
2348
        __isl_give isl_set *isl_set_fix(__isl_take isl_set *set,
2091
2349
                enum isl_dim_type type, unsigned pos,
2092
2350
                isl_int value);
2093
2351
        __isl_give isl_set *isl_set_fix_si(__isl_take isl_set *set,
2094
2352
                enum isl_dim_type type, unsigned pos, int value);
 
2353
        __isl_give isl_set *isl_set_fix_val(
 
2354
                __isl_take isl_set *set,
 
2355
                enum isl_dim_type type, unsigned pos,
 
2356
                __isl_take isl_val *v);
2095
2357
        __isl_give isl_basic_map *isl_basic_map_fix_si(
2096
2358
                __isl_take isl_basic_map *bmap,
2097
2359
                enum isl_dim_type type, unsigned pos, int value);
 
2360
        __isl_give isl_basic_map *isl_basic_map_fix_val(
 
2361
                __isl_take isl_basic_map *bmap,
 
2362
                enum isl_dim_type type, unsigned pos,
 
2363
                __isl_take isl_val *v);
2098
2364
        __isl_give isl_map *isl_map_fix(__isl_take isl_map *map,
2099
2365
                enum isl_dim_type type, unsigned pos,
2100
2366
                isl_int value);
2101
2367
        __isl_give isl_map *isl_map_fix_si(__isl_take isl_map *map,
2102
2368
                enum isl_dim_type type, unsigned pos, int value);
 
2369
        __isl_give isl_map *isl_map_fix_val(
 
2370
                __isl_take isl_map *map,
 
2371
                enum isl_dim_type type, unsigned pos,
 
2372
                __isl_take isl_val *v);
2103
2373
 
2104
2374
Intersect the set or relation with the hyperplane where the given
2105
2375
dimension has the fixed given value.
2117
2387
        __isl_give isl_set *isl_set_lower_bound_si(
2118
2388
                __isl_take isl_set *set,
2119
2389
                enum isl_dim_type type, unsigned pos, int value);
 
2390
        __isl_give isl_set *isl_set_lower_bound_val(
 
2391
                __isl_take isl_set *set,
 
2392
                enum isl_dim_type type, unsigned pos,
 
2393
                __isl_take isl_val *value);
2120
2394
        __isl_give isl_map *isl_map_lower_bound_si(
2121
2395
                __isl_take isl_map *map,
2122
2396
                enum isl_dim_type type, unsigned pos, int value);
2127
2401
        __isl_give isl_set *isl_set_upper_bound_si(
2128
2402
                __isl_take isl_set *set,
2129
2403
                enum isl_dim_type type, unsigned pos, int value);
 
2404
        __isl_give isl_set *isl_set_upper_bound_val(
 
2405
                __isl_take isl_set *set,
 
2406
                enum isl_dim_type type, unsigned pos,
 
2407
                __isl_take isl_val *value);
2130
2408
        __isl_give isl_map *isl_map_upper_bound_si(
2131
2409
                __isl_take isl_map *map,
2132
2410
                enum isl_dim_type type, unsigned pos, int value);
2133
2411
 
2134
2412
Intersect the set or relation with the half-space where the given
2135
 
dimension has a value bounded by the fixed given value.
 
2413
dimension has a value bounded by the fixed given integer value.
2136
2414
 
2137
2415
        __isl_give isl_set *isl_set_equate(__isl_take isl_set *set,
2138
2416
                enum isl_dim_type type1, int pos1,
2162
2440
        __isl_give isl_map *isl_map_order_lt(__isl_take isl_map *map,
2163
2441
                enum isl_dim_type type1, int pos1,
2164
2442
                enum isl_dim_type type2, int pos2);
 
2443
        __isl_give isl_basic_map *isl_basic_map_order_gt(
 
2444
                __isl_take isl_basic_map *bmap,
 
2445
                enum isl_dim_type type1, int pos1,
 
2446
                enum isl_dim_type type2, int pos2);
2165
2447
        __isl_give isl_map *isl_map_order_gt(__isl_take isl_map *map,
2166
2448
                enum isl_dim_type type1, int pos1,
2167
2449
                enum isl_dim_type type2, int pos2);
2332
2614
                __isl_take isl_basic_set *bset,
2333
2615
                enum isl_dim_type type,
2334
2616
                unsigned first, unsigned n);
 
2617
        __isl_give isl_basic_map *
 
2618
        isl_basic_map_drop_constraints_involving_dims(
 
2619
                __isl_take isl_basic_map *bmap,
 
2620
                enum isl_dim_type type,
 
2621
                unsigned first, unsigned n);
2335
2622
        __isl_give isl_basic_set *
2336
2623
        isl_basic_set_drop_constraints_not_involving_dims(
2337
2624
                __isl_take isl_basic_set *bset,
2371
2658
        enum isl_lp_result isl_basic_set_max(
2372
2659
                __isl_keep isl_basic_set *bset,
2373
2660
                __isl_keep isl_aff *obj, isl_int *opt)
 
2661
        __isl_give isl_val *isl_basic_set_max_val(
 
2662
                __isl_keep isl_basic_set *bset,
 
2663
                __isl_keep isl_aff *obj);
2374
2664
        enum isl_lp_result isl_set_min(__isl_keep isl_set *set,
2375
2665
                __isl_keep isl_aff *obj, isl_int *opt);
 
2666
        __isl_give isl_val *isl_set_min_val(
 
2667
                __isl_keep isl_set *set,
 
2668
                __isl_keep isl_aff *obj);
2376
2669
        enum isl_lp_result isl_set_max(__isl_keep isl_set *set,
2377
2670
                __isl_keep isl_aff *obj, isl_int *opt);
 
2671
        __isl_give isl_val *isl_set_max_val(
 
2672
                __isl_keep isl_set *set,
 
2673
                __isl_keep isl_aff *obj);
2378
2674
 
2379
2675
Compute the minimum or maximum of the integer affine expression C<obj>
2380
2676
over the points in C<set>, returning the result in C<opt>.
2381
2677
The return value may be one of C<isl_lp_error>,
2382
 
C<isl_lp_ok>, C<isl_lp_unbounded> or C<isl_lp_empty>.
 
2678
C<isl_lp_ok>, C<isl_lp_unbounded> or C<isl_lp_empty>, in case of
 
2679
an C<isl_lp_result>.  If the result is an C<isl_val> then
 
2680
the result is C<NULL> in case of an error, the optimal value in case
 
2681
there is one, negative infinity or infinity if the problem is unbounded and
 
2682
NaN if the problem is empty.
2383
2683
 
2384
2684
=item * Parametric optimization
2385
2685
 
2425
2725
 
2426
2726
        __isl_give isl_map *isl_map_fixed_power(
2427
2727
                __isl_take isl_map *map, isl_int exp);
 
2728
        __isl_give isl_map *isl_map_fixed_power_val(
 
2729
                __isl_take isl_map *map,
 
2730
                __isl_take isl_val *exp);
2428
2731
        __isl_give isl_union_map *isl_union_map_fixed_power(
2429
2732
                __isl_take isl_union_map *umap, isl_int exp);
 
2733
        __isl_give isl_union_map *
 
2734
        isl_union_map_fixed_power_val(
 
2735
                __isl_take isl_union_map *umap,
 
2736
                __isl_take isl_val *exp);
2430
2737
 
2431
2738
Compute the given power of C<map>, where C<exp> is assumed to be non-zero.
2432
2739
If the exponent C<exp> is negative, then the -C<exp> th power of the inverse
2809
3116
        __isl_give isl_set *isl_set_preimage_pw_multi_aff(
2810
3117
                __isl_take isl_set *set,
2811
3118
                __isl_take isl_pw_multi_aff *pma);
 
3119
        __isl_give isl_map *isl_map_preimage_domain_multi_aff(
 
3120
                __isl_take isl_map *map,
 
3121
                __isl_take isl_multi_aff *ma);
 
3122
        __isl_give isl_union_map *
 
3123
        isl_union_map_preimage_domain_multi_aff(
 
3124
                __isl_take isl_union_map *umap,
 
3125
                __isl_take isl_multi_aff *ma);
2812
3126
 
2813
 
These functions compute the preimage of the given set under
 
3127
These functions compute the preimage of the given set or map domain under
2814
3128
the given function.  In other words, the expression is plugged
2815
 
into the set description.
 
3129
into the set description or into the domain of the map.
2816
3130
Objects of types C<isl_multi_aff> and C<isl_pw_multi_aff> are described in
2817
3131
L</"Piecewise Multiple Quasi Affine Expressions">.
2818
3132
 
3058
3372
                __isl_take isl_basic_map *bmap,
3059
3373
                __isl_take isl_basic_set *dom,
3060
3374
                __isl_give isl_set **empty);
 
3375
        __isl_give isl_pw_multi_aff *isl_set_lexmin_pw_multi_aff(
 
3376
                __isl_take isl_set *set);
 
3377
        __isl_give isl_pw_multi_aff *isl_set_lexmax_pw_multi_aff(
 
3378
                __isl_take isl_set *set);
3061
3379
        __isl_give isl_pw_multi_aff *isl_map_lexmin_pw_multi_aff(
3062
3380
                __isl_take isl_map *map);
3063
3381
        __isl_give isl_pw_multi_aff *isl_map_lexmax_pw_multi_aff(
3066
3384
=head2 Lists
3067
3385
 
3068
3386
Lists are defined over several element types, including
3069
 
C<isl_id>, C<isl_aff>, C<isl_pw_aff>, C<isl_constraint>,
 
3387
C<isl_val>, C<isl_id>, C<isl_aff>, C<isl_pw_aff>, C<isl_constraint>,
3070
3388
C<isl_basic_set>, C<isl_set>, C<isl_ast_expr> and C<isl_ast_node>.
3071
3389
Here we take lists of C<isl_set>s as an example.
3072
3390
Lists can be created, copied, modified and freed using the following functions.
3093
3411
        __isl_give isl_set_list *isl_set_list_concat(
3094
3412
                __isl_take isl_set_list *list1,
3095
3413
                __isl_take isl_set_list *list2);
 
3414
        __isl_give isl_set_list *isl_set_list_sort(
 
3415
                __isl_take isl_set_list *list,
 
3416
                int (*cmp)(__isl_keep isl_set *a,
 
3417
                        __isl_keep isl_set *b, void *user),
 
3418
                void *user);
3096
3419
        void *isl_set_list_free(__isl_take isl_set_list *list);
3097
3420
 
3098
3421
C<isl_set_list_alloc> creates an empty list with a capacity for
3109
3432
        int isl_set_list_foreach(__isl_keep isl_set_list *list,
3110
3433
                int (*fn)(__isl_take isl_set *el, void *user),
3111
3434
                void *user);
 
3435
        int isl_set_list_foreach_scc(__isl_keep isl_set_list *list,
 
3436
                int (*follows)(__isl_keep isl_set *a,
 
3437
                        __isl_keep isl_set *b, void *user),
 
3438
                void *follows_user
 
3439
                int (*fn)(__isl_take isl_set *el, void *user),
 
3440
                void *fn_user);
 
3441
 
 
3442
The function C<isl_set_list_foreach_scc> calls C<fn> on each of the
 
3443
strongly connected components of the graph with as vertices the elements
 
3444
of C<list> and a directed edge from vertex C<b> to vertex C<a>
 
3445
iff C<follows(a, b)> returns C<1>.  The callbacks C<follows> and C<fn>
 
3446
should return C<-1> on error.
3112
3447
 
3113
3448
Lists can be printed using
3114
3449
 
3117
3452
                __isl_take isl_printer *p,
3118
3453
                __isl_keep isl_set_list *list);
3119
3454
 
 
3455
=head2 Multiple Values
 
3456
 
 
3457
An C<isl_multi_val> object represents a sequence of zero or more values,
 
3458
living in a set space.
 
3459
 
 
3460
An C<isl_multi_val> can be constructed from an C<isl_val_list>
 
3461
using the following function
 
3462
 
 
3463
        #include <isl/val.h>
 
3464
        __isl_give isl_multi_val *isl_multi_val_from_val_list(
 
3465
                __isl_take isl_space *space,
 
3466
                __isl_take isl_val_list *list);
 
3467
 
 
3468
The zero multiple value (with value zero for each set dimension)
 
3469
can be created using the following function.
 
3470
 
 
3471
        #include <isl/val.h>
 
3472
        __isl_give isl_multi_val *isl_multi_val_zero(
 
3473
                __isl_take isl_space *space);
 
3474
 
 
3475
Multiple values can be copied and freed using
 
3476
 
 
3477
        #include <isl/val.h>
 
3478
        __isl_give isl_multi_val *isl_multi_val_copy(
 
3479
                __isl_keep isl_multi_val *mv);
 
3480
        void *isl_multi_val_free(__isl_take isl_multi_val *mv);
 
3481
 
 
3482
They can be inspected using
 
3483
 
 
3484
        #include <isl/val.h>
 
3485
        isl_ctx *isl_multi_val_get_ctx(
 
3486
                __isl_keep isl_multi_val *mv);
 
3487
        unsigned isl_multi_val_dim(__isl_keep isl_multi_val *mv,
 
3488
                enum isl_dim_type type);
 
3489
        __isl_give isl_val *isl_multi_val_get_val(
 
3490
                __isl_keep isl_multi_val *mv, int pos);
 
3491
        const char *isl_multi_val_get_tuple_name(
 
3492
                __isl_keep isl_multi_val *mv,
 
3493
                enum isl_dim_type type);
 
3494
 
 
3495
They can be modified using
 
3496
 
 
3497
        #include <isl/val.h>
 
3498
        __isl_give isl_multi_val *isl_multi_val_set_val(
 
3499
                __isl_take isl_multi_val *mv, int pos,
 
3500
                __isl_take isl_val *val);
 
3501
        __isl_give isl_multi_val *isl_multi_val_set_dim_name(
 
3502
                __isl_take isl_multi_val *mv,
 
3503
                enum isl_dim_type type, unsigned pos, const char *s);
 
3504
        __isl_give isl_multi_val *isl_multi_val_set_tuple_name(
 
3505
                __isl_take isl_multi_val *mv,
 
3506
                enum isl_dim_type type, const char *s);
 
3507
        __isl_give isl_multi_val *isl_multi_val_set_tuple_id(
 
3508
                __isl_take isl_multi_val *mv,
 
3509
                enum isl_dim_type type, __isl_take isl_id *id);
 
3510
 
 
3511
        __isl_give isl_multi_val *isl_multi_val_insert_dims(
 
3512
                __isl_take isl_multi_val *mv,
 
3513
                enum isl_dim_type type, unsigned first, unsigned n);
 
3514
        __isl_give isl_multi_val *isl_multi_val_add_dims(
 
3515
                __isl_take isl_multi_val *mv,
 
3516
                enum isl_dim_type type, unsigned n);
 
3517
        __isl_give isl_multi_val *isl_multi_val_drop_dims(
 
3518
                __isl_take isl_multi_val *mv,
 
3519
                enum isl_dim_type type, unsigned first, unsigned n);
 
3520
 
 
3521
Operations include
 
3522
 
 
3523
        #include <isl/val.h>
 
3524
        __isl_give isl_multi_val *isl_multi_val_align_params(
 
3525
                __isl_take isl_multi_val *mv,
 
3526
                __isl_take isl_space *model);
 
3527
        __isl_give isl_multi_val *isl_multi_val_range_splice(
 
3528
                __isl_take isl_multi_val *mv1, unsigned pos,
 
3529
                __isl_take isl_multi_val *mv2);
 
3530
        __isl_give isl_multi_val *isl_multi_val_range_product(
 
3531
                __isl_take isl_multi_val *mv1,
 
3532
                __isl_take isl_multi_val *mv2);
 
3533
        __isl_give isl_multi_val *isl_multi_val_flat_range_product(
 
3534
                __isl_take isl_multi_val *mv1,
 
3535
                __isl_take isl_multi_aff *mv2);
 
3536
        __isl_give isl_multi_val *isl_multi_val_add_val(
 
3537
                __isl_take isl_multi_val *mv,
 
3538
                __isl_take isl_val *v);
 
3539
        __isl_give isl_multi_val *isl_multi_val_mod_val(
 
3540
                __isl_take isl_multi_val *mv,
 
3541
                __isl_take isl_val *v);
 
3542
        __isl_give isl_multi_val *isl_multi_val_scale_val(
 
3543
                __isl_take isl_multi_val *mv,
 
3544
                __isl_take isl_val *v);
 
3545
        __isl_give isl_multi_val *isl_multi_val_scale_multi_val(
 
3546
                __isl_take isl_multi_val *mv1,
 
3547
                __isl_take isl_multi_val *mv2);
 
3548
 
3120
3549
=head2 Vectors
3121
3550
 
3122
3551
Vectors can be created, copied and freed using the following functions.
3134
3563
        int isl_vec_size(__isl_keep isl_vec *vec);
3135
3564
        int isl_vec_get_element(__isl_keep isl_vec *vec,
3136
3565
                int pos, isl_int *v);
 
3566
        __isl_give isl_val *isl_vec_get_element_val(
 
3567
                __isl_keep isl_vec *vec, int pos);
3137
3568
        __isl_give isl_vec *isl_vec_set_element(
3138
3569
                __isl_take isl_vec *vec, int pos, isl_int v);
3139
3570
        __isl_give isl_vec *isl_vec_set_element_si(
3140
3571
                __isl_take isl_vec *vec, int pos, int v);
 
3572
        __isl_give isl_vec *isl_vec_set_element_val(
 
3573
                __isl_take isl_vec *vec, int pos,
 
3574
                __isl_take isl_val *v);
3141
3575
        __isl_give isl_vec *isl_vec_set(__isl_take isl_vec *vec,
3142
3576
                isl_int v);
3143
3577
        __isl_give isl_vec *isl_vec_set_si(__isl_take isl_vec *vec,
3144
3578
                int v);
 
3579
        __isl_give isl_vec *isl_vec_set_val(
 
3580
                __isl_take isl_vec *vec, __isl_take isl_val *v);
 
3581
        int isl_vec_cmp_element(__isl_keep isl_vec *vec1,
 
3582
                __isl_keep isl_vec *vec2, int pos);
3145
3583
        __isl_give isl_vec *isl_vec_fdiv_r(__isl_take isl_vec *vec,
3146
3584
                isl_int m);
3147
3585
 
3161
3599
        __isl_give isl_mat *isl_mat_alloc(isl_ctx *ctx,
3162
3600
                unsigned n_row, unsigned n_col);
3163
3601
        __isl_give isl_mat *isl_mat_copy(__isl_keep isl_mat *mat);
3164
 
        void isl_mat_free(__isl_take isl_mat *mat);
 
3602
        void *isl_mat_free(__isl_take isl_mat *mat);
3165
3603
 
3166
3604
Note that the elements of a newly created matrix may have arbitrary values.
3167
3605
The elements can be changed and inspected using the following functions.
3171
3609
        int isl_mat_cols(__isl_keep isl_mat *mat);
3172
3610
        int isl_mat_get_element(__isl_keep isl_mat *mat,
3173
3611
                int row, int col, isl_int *v);
 
3612
        __isl_give isl_val *isl_mat_get_element_val(
 
3613
                __isl_keep isl_mat *mat, int row, int col);
3174
3614
        __isl_give isl_mat *isl_mat_set_element(__isl_take isl_mat *mat,
3175
3615
                int row, int col, isl_int v);
3176
3616
        __isl_give isl_mat *isl_mat_set_element_si(__isl_take isl_mat *mat,
3177
3617
                int row, int col, int v);
 
3618
        __isl_give isl_mat *isl_mat_set_element_val(
 
3619
                __isl_take isl_mat *mat, int row, int col,
 
3620
                __isl_take isl_val *v);
3178
3621
 
3179
3622
C<isl_mat_get_element> will return a negative value if anything went wrong.
3180
3623
In that case, the value of C<*v> is undefined.
3290
3733
                enum isl_dim_type type);
3291
3734
        int isl_aff_get_constant(__isl_keep isl_aff *aff,
3292
3735
                isl_int *v);
 
3736
        __isl_give isl_val *isl_aff_get_constant_val(
 
3737
                __isl_keep isl_aff *aff);
3293
3738
        int isl_aff_get_coefficient(__isl_keep isl_aff *aff,
3294
3739
                enum isl_dim_type type, int pos, isl_int *v);
 
3740
        __isl_give isl_val *isl_aff_get_coefficient_val(
 
3741
                __isl_keep isl_aff *aff,
 
3742
                enum isl_dim_type type, int pos);
3295
3743
        int isl_aff_get_denominator(__isl_keep isl_aff *aff,
3296
3744
                isl_int *v);
 
3745
        __isl_give isl_val *isl_aff_get_denominator_val(
 
3746
                __isl_keep isl_aff *aff);
3297
3747
        __isl_give isl_aff *isl_aff_get_div(
3298
3748
                __isl_keep isl_aff *aff, int pos);
3299
3749
 
3336
3786
                __isl_take isl_aff *aff, isl_int v);
3337
3787
        __isl_give isl_aff *isl_aff_set_constant_si(
3338
3788
                __isl_take isl_aff *aff, int v);
 
3789
        __isl_give isl_aff *isl_aff_set_constant_val(
 
3790
                __isl_take isl_aff *aff, __isl_take isl_val *v);
3339
3791
        __isl_give isl_aff *isl_aff_set_coefficient(
3340
3792
                __isl_take isl_aff *aff,
3341
3793
                enum isl_dim_type type, int pos, isl_int v);
3342
3794
        __isl_give isl_aff *isl_aff_set_coefficient_si(
3343
3795
                __isl_take isl_aff *aff,
3344
3796
                enum isl_dim_type type, int pos, int v);
 
3797
        __isl_give isl_aff *isl_aff_set_coefficient_val(
 
3798
                __isl_take isl_aff *aff,
 
3799
                enum isl_dim_type type, int pos,
 
3800
                __isl_take isl_val *v);
3345
3801
        __isl_give isl_aff *isl_aff_set_denominator(
3346
3802
                __isl_take isl_aff *aff, isl_int v);
3347
3803
 
3349
3805
                __isl_take isl_aff *aff, isl_int v);
3350
3806
        __isl_give isl_aff *isl_aff_add_constant_si(
3351
3807
                __isl_take isl_aff *aff, int v);
 
3808
        __isl_give isl_aff *isl_aff_add_constant_val(
 
3809
                __isl_take isl_aff *aff, __isl_take isl_val *v);
3352
3810
        __isl_give isl_aff *isl_aff_add_constant_num(
3353
3811
                __isl_take isl_aff *aff, isl_int v);
3354
3812
        __isl_give isl_aff *isl_aff_add_constant_num_si(
3359
3817
        __isl_give isl_aff *isl_aff_add_coefficient_si(
3360
3818
                __isl_take isl_aff *aff,
3361
3819
                enum isl_dim_type type, int pos, int v);
 
3820
        __isl_give isl_aff *isl_aff_add_coefficient_val(
 
3821
                __isl_take isl_aff *aff,
 
3822
                enum isl_dim_type type, int pos,
 
3823
                __isl_take isl_val *v);
3362
3824
 
3363
3825
        __isl_give isl_aff *isl_aff_insert_dims(
3364
3826
                __isl_take isl_aff *aff,
3379
3841
                __isl_take isl_pw_aff *pwaff,
3380
3842
                enum isl_dim_type type, unsigned first, unsigned n);
3381
3843
 
3382
 
Note that the C<set_constant> and C<set_coefficient> functions
 
3844
Note that C<isl_aff_set_constant>, C<isl_aff_set_constant_si>,
 
3845
C<isl_aff_set_coefficient> and C<isl_aff_set_coefficient_si>
3383
3846
set the I<numerator> of the constant or coefficient, while
3384
 
C<add_constant> and C<add_coefficient> add an integer value to
 
3847
C<isl_aff_set_constant_val> and C<isl_aff_set_coefficient_val> set
 
3848
the constant or coefficient as a whole.
 
3849
The C<add_constant> and C<add_coefficient> functions add an integer
 
3850
or rational value to
3385
3851
the possibly rational constant or coefficient.
3386
3852
The C<add_constant_num> functions add an integer value to
3387
3853
the numerator.
3427
3893
                __isl_take isl_pw_aff *pwaff);
3428
3894
        __isl_give isl_aff *isl_aff_mod(__isl_take isl_aff *aff,
3429
3895
                isl_int mod);
 
3896
        __isl_give isl_aff *isl_aff_mod_val(__isl_take isl_aff *aff,
 
3897
                __isl_take isl_val *mod);
3430
3898
        __isl_give isl_pw_aff *isl_pw_aff_mod(
3431
3899
                __isl_take isl_pw_aff *pwaff, isl_int mod);
 
3900
        __isl_give isl_pw_aff *isl_pw_aff_mod_val(
 
3901
                __isl_take isl_pw_aff *pa,
 
3902
                __isl_take isl_val *mod);
3432
3903
        __isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff,
3433
3904
                isl_int f);
 
3905
        __isl_give isl_aff *isl_aff_scale_val(__isl_take isl_aff *aff,
 
3906
                __isl_take isl_val *v);
3434
3907
        __isl_give isl_pw_aff *isl_pw_aff_scale(
3435
3908
                __isl_take isl_pw_aff *pwaff, isl_int f);
 
3909
        __isl_give isl_pw_aff *isl_pw_aff_scale_val(
 
3910
                __isl_take isl_pw_aff *pa, __isl_take isl_val *v);
3436
3911
        __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff,
3437
3912
                isl_int f);
3438
3913
        __isl_give isl_aff *isl_aff_scale_down_ui(
3439
3914
                __isl_take isl_aff *aff, unsigned f);
 
3915
        __isl_give isl_aff *isl_aff_scale_down_val(
 
3916
                __isl_take isl_aff *aff, __isl_take isl_val *v);
3440
3917
        __isl_give isl_pw_aff *isl_pw_aff_scale_down(
3441
3918
                __isl_take isl_pw_aff *pwaff, isl_int f);
 
3919
        __isl_give isl_pw_aff *isl_pw_aff_scale_down_val(
 
3920
                __isl_take isl_pw_aff *pa,
 
3921
                __isl_take isl_val *f);
3442
3922
 
3443
3923
        __isl_give isl_pw_aff *isl_pw_aff_list_min(
3444
3924
                __isl_take isl_pw_aff_list *list);
3704
4184
A piecewise multiple quasi affine expression can also be initialized
3705
4185
from an C<isl_set> or C<isl_map>, provided the C<isl_set> is a singleton
3706
4186
and the C<isl_map> is single-valued.
 
4187
In case of a conversion from an C<isl_union_set> or an C<isl_union_map>
 
4188
to an C<isl_union_pw_multi_aff>, these properties need to hold in each space.
3707
4189
 
3708
4190
        __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_set(
3709
4191
                __isl_take isl_set *set);
3710
4192
        __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map(
3711
4193
                __isl_take isl_map *map);
3712
4194
 
 
4195
        __isl_give isl_union_pw_multi_aff *
 
4196
        isl_union_pw_multi_aff_from_union_set(
 
4197
                __isl_take isl_union_set *uset);
 
4198
        __isl_give isl_union_pw_multi_aff *
 
4199
        isl_union_pw_multi_aff_from_union_map(
 
4200
                __isl_take isl_union_map *umap);
 
4201
 
3713
4202
Multiple quasi affine expressions can be copied and freed using
3714
4203
 
3715
4204
        #include <isl/aff.h>
3872
4361
        __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_add(
3873
4362
                __isl_take isl_pw_multi_aff *pma1,
3874
4363
                __isl_take isl_pw_multi_aff *pma2);
 
4364
        __isl_give isl_multi_aff *isl_multi_aff_sub(
 
4365
                __isl_take isl_multi_aff *ma1,
 
4366
                __isl_take isl_multi_aff *ma2);
 
4367
        __isl_give isl_pw_multi_aff *isl_pw_multi_aff_sub(
 
4368
                __isl_take isl_pw_multi_aff *pma1,
 
4369
                __isl_take isl_pw_multi_aff *pma2);
 
4370
        __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_sub(
 
4371
                __isl_take isl_union_pw_multi_aff *upma1,
 
4372
                __isl_take isl_union_pw_multi_aff *upma2);
 
4373
 
 
4374
C<isl_multi_aff_sub> subtracts the second argument from the first.
 
4375
 
3875
4376
        __isl_give isl_multi_aff *isl_multi_aff_scale(
3876
4377
                __isl_take isl_multi_aff *maff,
3877
4378
                isl_int f);
 
4379
        __isl_give isl_multi_aff *isl_multi_aff_scale_val(
 
4380
                __isl_take isl_multi_aff *ma,
 
4381
                __isl_take isl_val *v);
 
4382
        __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_val(
 
4383
                __isl_take isl_pw_multi_aff *pma,
 
4384
                __isl_take isl_val *v);
 
4385
        __isl_give isl_multi_pw_aff *isl_multi_pw_aff_scale_val(
 
4386
                __isl_take isl_multi_pw_aff *mpa,
 
4387
                __isl_take isl_val *v);
 
4388
        __isl_give isl_multi_aff *isl_multi_aff_scale_multi_val(
 
4389
                __isl_take isl_multi_aff *ma,
 
4390
                __isl_take isl_multi_val *mv);
 
4391
        __isl_give isl_pw_multi_aff *
 
4392
        isl_pw_multi_aff_scale_multi_val(
 
4393
                __isl_take isl_pw_multi_aff *pma,
 
4394
                __isl_take isl_multi_val *mv);
 
4395
        __isl_give isl_multi_pw_aff *
 
4396
        isl_multi_pw_aff_scale_multi_val(
 
4397
                __isl_take isl_multi_pw_aff *mpa,
 
4398
                __isl_take isl_multi_val *mv);
 
4399
        __isl_give isl_union_pw_multi_aff *
 
4400
        isl_union_pw_multi_aff_scale_multi_val(
 
4401
                __isl_take isl_union_pw_multi_aff *upma,
 
4402
                __isl_take isl_multi_val *mv);
 
4403
 
 
4404
C<isl_multi_aff_scale_multi_val> scales the elements of C<ma>
 
4405
by the corresponding elements of C<mv>.
 
4406
 
3878
4407
        __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_params(
3879
4408
                __isl_take isl_pw_multi_aff *pma,
3880
4409
                __isl_take isl_set *set);
3881
4410
        __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_domain(
3882
4411
                __isl_take isl_pw_multi_aff *pma,
3883
4412
                __isl_take isl_set *set);
 
4413
        __isl_give isl_union_pw_multi_aff *
 
4414
        isl_union_pw_multi_aff_intersect_domain(
 
4415
                __isl_take isl_union_pw_multi_aff *upma,
 
4416
                __isl_take isl_union_set *uset);
3884
4417
        __isl_give isl_multi_aff *isl_multi_aff_lift(
3885
4418
                __isl_take isl_multi_aff *maff,
3886
4419
                __isl_give isl_local_space **ls);
3999
4532
                isl_ctx *ctx, const char *str);
4000
4533
        __isl_give isl_pw_multi_aff *isl_pw_multi_aff_read_from_str(
4001
4534
                isl_ctx *ctx, const char *str);
 
4535
        __isl_give isl_union_pw_multi_aff *
 
4536
        isl_union_pw_multi_aff_read_from_str(
 
4537
                isl_ctx *ctx, const char *str);
4002
4538
 
4003
4539
An expression can be printed using
4004
4540
 
4030
4566
 
4031
4567
        int isl_point_get_coordinate(__isl_keep isl_point *pnt,
4032
4568
                enum isl_dim_type type, int pos, isl_int *v);
 
4569
        __isl_give isl_val *isl_point_get_coordinate_val(
 
4570
                __isl_keep isl_point *pnt,
 
4571
                enum isl_dim_type type, int pos);
4033
4572
        __isl_give isl_point *isl_point_set_coordinate(
4034
4573
                __isl_take isl_point *pnt,
4035
4574
                enum isl_dim_type type, int pos, isl_int v);
 
4575
        __isl_give isl_point *isl_point_set_coordinate_val(
 
4576
                __isl_take isl_point *pnt,
 
4577
                enum isl_dim_type type, int pos,
 
4578
                __isl_take isl_val *v);
4036
4579
 
4037
4580
        __isl_give isl_point *isl_point_add_ui(
4038
4581
                __isl_take isl_point *pnt,
4186
4729
        __isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain(
4187
4730
                __isl_take isl_space *domain,
4188
4731
                const isl_int n, const isl_int d);
 
4732
        __isl_give isl_qpolynomial *isl_qpolynomial_val_on_domain(
 
4733
                __isl_take isl_space *domain,
 
4734
                __isl_take isl_val *val);
4189
4735
        __isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain(
4190
4736
                __isl_take isl_space *domain,
4191
4737
                enum isl_dim_type type, unsigned pos);
4280
4826
the dimensions of the sets may be different for different
4281
4827
invocations of C<fn>.
4282
4828
 
 
4829
The constant term of a quasipolynomial can be extracted using
 
4830
 
 
4831
        __isl_give isl_val *isl_qpolynomial_get_constant_val(
 
4832
                __isl_keep isl_qpolynomial *qp);
 
4833
 
4283
4834
To iterate over all terms in a quasipolynomial,
4284
4835
use
4285
4836
 
4297
4848
                isl_int *n);
4298
4849
        void isl_term_get_den(__isl_keep isl_term *term,
4299
4850
                isl_int *d);
 
4851
        __isl_give isl_val *isl_term_get_coefficient_val(
 
4852
                __isl_keep isl_term *term);
4300
4853
        int isl_term_get_exp(__isl_keep isl_term *term,
4301
4854
                enum isl_dim_type type, unsigned pos);
4302
4855
        __isl_give isl_aff *isl_term_get_div(
4333
4886
 
4334
4887
        __isl_give isl_qpolynomial *isl_qpolynomial_scale(
4335
4888
                __isl_take isl_qpolynomial *qp, isl_int v);
 
4889
        __isl_give isl_qpolynomial *isl_qpolynomial_scale_val(
 
4890
                __isl_take isl_qpolynomial *qp,
 
4891
                __isl_take isl_val *v);
4336
4892
        __isl_give isl_qpolynomial *isl_qpolynomial_neg(
4337
4893
                __isl_take isl_qpolynomial *qp);
4338
4894
        __isl_give isl_qpolynomial *isl_qpolynomial_add(
4347
4903
        __isl_give isl_qpolynomial *isl_qpolynomial_pow(
4348
4904
                __isl_take isl_qpolynomial *qp, unsigned exponent);
4349
4905
 
 
4906
        __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fix_val(
 
4907
                __isl_take isl_pw_qpolynomial *pwqp,
 
4908
                enum isl_dim_type type, unsigned n,
 
4909
                __isl_take isl_val *v);
 
4910
        __isl_give isl_pw_qpolynomial *
 
4911
        isl_pw_qpolynomial_scale_val(
 
4912
                __isl_take isl_pw_qpolynomial *pwqp,
 
4913
                __isl_take isl_val *v);
4350
4914
        __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add(
4351
4915
                __isl_take isl_pw_qpolynomial *pwqp1,
4352
4916
                __isl_take isl_pw_qpolynomial *pwqp2);
4364
4928
        __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_pow(
4365
4929
                __isl_take isl_pw_qpolynomial *pwqp, unsigned exponent);
4366
4930
 
 
4931
        __isl_give isl_union_pw_qpolynomial *
 
4932
        isl_union_pw_qpolynomial_scale_val(
 
4933
                __isl_take isl_union_pw_qpolynomial *upwqp,
 
4934
                __isl_take isl_val *v);
4367
4935
        __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add(
4368
4936
                __isl_take isl_union_pw_qpolynomial *upwqp1,
4369
4937
                __isl_take isl_union_pw_qpolynomial *upwqp2);
4569
5137
 
4570
5138
        __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale(
4571
5139
                __isl_take isl_qpolynomial_fold *fold, isl_int v);
 
5140
        __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale_val(
 
5141
                __isl_take isl_qpolynomial_fold *fold,
 
5142
                __isl_take isl_val *v);
 
5143
        __isl_give isl_pw_qpolynomial_fold *
 
5144
        isl_pw_qpolynomial_fold_scale_val(
 
5145
                __isl_take isl_pw_qpolynomial_fold *pwf,
 
5146
                __isl_take isl_val *v);
 
5147
        __isl_give isl_union_pw_qpolynomial_fold *
 
5148
        isl_union_pw_qpolynomial_fold_scale_val(
 
5149
                __isl_take isl_union_pw_qpolynomial_fold *upwf,
 
5150
                __isl_take isl_val *v);
4572
5151
 
4573
5152
        __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add(
4574
5153
                __isl_take isl_pw_qpolynomial_fold *pwf1,
5071
5650
        int isl_options_set_tile_scale_tile_loops(isl_ctx *ctx,
5072
5651
                int val);
5073
5652
        int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx);
 
5653
        int isl_options_set_tile_shift_point_loops(isl_ctx *ctx,
 
5654
                int val);
 
5655
        int isl_options_get_tile_shift_point_loops(isl_ctx *ctx);
5074
5656
 
5075
5657
The C<isl_band_tile> function tiles the band using the given tile sizes
5076
5658
inside its schedule.
5078
5660
inserted between the modified band and its children.
5079
5661
The C<tile_scale_tile_loops> option specifies whether the tile
5080
5662
loops iterators should be scaled by the tile sizes.
 
5663
If the C<tile_shift_point_loops> option is set, then the point loops
 
5664
are shifted to start at zero.
 
5665
 
 
5666
A band can be split into two nested bands using the following function.
 
5667
 
 
5668
        int isl_band_split(__isl_keep isl_band *band, int pos);
 
5669
 
 
5670
The resulting outer band contains the first C<pos> dimensions of C<band>
 
5671
while the inner band contains the remaining dimensions.
5081
5672
 
5082
5673
A representation of the band can be printed using
5083
5674
 
5449
6040
        #include <isl/ast.h>
5450
6041
        int isl_ast_expr_get_int(__isl_keep isl_ast_expr *expr,
5451
6042
                isl_int *v);
 
6043
        __isl_give isl_val *isl_ast_expr_get_val(
 
6044
                __isl_keep isl_ast_expr *expr);
5452
6045
 
5453
6046
Return the integer represented by the AST expression.
5454
 
Note that the integer is returned through the C<v> argument.
5455
 
The return value of the function itself indicates whether the
 
6047
Note that the integer is returned by C<isl_ast_expr_get_int>
 
6048
through the C<v> argument.
 
6049
The return value of this function itself indicates whether the
5456
6050
operation was performed successfully.
5457
6051
 
5458
6052
=head3 Manipulating and printing the AST
5475
6069
the context of an C<isl_ast_build>.
5476
6070
 
5477
6071
        #include <isl/ast.h>
 
6072
        __isl_give isl_ast_expr *isl_ast_expr_from_val(
 
6073
                __isl_take isl_val *v);
5478
6074
        __isl_give isl_ast_expr *isl_ast_expr_from_id(
5479
6075
                __isl_take isl_id *id);
5480
6076
        __isl_give isl_ast_expr *isl_ast_expr_neg(
5642
6238
        int isl_options_set_ast_build_allow_else(isl_ctx *ctx,
5643
6239
                int val);
5644
6240
        int isl_options_get_ast_build_allow_else(isl_ctx *ctx);
 
6241
        int isl_options_set_ast_build_allow_or(isl_ctx *ctx,
 
6242
                int val);
 
6243
        int isl_options_get_ast_build_allow_or(isl_ctx *ctx);
5645
6244
 
5646
6245
=over
5647
6246
 
5740
6339
This option specifies whether the AST generator is allowed
5741
6340
to construct if statements with else branches.
5742
6341
 
 
6342
=item * ast_build_allow_or
 
6343
 
 
6344
This option specifies whether the AST generator is allowed
 
6345
to construct if conditions with disjunctions.
 
6346
 
5743
6347
=back
5744
6348
 
5745
6349
=head3 Fine-grained Control over AST Generation