Skip to content
Snippets Groups Projects
Commit b68e174e authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Make Field.Access a TypedSymbol

parent c06f8b77
No related branches found
No related tags found
1 merge request!14Remove floor, ceiling for integer symbols
...@@ -10,7 +10,7 @@ import sympy as sp ...@@ -10,7 +10,7 @@ import sympy as sp
from sympy.core.cache import cacheit from sympy.core.cache import cacheit
from pystencils.alignedarray import aligned_empty from pystencils.alignedarray import aligned_empty
from pystencils.data_types import StructType, create_type from pystencils.data_types import StructType, TypedSymbol, create_type
from pystencils.kernelparameters import FieldShapeSymbol, FieldStrideSymbol from pystencils.kernelparameters import FieldShapeSymbol, FieldStrideSymbol
from pystencils.stencil import direction_string_to_offset, offset_to_direction_string from pystencils.stencil import direction_string_to_offset, offset_to_direction_string
from pystencils.sympyextensions import is_integer_sequence from pystencils.sympyextensions import is_integer_sequence
...@@ -410,7 +410,7 @@ class Field(AbstractField): ...@@ -410,7 +410,7 @@ class Field(AbstractField):
return self.hashable_contents() == other.hashable_contents() return self.hashable_contents() == other.hashable_contents()
# noinspection PyAttributeOutsideInit,PyUnresolvedReferences # noinspection PyAttributeOutsideInit,PyUnresolvedReferences
class Access(sp.Symbol, AbstractField.AbstractAccess): class Access(TypedSymbol, AbstractField.AbstractAccess):
"""Class representing a relative access into a `Field`. """Class representing a relative access into a `Field`.
This class behaves like a normal sympy Symbol, it is actually derived from it. One can built up This class behaves like a normal sympy Symbol, it is actually derived from it. One can built up
...@@ -462,7 +462,7 @@ class Field(AbstractField): ...@@ -462,7 +462,7 @@ class Field(AbstractField):
if superscript is not None: if superscript is not None:
symbol_name += "^" + superscript symbol_name += "^" + superscript
obj = super(Field.Access, self).__xnew__(self, symbol_name) obj = super(Field.Access, self).__xnew__(self, symbol_name, field.dtype)
obj._field = field obj._field = field
obj._offsets = [] obj._offsets = []
for o in offsets: for o in offsets:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment