islpy 2025.2.2__cp310-cp310-macosx_11_0_arm64.whl → 2025.2.4__cp310-cp310-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
islpy/__init__.py
CHANGED
@@ -135,6 +135,7 @@ Alignable: TypeAlias = (
|
|
135
135
|
| Aff | PwAff
|
136
136
|
)
|
137
137
|
AlignableT = TypeVar("AlignableT", bound=Alignable)
|
138
|
+
AlignableT2 = TypeVar("AlignableT2", bound=Alignable)
|
138
139
|
|
139
140
|
# }}}
|
140
141
|
|
@@ -151,11 +152,21 @@ def _get_default_context() -> Context:
|
|
151
152
|
|
152
153
|
def _set_dim_id(obj: AlignableT, dt: dim_type, idx: int, id: Id) -> AlignableT:
|
153
154
|
if isinstance(obj, BasicSet):
|
154
|
-
|
155
|
-
|
155
|
+
s = obj.to_set().set_dim_id(dt, idx, id)
|
156
|
+
basicsets = s.get_basic_sets()
|
157
|
+
if not basicsets:
|
158
|
+
result = BasicSet.empty(s.space)
|
159
|
+
else:
|
160
|
+
result, = basicsets
|
161
|
+
return cast("AlignableT", result)
|
156
162
|
elif isinstance(obj, BasicMap):
|
157
|
-
|
158
|
-
|
163
|
+
m = obj.to_map().set_dim_id(dt, idx, id)
|
164
|
+
basicmaps = m.get_basic_maps()
|
165
|
+
if not basicmaps:
|
166
|
+
result = BasicMap.empty(m.space)
|
167
|
+
else:
|
168
|
+
result, = basicmaps
|
169
|
+
return cast("AlignableT", result)
|
159
170
|
|
160
171
|
return cast("AlignableT", obj.set_dim_id(dt, idx, id))
|
161
172
|
|
@@ -304,8 +315,8 @@ def align_spaces(
|
|
304
315
|
|
305
316
|
def align_two(
|
306
317
|
obj1: AlignableT,
|
307
|
-
obj2:
|
308
|
-
) -> tuple[AlignableT,
|
318
|
+
obj2: AlignableT2,
|
319
|
+
) -> tuple[AlignableT, AlignableT2]:
|
309
320
|
"""Align the spaces of two objects, potentially modifying both of them.
|
310
321
|
|
311
322
|
See also :func:`align_spaces`.
|
islpy/_isl.pyi
CHANGED
@@ -5461,13 +5461,13 @@ class BasicSet:
|
|
5461
5461
|
|
5462
5462
|
__ne__ = islpy._monkeypatch.obj_ne
|
5463
5463
|
|
5464
|
-
__lt__ = islpy._monkeypatch.
|
5464
|
+
__lt__ = islpy._monkeypatch.set_lt
|
5465
5465
|
|
5466
|
-
__le__ = islpy._monkeypatch.
|
5466
|
+
__le__ = islpy._monkeypatch.set_le
|
5467
5467
|
|
5468
|
-
__gt__ = islpy._monkeypatch.
|
5468
|
+
__gt__ = islpy._monkeypatch.set_gt
|
5469
5469
|
|
5470
|
-
__ge__ = islpy._monkeypatch.
|
5470
|
+
__ge__ = islpy._monkeypatch.set_ge
|
5471
5471
|
|
5472
5472
|
project_out_except = islpy._monkeypatch.obj_project_out_except
|
5473
5473
|
|
@@ -5489,15 +5489,15 @@ class BasicSet:
|
|
5489
5489
|
|
5490
5490
|
__repr__ = islpy._monkeypatch.generic_repr
|
5491
5491
|
|
5492
|
-
|
5492
|
+
__and__ = islpy._monkeypatch.bset_and
|
5493
5493
|
|
5494
|
-
|
5494
|
+
__rand__ = islpy._monkeypatch.bset_and
|
5495
5495
|
|
5496
|
-
|
5496
|
+
__or__ = islpy._monkeypatch.set_or
|
5497
5497
|
|
5498
|
-
|
5498
|
+
__ror__ = islpy._monkeypatch.set_or
|
5499
5499
|
|
5500
|
-
__sub__ = islpy._monkeypatch.
|
5500
|
+
__sub__ = islpy._monkeypatch.set_sub
|
5501
5501
|
|
5502
5502
|
get_constraints = islpy._monkeypatch.basic_obj_get_constraints
|
5503
5503
|
|
@@ -6222,13 +6222,13 @@ class BasicMap:
|
|
6222
6222
|
|
6223
6223
|
__ne__ = islpy._monkeypatch.obj_ne
|
6224
6224
|
|
6225
|
-
__lt__ = islpy._monkeypatch.
|
6225
|
+
__lt__ = islpy._monkeypatch.map_lt
|
6226
6226
|
|
6227
|
-
__le__ = islpy._monkeypatch.
|
6227
|
+
__le__ = islpy._monkeypatch.map_le
|
6228
6228
|
|
6229
|
-
__gt__ = islpy._monkeypatch.
|
6229
|
+
__gt__ = islpy._monkeypatch.map_gt
|
6230
6230
|
|
6231
|
-
__ge__ = islpy._monkeypatch.
|
6231
|
+
__ge__ = islpy._monkeypatch.map_ge
|
6232
6232
|
|
6233
6233
|
project_out_except = islpy._monkeypatch.obj_project_out_except
|
6234
6234
|
|
@@ -6248,15 +6248,15 @@ class BasicMap:
|
|
6248
6248
|
|
6249
6249
|
__repr__ = islpy._monkeypatch.generic_repr
|
6250
6250
|
|
6251
|
-
|
6251
|
+
__and__ = islpy._monkeypatch.bmap_and
|
6252
6252
|
|
6253
|
-
|
6253
|
+
__rand__ = islpy._monkeypatch.bmap_and
|
6254
6254
|
|
6255
|
-
|
6255
|
+
__or__ = islpy._monkeypatch.map_or
|
6256
6256
|
|
6257
|
-
|
6257
|
+
__ror__ = islpy._monkeypatch.map_or
|
6258
6258
|
|
6259
|
-
__sub__ = islpy._monkeypatch.
|
6259
|
+
__sub__ = islpy._monkeypatch.map_sub
|
6260
6260
|
|
6261
6261
|
get_constraints = islpy._monkeypatch.basic_obj_get_constraints
|
6262
6262
|
|
@@ -6726,13 +6726,13 @@ class Set:
|
|
6726
6726
|
|
6727
6727
|
__ne__ = islpy._monkeypatch.obj_ne
|
6728
6728
|
|
6729
|
-
__lt__ = islpy._monkeypatch.
|
6729
|
+
__lt__ = islpy._monkeypatch.set_lt
|
6730
6730
|
|
6731
|
-
__le__ = islpy._monkeypatch.
|
6731
|
+
__le__ = islpy._monkeypatch.set_le
|
6732
6732
|
|
6733
|
-
__gt__ = islpy._monkeypatch.
|
6733
|
+
__gt__ = islpy._monkeypatch.set_gt
|
6734
6734
|
|
6735
|
-
__ge__ = islpy._monkeypatch.
|
6735
|
+
__ge__ = islpy._monkeypatch.set_ge
|
6736
6736
|
|
6737
6737
|
project_out_except = islpy._monkeypatch.obj_project_out_except
|
6738
6738
|
|
@@ -6754,15 +6754,15 @@ class Set:
|
|
6754
6754
|
|
6755
6755
|
__repr__ = islpy._monkeypatch.generic_repr
|
6756
6756
|
|
6757
|
-
|
6757
|
+
__and__ = islpy._monkeypatch.set_and
|
6758
6758
|
|
6759
|
-
|
6759
|
+
__rand__ = islpy._monkeypatch.set_and
|
6760
6760
|
|
6761
|
-
|
6761
|
+
__or__ = islpy._monkeypatch.set_or
|
6762
6762
|
|
6763
|
-
|
6763
|
+
__ror__ = islpy._monkeypatch.set_or
|
6764
6764
|
|
6765
|
-
__sub__ = islpy._monkeypatch.
|
6765
|
+
__sub__ = islpy._monkeypatch.set_sub
|
6766
6766
|
|
6767
6767
|
get_basic_sets = islpy._monkeypatch.set_get_basic_sets
|
6768
6768
|
|
@@ -7405,13 +7405,13 @@ class Map:
|
|
7405
7405
|
|
7406
7406
|
__ne__ = islpy._monkeypatch.obj_ne
|
7407
7407
|
|
7408
|
-
__lt__ = islpy._monkeypatch.
|
7408
|
+
__lt__ = islpy._monkeypatch.map_lt
|
7409
7409
|
|
7410
|
-
__le__ = islpy._monkeypatch.
|
7410
|
+
__le__ = islpy._monkeypatch.map_le
|
7411
7411
|
|
7412
|
-
__gt__ = islpy._monkeypatch.
|
7412
|
+
__gt__ = islpy._monkeypatch.map_gt
|
7413
7413
|
|
7414
|
-
__ge__ = islpy._monkeypatch.
|
7414
|
+
__ge__ = islpy._monkeypatch.map_ge
|
7415
7415
|
|
7416
7416
|
project_out_except = islpy._monkeypatch.obj_project_out_except
|
7417
7417
|
|
@@ -7431,15 +7431,15 @@ class Map:
|
|
7431
7431
|
|
7432
7432
|
__repr__ = islpy._monkeypatch.generic_repr
|
7433
7433
|
|
7434
|
-
|
7434
|
+
__and__ = islpy._monkeypatch.map_and
|
7435
7435
|
|
7436
|
-
|
7436
|
+
__rand__ = islpy._monkeypatch.map_and
|
7437
7437
|
|
7438
|
-
|
7438
|
+
__or__ = islpy._monkeypatch.map_or
|
7439
7439
|
|
7440
|
-
|
7440
|
+
__ror__ = islpy._monkeypatch.map_or
|
7441
7441
|
|
7442
|
-
__sub__ = islpy._monkeypatch.
|
7442
|
+
__sub__ = islpy._monkeypatch.map_sub
|
7443
7443
|
|
7444
7444
|
get_basic_maps = islpy._monkeypatch.map_get_basic_maps
|
7445
7445
|
|
islpy/_monkeypatch.py
CHANGED
@@ -5,7 +5,6 @@ from functools import update_wrapper
|
|
5
5
|
from sys import intern
|
6
6
|
from typing import (
|
7
7
|
TYPE_CHECKING,
|
8
|
-
Any,
|
9
8
|
ClassVar,
|
10
9
|
Concatenate,
|
11
10
|
Literal,
|
@@ -43,6 +42,10 @@ _CHECK_DIM_TYPES: tuple[_isl.dim_type, ...] = (
|
|
43
42
|
|
44
43
|
# {{{ typing helpers
|
45
44
|
|
45
|
+
T = TypeVar("T")
|
46
|
+
P = ParamSpec("P")
|
47
|
+
ResultT = TypeVar("ResultT")
|
48
|
+
|
46
49
|
SelfT = TypeVar("SelfT")
|
47
50
|
|
48
51
|
BasicT = TypeVar("BasicT", _isl.BasicSet, _isl.BasicMap)
|
@@ -54,36 +57,28 @@ ExprLikeT = TypeVar("ExprLikeT", _isl.Aff, _isl.PwAff,
|
|
54
57
|
_isl.QPolynomial, _isl.PwQPolynomial
|
55
58
|
)
|
56
59
|
SetLikeT = TypeVar("SetLikeT", bound=_isl.BasicSet | _isl.Set)
|
60
|
+
|
61
|
+
SetOrBasic: TypeAlias = _isl.BasicSet | _isl.Set
|
62
|
+
SetOrBasicT = TypeVar("SetOrBasicT", bound=SetOrBasic)
|
63
|
+
|
64
|
+
MapOrBasic: TypeAlias = _isl.BasicMap | _isl.Map
|
65
|
+
MapOrBasicT = TypeVar("MapOrBasicT", bound=MapOrBasic)
|
66
|
+
|
57
67
|
SetOrMap: TypeAlias = _isl.BasicSet | _isl.Set | _isl.BasicMap | _isl.Map
|
58
|
-
SetOrMapT = TypeVar("SetOrMapT",
|
68
|
+
SetOrMapT = TypeVar("SetOrMapT", _isl.BasicSet, _isl.Set, _isl.BasicMap, _isl.Map)
|
59
69
|
|
60
70
|
HasSpace: TypeAlias = (
|
61
71
|
_isl.Space
|
62
|
-
| _isl.Aff
|
63
|
-
| _isl.BasicMap
|
64
|
-
| _isl.BasicSet
|
65
72
|
| _isl.Constraint
|
66
73
|
| _isl.LocalSpace
|
67
|
-
| _isl.
|
74
|
+
| _isl.Aff
|
68
75
|
| _isl.MultiAff
|
69
|
-
| _isl.MultiId
|
70
|
-
| _isl.MultiPwAff
|
71
|
-
| _isl.MultiUnionPwAff
|
72
|
-
| _isl.MultiVal
|
73
|
-
| _isl.Point
|
74
76
|
| _isl.PwAff
|
75
77
|
| _isl.PwMultiAff
|
76
|
-
| _isl.
|
77
|
-
| _isl.
|
78
|
-
| _isl.QPolynomial
|
79
|
-
| _isl.QPolynomialFold
|
78
|
+
| _isl.BasicMap
|
79
|
+
| _isl.BasicSet
|
80
80
|
| _isl.Set
|
81
|
-
| _isl.
|
82
|
-
| _isl.UnionPwAff
|
83
|
-
| _isl.UnionPwMultiAff
|
84
|
-
| _isl.UnionPwQPolynomial
|
85
|
-
| _isl.UnionPwQPolynomialFold
|
86
|
-
| _isl.UnionSet
|
81
|
+
| _isl.Map
|
87
82
|
)
|
88
83
|
|
89
84
|
|
@@ -101,34 +96,30 @@ class IslObject(Protocol):
|
|
101
96
|
|
102
97
|
# {{{ copied verbatim from pytools to avoid numpy/pytools dependency
|
103
98
|
|
104
|
-
F = TypeVar("F", bound=Callable[..., Any])
|
105
|
-
|
106
|
-
|
107
99
|
class _HasKwargs:
|
108
100
|
pass
|
109
101
|
|
110
102
|
|
111
|
-
def _memoize_on_first_arg(
|
103
|
+
def _memoize_on_first_arg(
|
104
|
+
function: Callable[Concatenate[T, P], ResultT], *,
|
105
|
+
cache_dict_name: str | None = None) -> Callable[Concatenate[T, P], ResultT]:
|
112
106
|
"""Like :func:`memoize_method`, but for functions that take the object
|
113
107
|
in which do memoization information is stored as first argument.
|
114
108
|
|
115
109
|
Supports cache deletion via ``function_name.clear_cache(self)``.
|
116
110
|
"""
|
117
|
-
from sys import intern
|
118
111
|
|
119
112
|
if cache_dict_name is None:
|
120
113
|
cache_dict_name = intern(
|
121
114
|
f"_memoize_dic_{function.__module__}{function.__name__}"
|
122
115
|
)
|
123
116
|
|
124
|
-
def wrapper(obj, *args, **kwargs):
|
125
|
-
if kwargs
|
126
|
-
key = (_HasKwargs, frozenset(kwargs.items()), *args)
|
127
|
-
else:
|
128
|
-
key = args
|
117
|
+
def wrapper(obj: T, *args: P.args, **kwargs: P.kwargs) -> ResultT:
|
118
|
+
key = (_HasKwargs, frozenset(kwargs.items()), *args) if kwargs else args
|
129
119
|
|
120
|
+
assert cache_dict_name is not None
|
130
121
|
try:
|
131
|
-
return getattr(obj, cache_dict_name)[key]
|
122
|
+
return cast("ResultT", getattr(obj, cache_dict_name)[key])
|
132
123
|
except AttributeError:
|
133
124
|
attribute_error = True
|
134
125
|
except KeyError:
|
@@ -138,11 +129,10 @@ def _memoize_on_first_arg(function: F, cache_dict_name: str | None = None) -> F:
|
|
138
129
|
if attribute_error:
|
139
130
|
object.__setattr__(obj, cache_dict_name, {key: result})
|
140
131
|
return result
|
141
|
-
|
142
|
-
|
143
|
-
return result
|
132
|
+
getattr(obj, cache_dict_name)[key] = result
|
133
|
+
return result
|
144
134
|
|
145
|
-
def clear_cache(obj):
|
135
|
+
def clear_cache(obj: object):
|
146
136
|
object.__delattr__(obj, cache_dict_name)
|
147
137
|
|
148
138
|
from functools import update_wrapper
|
@@ -152,7 +142,8 @@ def _memoize_on_first_arg(function: F, cache_dict_name: str | None = None) -> F:
|
|
152
142
|
# into the function's dict is moderately sketchy.
|
153
143
|
new_wrapper.clear_cache = clear_cache # type: ignore[attr-defined]
|
154
144
|
|
155
|
-
return
|
145
|
+
return new_wrapper
|
146
|
+
|
156
147
|
|
157
148
|
# }}}
|
158
149
|
|
@@ -190,7 +181,7 @@ def context_ne(self: object, other: object) -> bool:
|
|
190
181
|
return not self.__eq__(other)
|
191
182
|
|
192
183
|
|
193
|
-
def generic_reduce(self:
|
184
|
+
def generic_reduce(self: HasSpace):
|
194
185
|
ctx = self.get_ctx()
|
195
186
|
prn = _isl.Printer.to_str(ctx)
|
196
187
|
prn = getattr(prn, f"print_{self._base_name}")(self)
|
@@ -331,21 +322,100 @@ def space_create_from_names(
|
|
331
322
|
return result
|
332
323
|
|
333
324
|
|
334
|
-
def
|
325
|
+
def set_or(
|
326
|
+
self: _isl.Set,
|
327
|
+
other: _isl.Set | _isl.BasicSet,
|
328
|
+
) -> _isl.Set:
|
329
|
+
try:
|
330
|
+
return self.union(other)
|
331
|
+
except TypeError:
|
332
|
+
return NotImplemented
|
333
|
+
|
334
|
+
|
335
|
+
def bset_and(
|
336
|
+
self: _isl.BasicSet,
|
337
|
+
other: SetOrBasicT,
|
338
|
+
) -> SetOrBasicT:
|
339
|
+
if isinstance(other, _isl.Set):
|
340
|
+
try:
|
341
|
+
return self.to_set().intersect(other)
|
342
|
+
except TypeError:
|
343
|
+
return NotImplemented
|
344
|
+
else:
|
345
|
+
try:
|
346
|
+
return self.intersect(other)
|
347
|
+
except TypeError:
|
348
|
+
return NotImplemented
|
349
|
+
|
350
|
+
|
351
|
+
def set_and(
|
352
|
+
self: _isl.Set,
|
353
|
+
other: _isl.Set | _isl.BasicSet,
|
354
|
+
) -> _isl.Set:
|
355
|
+
if isinstance(self, _isl.BasicSet):
|
356
|
+
self = self.to_set()
|
357
|
+
try:
|
358
|
+
return self.intersect(other)
|
359
|
+
except TypeError:
|
360
|
+
return NotImplemented
|
361
|
+
|
362
|
+
|
363
|
+
def set_sub(
|
364
|
+
self: _isl.Set | _isl.BasicSet,
|
365
|
+
other: _isl.Set | _isl.BasicSet,
|
366
|
+
) -> _isl.Set:
|
367
|
+
if isinstance(self, _isl.BasicSet):
|
368
|
+
self = self.to_set()
|
369
|
+
try:
|
370
|
+
return self.subtract(other)
|
371
|
+
except TypeError:
|
372
|
+
return NotImplemented
|
373
|
+
|
374
|
+
|
375
|
+
def map_or(
|
376
|
+
self: _isl.Map | _isl.BasicMap,
|
377
|
+
other: _isl.Map | _isl.BasicMap,
|
378
|
+
) -> _isl.Map:
|
379
|
+
if isinstance(self, _isl.BasicMap):
|
380
|
+
self = self.to_map()
|
335
381
|
try:
|
336
382
|
return self.union(other)
|
337
383
|
except TypeError:
|
338
384
|
return NotImplemented
|
339
385
|
|
340
386
|
|
341
|
-
def
|
387
|
+
def bmap_and(
|
388
|
+
self: _isl.BasicMap,
|
389
|
+
other: MapOrBasicT,
|
390
|
+
) -> MapOrBasicT:
|
391
|
+
if isinstance(other, _isl.Map):
|
392
|
+
try:
|
393
|
+
return self.to_map().intersect(other)
|
394
|
+
except TypeError:
|
395
|
+
return NotImplemented
|
396
|
+
else:
|
397
|
+
try:
|
398
|
+
return self.intersect(other)
|
399
|
+
except TypeError:
|
400
|
+
return NotImplemented
|
401
|
+
|
402
|
+
|
403
|
+
def map_and(
|
404
|
+
self: _isl.Map,
|
405
|
+
other: _isl.Map | _isl.BasicMap,
|
406
|
+
) -> _isl.Map:
|
342
407
|
try:
|
343
408
|
return self.intersect(other)
|
344
409
|
except TypeError:
|
345
410
|
return NotImplemented
|
346
411
|
|
347
412
|
|
348
|
-
def
|
413
|
+
def map_sub(
|
414
|
+
self: _isl.Map | _isl.BasicMap,
|
415
|
+
other: _isl.Map | _isl.BasicMap,
|
416
|
+
) -> _isl.Map:
|
417
|
+
if isinstance(self, _isl.BasicMap):
|
418
|
+
self = self.to_map()
|
349
419
|
try:
|
350
420
|
return self.subtract(other)
|
351
421
|
except TypeError:
|
@@ -538,13 +608,15 @@ def obj_get_var_dict(
|
|
538
608
|
def obj_get_var_ids(
|
539
609
|
self: HasSpace,
|
540
610
|
dimtype: _isl.dim_type
|
541
|
-
) -> Sequence[str]:
|
611
|
+
) -> Sequence[str | None]:
|
542
612
|
"""Return a list of :class:`Id` instances for :class:`dim_type` *dimtype*."""
|
543
|
-
return [
|
613
|
+
return [
|
614
|
+
self.get_dim_name(dimtype, i)
|
615
|
+
for i in range(self.dim(dimtype))]
|
544
616
|
|
545
617
|
|
546
618
|
@_memoize_on_first_arg
|
547
|
-
def obj_get_var_names(self: HasSpace, dimtype: _isl.dim_type) -> Sequence[str]:
|
619
|
+
def obj_get_var_names(self: HasSpace, dimtype: _isl.dim_type) -> Sequence[str | None]:
|
548
620
|
"""Return a list of dim names (in order) for :class:`dim_type` *dimtype*."""
|
549
621
|
return [self.get_dim_name(dimtype, i)
|
550
622
|
for i in range(self.dim(dimtype))]
|
@@ -585,7 +657,7 @@ def pw_get_aggregate_domain(self: _isl.PwAff | _isl.PwQPolynomial) -> _isl.Set:
|
|
585
657
|
|
586
658
|
result = _isl.Set.empty(self.get_domain_space())
|
587
659
|
for dom, _ in self.get_pieces():
|
588
|
-
result = result.union(
|
660
|
+
result = result.union(dom)
|
589
661
|
|
590
662
|
return result
|
591
663
|
|
@@ -657,7 +729,7 @@ def expr_like_add(self: ExprLikeT, other: ExprLikeT | int | _isl.Val) -> ExprLik
|
|
657
729
|
return NotImplemented
|
658
730
|
|
659
731
|
|
660
|
-
def expr_like_sub(self: ExprLikeT, other: ExprLikeT | int | _isl.Val):
|
732
|
+
def expr_like_sub(self: ExprLikeT, other: ExprLikeT | int | _isl.Val) -> ExprLikeT:
|
661
733
|
if not isinstance(other, ExprLike):
|
662
734
|
other = _number_to_expr_like(self, other)
|
663
735
|
|
@@ -727,29 +799,45 @@ for cls in ALL_CLASSES:
|
|
727
799
|
cls.__ne__ = obj_ne
|
728
800
|
|
729
801
|
|
730
|
-
def
|
802
|
+
def set_lt(self: _isl.BasicSet | _isl.Set, other: _isl.BasicSet | _isl.Set) -> bool:
|
731
803
|
return self.is_strict_subset(other)
|
732
804
|
|
733
805
|
|
734
|
-
def
|
806
|
+
def set_le(self: _isl.BasicSet | _isl.Set, other: _isl.BasicSet | _isl.Set) -> bool:
|
735
807
|
return self.is_subset(other)
|
736
808
|
|
737
809
|
|
738
|
-
def
|
810
|
+
def set_gt(self: _isl.BasicSet | _isl.Set, other: _isl.BasicSet | _isl.Set) -> bool:
|
739
811
|
return other.is_strict_subset(self)
|
740
812
|
|
741
813
|
|
742
|
-
def
|
814
|
+
def set_ge(self: _isl.BasicSet | _isl.Set, other: _isl.BasicSet | _isl.Set) -> bool:
|
815
|
+
return other.is_subset(self)
|
816
|
+
|
817
|
+
|
818
|
+
def map_lt(self: _isl.BasicMap | _isl.Map, other: _isl.BasicMap | _isl.Map) -> bool:
|
819
|
+
return self.is_strict_subset(other)
|
820
|
+
|
821
|
+
|
822
|
+
def map_le(self: _isl.BasicMap | _isl.Map, other: _isl.BasicMap | _isl.Map) -> bool:
|
823
|
+
return self.is_subset(other)
|
824
|
+
|
825
|
+
|
826
|
+
def map_gt(self: _isl.BasicMap | _isl.Map, other: _isl.BasicMap | _isl.Map) -> bool:
|
827
|
+
return other.is_strict_subset(self)
|
828
|
+
|
829
|
+
|
830
|
+
def map_ge(self: _isl.BasicMap | _isl.Map, other: _isl.BasicMap | _isl.Map) -> bool:
|
743
831
|
return other.is_subset(self)
|
744
832
|
|
745
833
|
|
746
834
|
# {{{ project_out_except
|
747
835
|
|
748
836
|
def obj_project_out_except(
|
749
|
-
obj:
|
837
|
+
obj: SetOrMapT,
|
750
838
|
names: Collection[str],
|
751
839
|
types: Collection[_isl.dim_type]
|
752
|
-
) ->
|
840
|
+
) -> SetOrMapT:
|
753
841
|
"""
|
754
842
|
:param types: list of :class:`dim_type` determining
|
755
843
|
the types of axes to project out
|
@@ -786,10 +874,10 @@ def obj_project_out_except(
|
|
786
874
|
# {{{ eliminate_except
|
787
875
|
|
788
876
|
def obj_eliminate_except(
|
789
|
-
obj:
|
877
|
+
obj: SetOrMapT,
|
790
878
|
names: Collection[str],
|
791
879
|
types: Collection[_isl.dim_type]
|
792
|
-
) ->
|
880
|
+
) -> SetOrMapT:
|
793
881
|
"""
|
794
882
|
:param types: list of :class:`dim_type` determining
|
795
883
|
the types of axes to eliminate
|
@@ -871,12 +959,23 @@ def _add_functionality() -> None:
|
|
871
959
|
|
872
960
|
# {{{ Python set-like behavior
|
873
961
|
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
cls.
|
962
|
+
_isl.BasicSet.__and__ = bset_and
|
963
|
+
_isl.BasicSet.__rand__ = bset_and
|
964
|
+
_isl.Set.__and__ = set_and
|
965
|
+
_isl.Set.__rand__ = set_and
|
966
|
+
for cls in [_isl.BasicSet, _isl.Set]:
|
967
|
+
cls.__or__ = set_or
|
968
|
+
cls.__ror__ = set_or
|
969
|
+
cls.__sub__ = set_sub
|
970
|
+
|
971
|
+
_isl.BasicMap.__and__ = bmap_and
|
972
|
+
_isl.BasicMap.__rand__ = bmap_and
|
973
|
+
_isl.Map.__and__ = map_and
|
974
|
+
_isl.Map.__rand__ = map_and
|
975
|
+
for cls in [_isl.BasicMap, _isl.Map]:
|
976
|
+
cls.__or__ = map_or
|
977
|
+
cls.__ror__ = map_or
|
978
|
+
cls.__sub__ = map_sub
|
880
979
|
|
881
980
|
# }}}
|
882
981
|
|
@@ -1005,11 +1104,17 @@ for cls in ALL_CLASSES:
|
|
1005
1104
|
|
1006
1105
|
# {{{ rich comparisons
|
1007
1106
|
|
1008
|
-
for cls in [_isl.BasicSet, _isl.
|
1009
|
-
cls.__lt__ =
|
1010
|
-
cls.__le__ =
|
1011
|
-
cls.__gt__ =
|
1012
|
-
cls.__ge__ =
|
1107
|
+
for cls in [_isl.BasicSet, _isl.Set]:
|
1108
|
+
cls.__lt__ = set_lt
|
1109
|
+
cls.__le__ = set_le
|
1110
|
+
cls.__gt__ = set_gt
|
1111
|
+
cls.__ge__ = set_ge
|
1112
|
+
|
1113
|
+
for cls in [_isl.BasicMap, _isl.Map]:
|
1114
|
+
cls.__lt__ = map_lt
|
1115
|
+
cls.__le__ = map_le
|
1116
|
+
cls.__gt__ = map_gt
|
1117
|
+
cls.__ge__ = map_ge
|
1013
1118
|
|
1014
1119
|
# }}}
|
1015
1120
|
|
@@ -1024,10 +1129,6 @@ for cls in ALL_CLASSES:
|
|
1024
1129
|
_add_functionality()
|
1025
1130
|
|
1026
1131
|
|
1027
|
-
P = ParamSpec("P")
|
1028
|
-
ResultT = TypeVar("ResultT")
|
1029
|
-
|
1030
|
-
|
1031
1132
|
_DOWNCAST_RE = re.compile(
|
1032
1133
|
r"Downcast from :class:`([A-Za-z]+)` to :class:`([A-Za-z]+)`.")
|
1033
1134
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
islpy/version.py,sha256=9KVEg7OX9uCaA6ElUMeiAh-zDrxsy3u2H6VQm_-LTUE,301
|
2
|
+
islpy/__init__.py,sha256=0AdPhWQMf1DUB5DDisLP39rN0djxueftEWqfX4_R5Hk,13363
|
3
|
+
islpy/_isl.cpython-310-darwin.so,sha256=CxYWZPD6WX_m9jbS3AEWLQoWnNxtbxos6UmUbgYIAsw,7910680
|
4
|
+
islpy/_isl.pyi,sha256=OI3MI4rqq4XZ3CTXTbmS__lClCMynkL9MxERZ-KgWLk,260125
|
5
|
+
islpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
islpy/_monkeypatch.py,sha256=80xulld5N-jIJbWLGBYSuPnO1CG1N-Z3jVgiNRkkJ9U,34216
|
7
|
+
islpy-2025.2.4.dist-info/RECORD,,
|
8
|
+
islpy-2025.2.4.dist-info/WHEEL,sha256=DQEqkN11DF-lVG0mTSUr80pmU3oSybmBAADfv3nLAsQ,141
|
9
|
+
islpy-2025.2.4.dist-info/METADATA,sha256=bCRATmwgpiAGBbVa21X7Cqg9fPZNkdFDnuXO4_80yn8,2966
|
islpy-2025.2.2.dist-info/RECORD
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
islpy/version.py,sha256=9KVEg7OX9uCaA6ElUMeiAh-zDrxsy3u2H6VQm_-LTUE,301
|
2
|
-
islpy/__init__.py,sha256=di9XuiCE0E17rYvJF2odx710bD4X07gsKGWDW6oSgH0,13021
|
3
|
-
islpy/_isl.cpython-310-darwin.so,sha256=CxYWZPD6WX_m9jbS3AEWLQoWnNxtbxos6UmUbgYIAsw,7910680
|
4
|
-
islpy/_isl.pyi,sha256=_QvIK3y21H8sud47dr3bBOfxkSONwZzxV1x09WIxtRQ,260121
|
5
|
-
islpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
islpy/_monkeypatch.py,sha256=J_EIwyHBinfCo_rBu1V9o1OzG9R3dE34lJ0XIMOJSQ4,31309
|
7
|
-
islpy-2025.2.2.dist-info/RECORD,,
|
8
|
-
islpy-2025.2.2.dist-info/WHEEL,sha256=DQEqkN11DF-lVG0mTSUr80pmU3oSybmBAADfv3nLAsQ,141
|
9
|
-
islpy-2025.2.2.dist-info/METADATA,sha256=Us2hmRlX7V2rNYGp3pg3ZEqYgbSbuzNYT7IIHd9dbT4,2966
|
File without changes
|