forked from simbuerg/isl-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBasicMap.h
715 lines (602 loc) · 17.1 KB
/
BasicMap.h
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
#ifndef ISL_CXX_BasicMap_H
#define ISL_CXX_BasicMap_H
#include "isl/map.h"
#include "isl/Bool.h"
#include "isl/Ctx.h"
#include "isl/DimType.h"
#include "isl/Format.h"
#include "isl/IslException.h"
#include "isl/Map.h"
#include "isl/Stat.h"
#include "isl/constraint.h"
#include <string>
#include "isl/IslFnPtr.h"
namespace isl {
class Aff;
class BasicSet;
class Constraint;
class Id;
class LocalSpace;
class Mat;
class MultiAff;
class PwMultiAff;
class Qpolynomial;
class Space;
class Val;
class BasicMap {
protected:
Ctx ctx;
void * This;
public:
explicit BasicMap(Ctx ctx, isl_basic_map *That) : ctx(ctx), This(That) {}
BasicMap() : ctx(Ctx(nullptr)), This(nullptr) {}
const Ctx &Context() const { return ctx; }
__isl_give isl_basic_map *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_basic_map *Give();
/// \brief unwrap the stored isl object.
/// \return a the wrapped isl object.
__isl_give isl_basic_map *Get() const;
/// \brief Constructor for isl_basic_map_less_at
///
/// \param dim
/// \param pos
static BasicMap lessAt(const Space &dim, unsigned int pos);
/// \brief Constructor for isl_basic_map_more_at
///
/// \param dim
/// \param pos
static BasicMap moreAt(const Space &dim, unsigned int pos);
/// \brief Constructor for isl_basic_map_empty
///
/// \param dim
static BasicMap empty(const Space &dim);
/// \brief Constructor for isl_basic_map_nat_universe
///
/// \param dim
static BasicMap natUniverse(const Space &dim);
/// \brief Constructor for isl_basic_map_from_basic_set
///
/// \param bset
/// \param dim
static BasicMap fromBasicSet(const BasicSet &bset, const Space &dim);
/// \brief Constructor for isl_basic_map_read_from_str
///
/// \param ctx
/// \param str
static BasicMap readFromStr(const Ctx &ctx, std::string str);
/// \brief Constructor for isl_basic_map_from_domain
///
/// \param bset
static BasicMap fromDomain(const BasicSet &bset);
/// \brief Constructor for isl_basic_map_from_range
///
/// \param bset
static BasicMap fromRange(const BasicSet &bset);
/// \brief Constructor for isl_basic_map_from_domain_and_range
///
/// \param domain
/// \param range
static BasicMap fromDomainAndRange(const BasicSet &domain, const BasicSet &range);
/// \brief Constructor for isl_basic_map_from_constraint_matrices
///
/// \param dim
/// \param eq
/// \param ineq
/// \param c1
/// \param c2
/// \param c3
/// \param c4
/// \param c5
static BasicMap fromConstraintMatrices(const Space &dim, const Mat &eq, const Mat &ineq, DimType c1, DimType c2, DimType c3, DimType c4, DimType c5);
/// \brief Constructor for isl_basic_map_from_aff
///
/// \param aff
static BasicMap fromAff(const Aff &aff);
/// \brief Constructor for isl_basic_map_from_multi_aff
///
/// \param maff
static BasicMap fromMultiAff(const MultiAff &maff);
/// \brief Constructor for isl_basic_map_from_constraint
///
/// \param constraint
static BasicMap fromConstraint(const Constraint &constraint);
/// \brief Constructor for isl_basic_map_from_qpolynomial
///
/// \param qp
static BasicMap fromQpolynomial(const Qpolynomial &qp);
public:
virtual ~BasicMap();
/// \brief Generated from ::<isl_basic_map_add_constraint>
///
/// \param [in] constraint
///
/// \returns A new BasicMap
BasicMap addConstraint(const Constraint &constraint) const;
/// \brief Generated from ::<isl_basic_map_add_dims>
///
/// \param [in] type
/// \param [in] n
///
/// \returns A new BasicMap
BasicMap addDims(DimType type, unsigned int n) const;
/// \brief Generated from ::<isl_basic_map_affine_hull>
///
///
/// \returns A new BasicMap
BasicMap affineHull() const;
/// \brief Generated from ::<isl_basic_map_align_params>
///
/// \param [in] model
///
/// \returns A new BasicMap
BasicMap alignParams(const Space &model) const;
/// \brief Generated from ::<isl_basic_map_apply_domain>
///
/// \param [in] bmap2
///
/// \returns A new BasicMap
BasicMap applyDomain(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_apply_range>
///
/// \param [in] bmap2
///
/// \returns A new BasicMap
BasicMap applyRange(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_can_curry>
///
///
/// \returns A new Bool
Bool canCurry() const;
/// \brief Generated from ::<isl_basic_map_can_uncurry>
///
///
/// \returns A new Bool
Bool canUncurry() const;
/// \brief Generated from ::<isl_basic_map_can_zip>
///
///
/// \returns A new Bool
Bool canZip() const;
/// \brief Generated from ::<isl_basic_map_compute_divs>
///
///
/// \returns A new Map
Map computeDivs() const;
/// \brief Generated from ::<isl_basic_map_curry>
///
///
/// \returns A new BasicMap
BasicMap curry() const;
/// \brief Generated from ::<isl_basic_map_deltas>
///
///
/// \returns A new BasicSet
BasicSet deltas() const;
/// \brief Generated from ::<isl_basic_map_deltas_map>
///
///
/// \returns A new BasicMap
BasicMap deltasMap() const;
/// \brief Generated from ::<isl_basic_map_detect_equalities>
///
///
/// \returns A new BasicMap
BasicMap detectEqualities() const;
/// \brief Generated from ::<isl_basic_map_dim>
///
/// \param [in] type
///
/// \returns A new unsigned int
unsigned int dim(DimType type) const;
/// \brief Generated from ::<isl_basic_map_domain>
///
///
/// \returns A new BasicSet
BasicSet domain() const;
/// \brief Generated from ::<isl_basic_map_domain_map>
///
///
/// \returns A new BasicMap
BasicMap domainMap() const;
/// \brief Generated from ::<isl_basic_map_domain_product>
///
/// \param [in] bmap2
///
/// \returns A new BasicMap
BasicMap domainProduct(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_drop_constraints_involving_dims>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new BasicMap
BasicMap dropConstraintsInvolvingDims(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_basic_map_eliminate>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new BasicMap
BasicMap eliminate(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_basic_map_equalities_matrix>
///
/// \param [in] c1
/// \param [in] c2
/// \param [in] c3
/// \param [in] c4
/// \param [in] c5
///
/// \returns A new Mat
Mat equalitiesMatrix(DimType c1, DimType c2, DimType c3, DimType c4, DimType c5) const;
/// \brief Generated from ::<isl_basic_map_equate>
///
/// \param [in] type1
/// \param [in] pos1
/// \param [in] type2
/// \param [in] pos2
///
/// \returns A new BasicMap
BasicMap equate(DimType type1, int pos1, DimType type2, int pos2) const;
/// \brief Generated from ::<isl_basic_map_fix_val>
///
/// \param [in] type
/// \param [in] pos
/// \param [in] v
///
/// \returns A new BasicMap
BasicMap fixVal(DimType type, unsigned int pos, const Val &v) const;
/// \brief Generated from ::<isl_basic_map_flat_product>
///
/// \param [in] bmap2
///
/// \returns A new BasicMap
BasicMap flatProduct(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_flat_range_product>
///
/// \param [in] bmap2
///
/// \returns A new BasicMap
BasicMap flatRangeProduct(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_flatten>
///
///
/// \returns A new BasicMap
BasicMap flatten() const;
/// \brief Generated from ::<isl_basic_map_flatten_domain>
///
///
/// \returns A new BasicMap
BasicMap flattenDomain() const;
/// \brief Generated from ::<isl_basic_map_flatten_range>
///
///
/// \returns A new BasicMap
BasicMap flattenRange() const;
/// \brief Generated from ::<isl_basic_map_foreach_constraint>
///
/// \param [in] fn
/// \param [in] user
///
/// \returns A new Stat
Stat foreachConstraint(const std::function<isl_stat(isl_constraint *, void *)> && fn, void * user) const;
/// \brief Generated from ::<isl_basic_map_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_basic_map_get_div>
///
/// \param [in] pos
///
/// \returns A new Aff
Aff getDiv(int pos) const;
/// \brief Generated from ::<isl_basic_map_get_local_space>
///
///
/// \returns A new LocalSpace
LocalSpace getLocalSpace() const;
/// \brief Generated from ::<isl_basic_map_get_space>
///
///
/// \returns A new Space
Space getSpace() const;
/// \brief Generated from ::<isl_basic_map_get_tuple_name>
///
/// \param [in] type
///
/// \returns A new std::string
std::string getTupleName(DimType type) const;
/// \brief Generated from ::<isl_basic_map_gist>
///
/// \param [in] context
///
/// \returns A new BasicMap
BasicMap gist(const BasicMap &context) const;
/// \brief Generated from ::<isl_basic_map_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_basic_map_inequalities_matrix>
///
/// \param [in] c1
/// \param [in] c2
/// \param [in] c3
/// \param [in] c4
/// \param [in] c5
///
/// \returns A new Mat
Mat inequalitiesMatrix(DimType c1, DimType c2, DimType c3, DimType c4, DimType c5) const;
/// \brief Generated from ::<isl_basic_map_insert_dims>
///
/// \param [in] type
/// \param [in] pos
/// \param [in] n
///
/// \returns A new BasicMap
BasicMap insertDims(DimType type, unsigned int pos, unsigned int n) const;
/// \brief Generated from ::<isl_basic_map_intersect>
///
/// \param [in] bmap2
///
/// \returns A new BasicMap
BasicMap intersect(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_intersect_domain>
///
/// \param [in] bset
///
/// \returns A new BasicMap
BasicMap intersectDomain(const BasicSet &bset) const;
/// \brief Generated from ::<isl_basic_map_intersect_range>
///
/// \param [in] bset
///
/// \returns A new BasicMap
BasicMap intersectRange(const BasicSet &bset) const;
/// \brief Generated from ::<isl_basic_map_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_basic_map_is_disjoint>
///
/// \param [in] bmap2
///
/// \returns A new Bool
Bool isDisjoint(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_is_empty>
///
///
/// \returns A new Bool
Bool isEmpty() const;
/// \brief Generated from ::<isl_basic_map_is_equal>
///
/// \param [in] bmap2
///
/// \returns A new Bool
Bool isEqual(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_is_rational>
///
///
/// \returns A new int
int isRational() const;
/// \brief Generated from ::<isl_basic_map_is_strict_subset>
///
/// \param [in] bmap2
///
/// \returns A new Bool
Bool isStrictSubset(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_is_subset>
///
/// \param [in] bmap2
///
/// \returns A new Bool
Bool isSubset(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_is_universe>
///
///
/// \returns A new Bool
Bool isUniverse() const;
/// \brief Generated from ::<isl_basic_map_lexmax>
///
///
/// \returns A new Map
Map lexmax() const;
/// \brief Generated from ::<isl_basic_map_lexmin>
///
///
/// \returns A new Map
Map lexmin() const;
/// \brief Generated from ::<isl_basic_map_lexmin_pw_multi_aff>
///
///
/// \returns A new PwMultiAff
PwMultiAff lexminPwMultiAff() const;
/// \brief Generated from ::<isl_basic_map_move_dims>
///
/// \param [in] dst_type
/// \param [in] dst_pos
/// \param [in] src_type
/// \param [in] src_pos
/// \param [in] n
///
/// \returns A new BasicMap
BasicMap moveDims(DimType dst_type, unsigned int dst_pos, DimType src_type, unsigned int src_pos, unsigned int n) const;
/// \brief Generated from ::<isl_basic_map_n_constraint>
///
///
/// \returns A new int
int nConstraint() const;
/// \brief Generated from ::<isl_basic_map_n_div>
///
///
/// \returns A new unsigned int
unsigned int nDiv() const;
/// \brief Generated from ::<isl_basic_map_n_in>
///
///
/// \returns A new unsigned int
unsigned int nIn() const;
/// \brief Generated from ::<isl_basic_map_n_out>
///
///
/// \returns A new unsigned int
unsigned int nOut() const;
/// \brief Generated from ::<isl_basic_map_n_param>
///
///
/// \returns A new unsigned int
unsigned int nParam() const;
/// \brief Generated from ::<isl_basic_map_order_ge>
///
/// \param [in] type1
/// \param [in] pos1
/// \param [in] type2
/// \param [in] pos2
///
/// \returns A new BasicMap
BasicMap orderGe(DimType type1, int pos1, DimType type2, int pos2) const;
/// \brief Generated from ::<isl_basic_map_order_gt>
///
/// \param [in] type1
/// \param [in] pos1
/// \param [in] type2
/// \param [in] pos2
///
/// \returns A new BasicMap
BasicMap orderGt(DimType type1, int pos1, DimType type2, int pos2) const;
/// \brief Generated from ::<isl_basic_map_product>
///
/// \param [in] bmap2
///
/// \returns A new BasicMap
BasicMap product(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_project_out>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new BasicMap
BasicMap projectOut(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_basic_map_range>
///
///
/// \returns A new BasicSet
BasicSet range() const;
/// \brief Generated from ::<isl_basic_map_range_map>
///
///
/// \returns A new BasicMap
BasicMap rangeMap() const;
/// \brief Generated from ::<isl_basic_map_range_product>
///
/// \param [in] bmap2
///
/// \returns A new BasicMap
BasicMap rangeProduct(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_remove_dims>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new BasicMap
BasicMap removeDims(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_basic_map_remove_divs>
///
///
/// \returns A new BasicMap
BasicMap removeDivs() const;
/// \brief Generated from ::<isl_basic_map_remove_divs_involving_dims>
///
/// \param [in] type
/// \param [in] first
/// \param [in] n
///
/// \returns A new BasicMap
BasicMap removeDivsInvolvingDims(DimType type, unsigned int first, unsigned int n) const;
/// \brief Generated from ::<isl_basic_map_reverse>
///
///
/// \returns A new BasicMap
BasicMap reverse() const;
/// \brief Generated from ::<isl_basic_map_sample>
///
///
/// \returns A new BasicMap
BasicMap sample() const;
/// \brief Generated from ::<isl_basic_map_set_dim_name>
///
/// \param [in] type
/// \param [in] pos
/// \param [in] s
///
/// \returns A new BasicMap
BasicMap setDimName(DimType type, unsigned int pos, std::string s) const;
/// \brief Generated from ::<isl_basic_map_set_tuple_id>
///
/// \param [in] type
/// \param [in] id
///
/// \returns A new BasicMap
BasicMap setTupleId(DimType type, const Id &id) const;
/// \brief Generated from ::<isl_basic_map_set_tuple_name>
///
/// \param [in] type
/// \param [in] s
///
/// \returns A new BasicMap
BasicMap setTupleName(DimType type, std::string s) const;
/// \brief Generated from ::<isl_basic_map_total_dim>
///
///
/// \returns A new unsigned int
unsigned int totalDim() const;
/// \brief Generated from ::<isl_basic_map_uncurry>
///
///
/// \returns A new BasicMap
BasicMap uncurry() const;
/// \brief Generated from ::<isl_basic_map_union>
///
/// \param [in] bmap2
///
/// \returns A new Map
Map union_(const BasicMap &bmap2) const;
/// \brief Generated from ::<isl_basic_map_wrap>
///
///
/// \returns A new BasicSet
BasicSet wrap() const;
BasicMap(const BasicMap &Other) : ctx(Other.Context()), This(Other.GetCopy()) {}
BasicMap &operator=(const BasicMap &Other);
BasicMap (BasicMap && Other) : ctx(Other.Context()), This(Other.Give()) {}
BasicMap &operator=(BasicMap && Other) {
isl_basic_map *New = Other.Give();
isl_basic_map_free((isl_basic_map *)This);
This = New;
ctx = Other.Context();
return *this;
}
/// \brief Implement lt via pointer comparison of the
/// wrapped isl objects.
bool operator<(const BasicMap &RHS) const { return This < RHS.This; }
};
} // namespace isl
#endif //ISL_CXX_BasicMap_H