@@ -860,6 +860,8 @@ class ConditionalDimension(DerivedDimension):
860860 If True, use `self`, rather than the parent Dimension, to
861861 index into arrays. A typical use case is when arrays are accessed
862862 indirectly via the ``condition`` expression.
863+ relation: Or/And, default=And
864+ How this ConditionalDimension will be combined with other ones.
863865
864866 Examples
865867 --------
@@ -913,10 +915,10 @@ class ConditionalDimension(DerivedDimension):
913915 is_Conditional = True
914916
915917 __rkwargs__ = DerivedDimension .__rkwargs__ + \
916- ('factor' , 'condition' , 'indirect' )
918+ ('factor' , 'condition' , 'indirect' , 'relation' )
917919
918920 def __init_finalize__ (self , name , parent = None , factor = None , condition = None ,
919- indirect = False , ** kwargs ):
921+ indirect = False , relation = sympy . And , ** kwargs ):
920922 # `parent=None` degenerates to a ConditionalDimension outside of
921923 # any iteration space
922924 if parent is None :
@@ -937,6 +939,7 @@ def __init_finalize__(self, name, parent=None, factor=None, condition=None,
937939
938940 self ._condition = condition
939941 self ._indirect = indirect
942+ self ._relation = relation
940943
941944 @property
942945 def uses_symbolic_factor (self ):
@@ -978,6 +981,10 @@ def condition(self):
978981 def indirect (self ):
979982 return self ._indirect
980983
984+ @property
985+ def relation (self ):
986+ return self ._relation
987+
981988 @cached_property
982989 def free_symbols (self ):
983990 retval = set (super ().free_symbols )
0 commit comments