-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSet.h
More file actions
772 lines (654 loc) · 17 KB
/
Set.h
File metadata and controls
772 lines (654 loc) · 17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
#ifndef ISL_CXX_Set_H
#define ISL_CXX_Set_H
#include "isl/set.h"
#include "isl/Bool.h"
#include "isl/Ctx.h"
#include "isl/DimType.h"
#include "isl/Format.h"
#include "isl/IslException.h"
#include "isl/Stat.h"
#include "isl/UnionSet.h"
#include "isl/point.h"
#include "isl/set.h"
#include <string>
#include "isl/IslFnPtr.h"
namespace isl {
class BasicSet;
class Constraint;
class Id;
class Map;
class MultiAff;
class MultiPwAff;
class Point;
class PwAff;
class PwMultiAff;
class PwQpolynomialFold;
class Space;
class Val;
class Set {
protected:
Ctx ctx;
void * This;
public:
explicit Set(Ctx ctx, isl_set *That) : ctx(ctx), This(That) {}
Set() : ctx(Ctx(nullptr)), This(nullptr) {}
const Ctx &Context() const { return ctx; }
__isl_give isl_set *GetCopy() const;
/// \brief Release ownership of the wrapped object.
///
/// You are on your own now buddy.
/// The wrapper cannot be used anymore after calling Give()
///
/// \returns the wrapped isl object.
__isl_give isl_set *Give();
/// \brief unwrap the stored isl object.
/// \return a the wrapped isl object.
__isl_give isl_set *Get() const;
/// \brief Constructor for isl_set_from_union_set
///
/// \param uset
static Set fromUnionSet(const UnionSet &uset);
/// \brief Constructor for isl_set_from_pw_aff
///
/// \param pwaff
static Set fromPwAff(const PwAff &pwaff);
/// \brief Constructor for isl_set_read_from_str
///
/// \param ctx
/// \param str
static Set readFromStr(const Ctx &ctx, std::string str);
/// \brief Constructor for isl_set_from_basic_set
///
/// \param bset
static Set fromBasicSet(const BasicSet &bset);
/// \brief Constructor for isl_set_from_point
///
/// \param pnt
static Set fromPoint(const Point &pnt);
/// \brief Constructor for isl_set_box_from_points
///
/// \param pnt1
/// \param pnt2
static Set boxFromPoints(const Point &pnt1, const Point &pnt2);
public:
virtual ~Set();
/// \brief Generated from ::<isl_set_add_constraint>
///
/// \param [in] constraint
///
/// \returns A new Set
Set addConstraint(const Constraint &constraint) const;
/// \brief Generated from ::<isl_set_add_dims>
///
/// \param [in] type
/// \param [in] n
///
/// \returns A new Set
Set addDims(DimType type, unsigned int n) const;
/// \brief Generated from ::<isl_set_affine_hull>
///
///
/// \returns A new BasicSet
BasicSet affineHull() const;
/// \brief Generated from ::<isl_set_align_divs>
///
///
/// \returns A new Set
Set alignDivs() const;
/// \brief Generated from ::<isl_set_align_params>
///
/// \param [in] model
///
/// \returns A new Set
Set alignParams(const Space &model) const;
/// \brief Generated from ::<isl_set_apply>
///
/// \param [in] map
///
/// \returns A new Set
Set apply(const Map &map) const;
/// \brief Generated from ::<isl_set_apply_pw_qpolynomial_fold>
///
/// \param [in] pwf
/// \param [in] tight
///
/// \returns A new PwQpolynomialFold
PwQpolynomialFold applyPwQpolynomialFold(const PwQpolynomialFold &pwf, int * tight) const;
/// \brief Generated from ::<isl_set_coalesce>
///
///
/// \returns A new Set
Set coalesce() const;
/// \brief Generated from ::<isl_set_coefficients>
///
///
/// \returns A new BasicSet
BasicSet coefficients() const;
/// \brief Generated from ::<isl_set_complement>
///
///
/// \returns A new Set
Set complement() const;
/// \brief Generated from ::<isl_set_compute_divs>
///
///
/// \returns A new Set
Set computeDivs() const;
/// \brief Generated from ::<isl_set_convex_hull>
///
///
/// \returns A new BasicSet
BasicSet convexHull() const;
/// \brief Generated from ::<isl_set_count_val>
///
///
/// \returns A new Val
Val countVal() const;
/// \brief Generated from ::<isl_set_detect_equalities>
///
///
/// \returns A new Set
Set detectEqualities() const;
/// \brief Generated from ::<isl_set_dim>
///
/// \param [in] type
///
/// \returns A new unsigned int
unsigned int dim(DimType type) const;
/// \brief Generated from ::<isl_set_dim_has_any_lower_bound>
///
/// \param [in] type
/// \param [in] pos
///
/// \returns A new Bool
Bool dimHasAnyLowerBound(DimType type, unsigned int pos) const;
/// \brief Generated from ::<isl_set_dim_has_any_upper_bound>
///
/// \param [in] type
/// \param [in] pos
///
/// \returns A new Bool
Bool dimHasAnyUpperBound(DimType type, unsigned int pos) const;
/// \brief Generated from ::<isl_set_dim_has_lower_bound>
///
/// \param [in] type
/// \param [in] pos
///
/// \returns A new Bool
Bool dimHasLowerBound(DimType type, unsigned int pos) const;
/// \brief Generated from ::<isl_set_dim_has_upper_bound>
///
/// \param [in] type
/// \param [in] pos
///
/// \returns A new Bool
Bool dimHasUpperBound(DimType type, unsigned int pos) const;
/// \brief Generated from ::<isl_set_dim_is_bounded>
///
/// \param [in] type
/// \param [in] pos
///
/// \returns A new int
int dimIsBounded(DimType type, unsigned int pos) const;
/// \brief Generated from ::<isl_set_dim_max>
///
/// \param [in] pos
///
/// \returns A new PwAff
PwAff dimMax(int pos) const;
/// \brief Generated from ::<isl_set_dim_min>
///
/// \param [in] pos
///
/// \returns A new PwAff
PwAff dimMin(int pos) const;
/// \brief Generated from ::<isl_set_drop_constraints_involving_dims>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new Set
Set dropConstraintsInvolvingDims(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_set_dump>
///
///
/// \returns A new void
void dump() const;
/// \brief Generated from ::<isl_set_flat_product>
///
/// \param [in] set2
///
/// \returns A new Set
Set flatProduct(const Set &set2) const;
/// \brief Generated from ::<isl_set_flatten>
///
///
/// \returns A new Set
Set flatten() const;
/// \brief Generated from ::<isl_set_flatten_map>
///
///
/// \returns A new Map
Map flattenMap() const;
/// \brief Generated from ::<isl_set_foreach_basic_set>
///
/// \param [in] fn
/// \param [in] user
///
/// \returns A new Stat
Stat foreachBasicSet(const std::function<isl_stat(isl_basic_set *, void *)> && fn, void * user) const;
/// \brief Generated from ::<isl_set_foreach_point>
///
/// \param [in] fn
/// \param [in] user
///
/// \returns A new Stat
Stat foreachPoint(const std::function<isl_stat(isl_point *, void *)> && fn, void * user) const;
/// \brief Generated from ::<isl_set_get_dim_id>
///
/// \param [in] type
/// \param [in] pos
///
/// \returns A new Id
Id getDimId(DimType type, unsigned int pos) const;
/// \brief Generated from ::<isl_set_get_dim_name>
///
/// \param [in] type
/// \param [in] pos
///
/// \returns A new std::string
std::string getDimName(DimType type, unsigned int pos) const;
/// \brief Generated from ::<isl_set_get_space>
///
///
/// \returns A new Space
Space getSpace() const;
/// \brief Generated from ::<isl_set_get_tuple_id>
///
///
/// \returns A new Id
Id getTupleId() const;
/// \brief Generated from ::<isl_set_get_tuple_name>
///
///
/// \returns A new std::string
std::string getTupleName() const;
/// \brief Generated from ::<isl_set_gist>
///
/// \param [in] context
///
/// \returns A new Set
Set gist(const Set &context) const;
/// \brief Generated from ::<isl_set_gist_basic_set>
///
/// \param [in] context
///
/// \returns A new Set
Set gistBasicSet(const BasicSet &context) const;
/// \brief Generated from ::<isl_set_gist_params>
///
/// \param [in] context
///
/// \returns A new Set
Set gistParams(const Set &context) const;
/// \brief Generated from ::<isl_set_has_dim_id>
///
/// \param [in] type
/// \param [in] pos
///
/// \returns A new Bool
Bool hasDimId(DimType type, unsigned int pos) const;
/// \brief Generated from ::<isl_set_has_dim_name>
///
/// \param [in] type
/// \param [in] pos
///
/// \returns A new Bool
Bool hasDimName(DimType type, unsigned int pos) const;
/// \brief Generated from ::<isl_set_has_equal_space>
///
/// \param [in] set2
///
/// \returns A new int
int hasEqualSpace(const Set &set2) const;
/// \brief Generated from ::<isl_set_has_tuple_id>
///
///
/// \returns A new Bool
Bool hasTupleId() const;
/// \brief Generated from ::<isl_set_has_tuple_name>
///
///
/// \returns A new Bool
Bool hasTupleName() const;
/// \brief Generated from ::<isl_set_identity>
///
///
/// \returns A new Map
Map identity() const;
/// \brief Generated from ::<isl_set_indicator_function>
///
///
/// \returns A new PwAff
PwAff indicatorFunction() const;
/// \brief Generated from ::<isl_set_insert_dims>
///
/// \param [in] type
/// \param [in] pos
/// \param [in] n
///
/// \returns A new Set
Set insertDims(DimType type, unsigned int pos, unsigned int n) const;
/// \brief Generated from ::<isl_set_intersect>
///
/// \param [in] set2
///
/// \returns A new Set
Set intersect(const Set &set2) const;
/// \brief Generated from ::<isl_set_intersect_params>
///
/// \param [in] params
///
/// \returns A new Set
Set intersectParams(const Set ¶ms) const;
/// \brief Generated from ::<isl_set_involves_dims>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new Bool
Bool involvesDims(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_set_is_bounded>
///
///
/// \returns A new int
int isBounded() const;
/// \brief Generated from ::<isl_set_is_disjoint>
///
/// \param [in] set2
///
/// \returns A new Bool
Bool isDisjoint(const Set &set2) const;
/// \brief Generated from ::<isl_set_is_empty>
///
///
/// \returns A new Bool
Bool isEmpty() const;
/// \brief Generated from ::<isl_set_is_equal>
///
/// \param [in] set2
///
/// \returns A new Bool
Bool isEqual(const Set &set2) const;
/// \brief Generated from ::<isl_set_is_singleton>
///
///
/// \returns A new Bool
Bool isSingleton() const;
/// \brief Generated from ::<isl_set_is_strict_subset>
///
/// \param [in] set2
///
/// \returns A new Bool
Bool isStrictSubset(const Set &set2) const;
/// \brief Generated from ::<isl_set_is_subset>
///
/// \param [in] set2
///
/// \returns A new Bool
Bool isSubset(const Set &set2) const;
/// \brief Generated from ::<isl_set_is_wrapping>
///
///
/// \returns A new Bool
Bool isWrapping() const;
/// \brief Generated from ::<isl_set_lex_ge_set>
///
/// \param [in] set2
///
/// \returns A new Map
Map lexGeSet(const Set &set2) const;
/// \brief Generated from ::<isl_set_lex_gt_set>
///
/// \param [in] set2
///
/// \returns A new Map
Map lexGtSet(const Set &set2) const;
/// \brief Generated from ::<isl_set_lex_le_set>
///
/// \param [in] set2
///
/// \returns A new Map
Map lexLeSet(const Set &set2) const;
/// \brief Generated from ::<isl_set_lex_lt_set>
///
/// \param [in] set2
///
/// \returns A new Map
Map lexLtSet(const Set &set2) const;
/// \brief Generated from ::<isl_set_lexmax>
///
///
/// \returns A new Set
Set lexmax() const;
/// \brief Generated from ::<isl_set_lexmax_pw_multi_aff>
///
///
/// \returns A new PwMultiAff
PwMultiAff lexmaxPwMultiAff() const;
/// \brief Generated from ::<isl_set_lexmin>
///
///
/// \returns A new Set
Set lexmin() const;
/// \brief Generated from ::<isl_set_lexmin_pw_multi_aff>
///
///
/// \returns A new PwMultiAff
PwMultiAff lexminPwMultiAff() const;
/// \brief Generated from ::<isl_set_lift>
///
///
/// \returns A new Set
Set lift() const;
/// \brief Generated from ::<isl_set_lifting>
///
///
/// \returns A new Map
Map lifting() const;
/// \brief Generated from ::<isl_set_make_disjoint>
///
///
/// \returns A new Set
Set makeDisjoint() const;
/// \brief Generated from ::<isl_set_move_dims>
///
/// \param [in] dst_type
/// \param [in] dst_pos
/// \param [in] src_type
/// \param [in] src_pos
/// \param [in] n
///
/// \returns A new Set
Set moveDims(DimType dst_type, unsigned int dst_pos, DimType src_type, unsigned int src_pos, unsigned int n) const;
/// \brief Generated from ::<isl_set_n_basic_set>
///
///
/// \returns A new int
int nBasicSet() const;
/// \brief Generated from ::<isl_set_neg>
///
///
/// \returns A new Set
Set neg() const;
/// \brief Generated from ::<isl_set_polyhedral_hull>
///
///
/// \returns A new BasicSet
BasicSet polyhedralHull() const;
/// \brief Generated from ::<isl_set_preimage_multi_aff>
///
/// \param [in] ma
///
/// \returns A new Set
Set preimageMultiAff(const MultiAff &ma) const;
/// \brief Generated from ::<isl_set_preimage_multi_pw_aff>
///
/// \param [in] mpa
///
/// \returns A new Set
Set preimageMultiPwAff(const MultiPwAff &mpa) const;
/// \brief Generated from ::<isl_set_preimage_pw_multi_aff>
///
/// \param [in] pma
///
/// \returns A new Set
Set preimagePwMultiAff(const PwMultiAff &pma) const;
/// \brief Generated from ::<isl_set_product>
///
/// \param [in] set2
///
/// \returns A new Set
Set product(const Set &set2) const;
/// \brief Generated from ::<isl_set_project_out>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new Set
Set projectOut(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_set_recession_cone>
///
///
/// \returns A new Set
Set recessionCone() const;
/// \brief Generated from ::<isl_set_remove_dims>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new Set
Set removeDims(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_set_remove_divs>
///
///
/// \returns A new Set
Set removeDivs() const;
/// \brief Generated from ::<isl_set_remove_divs_involving_dims>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new Set
Set removeDivsInvolvingDims(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_set_remove_unknown_divs>
///
///
/// \returns A new Set
Set removeUnknownDivs() const;
/// \brief Generated from ::<isl_set_reset_tuple_id>
///
///
/// \returns A new Set
Set resetTupleId() const;
/// \brief Generated from ::<isl_set_sample>
///
///
/// \returns A new BasicSet
BasicSet sample() const;
/// \brief Generated from ::<isl_set_sample_point>
///
///
/// \returns A new Point
Point samplePoint() const;
/// \brief Generated from ::<isl_set_set_dim_id>
///
/// \param [in] type
/// \param [in] pos
/// \param [in] id
///
/// \returns A new Set
Set setDimId(DimType type, unsigned int pos, const Id &id) const;
/// \brief Generated from ::<isl_set_set_tuple_id>
///
/// \param [in] id
///
/// \returns A new Set
Set setTupleId(const Id &id) const;
/// \brief Generated from ::<isl_set_simple_hull>
///
///
/// \returns A new BasicSet
BasicSet simpleHull() const;
/// \brief Generated from ::<isl_set_size>
///
///
/// \returns A new int
int size() const;
/// \brief Generated from ::<isl_set_solutions>
///
///
/// \returns A new BasicSet
BasicSet solutions() const;
/// \brief Generated from ::<isl_set_split_dims>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new Set
Set splitDims(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_set_subtract>
///
/// \param [in] set2
///
/// \returns A new Set
Set subtract(const Set &set2) const;
/// \brief Generated from ::<isl_set_sum>
///
/// \param [in] set2
///
/// \returns A new Set
Set sum(const Set &set2) const;
/// \brief Generated from ::<isl_set_to_str>
///
///
/// \returns A new std::string
std::string toStr() const;
/// \brief Generated from ::<isl_set_union>
///
/// \param [in] set2
///
/// \returns A new Set
Set union_(const Set &set2) const;
/// \brief Generated from ::<isl_set_unshifted_simple_hull>
///
///
/// \returns A new BasicSet
BasicSet unshiftedSimpleHull() const;
/// \brief Generated from ::<isl_set_unwrap>
///
///
/// \returns A new Map
Map unwrap() const;
Set(const Set &Other) : ctx(Other.Context()), This(Other.GetCopy()) {}
Set &operator=(const Set &Other);
Set (Set && Other) : ctx(Other.Context()), This(Other.Give()) {}
Set &operator=(Set && Other) {
isl_set *New = Other.Give();
isl_set_free((isl_set *)This);
This = New;
ctx = Other.Context();
return *this;
}
/// \brief Implement lt via pointer comparison of the
/// wrapped isl objects.
bool operator<(const Set &RHS) const { return This < RHS.This; }
};
} // namespace isl
#endif //ISL_CXX_Set_H