Skip to content
Snippets Groups Projects
Commit 609c4b08 authored by Martin Bauer's avatar Martin Bauer
Browse files

Substitutions inside field accesses

parent 9f76ea1d
Branches
Tags
No related merge requests found
...@@ -646,6 +646,12 @@ class Field(AbstractField): ...@@ -646,6 +646,12 @@ class Field(AbstractField):
""" """
return Field.Access(self.field, self.offsets, idx_tuple, dtype=self.dtype) 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 @property
def is_absolute_access(self) -> bool: def is_absolute_access(self) -> bool:
"""Indicates if a field access is relative to the loop counters (this is the default) or absolute""" """Indicates if a field access is relative to the loop counters (this is the default) or absolute"""
......
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