Commit b3068f03 authored by Martin Bauer's avatar Martin Bauer
Browse files

Substitutions inside field accesses

parent 443527ae
......@@ -646,6 +646,12 @@ class Field(AbstractField):
"""
return Field.Access(self.field, self.offsets, idx_tuple, dtype=self.dtype)
def _eval_subs(self, old, new):
return Field.Access(self.field,
tuple(sp.sympify(a).subs(old, new) for a in self.offsets),
tuple(sp.sympify(a).subs(old, new) for a in self.index),
dtype=self.dtype)
@property
def is_absolute_access(self) -> bool:
"""Indicates if a field access is relative to the loop counters (this is the default) or absolute"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment