Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tom Harke
pystencils
Commits
50f27d79
Commit
50f27d79
authored
Mar 30, 2019
by
Stephan Seitz
Browse files
Add pystencils.data_types.address_of
parent
0690f5ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/data_types.py
View file @
50f27d79
...
@@ -14,6 +14,33 @@ from pystencils.utils import all_equal
...
@@ -14,6 +14,33 @@ from pystencils.utils import all_equal
from
sympy.logic.boolalg
import
Boolean
from
sympy.logic.boolalg
import
Boolean
# noinspection PyPep8Naming
class
address_of
(
sp
.
Function
):
is_Atom
=
True
def
__new__
(
cls
,
arg
):
obj
=
sp
.
Function
.
__new__
(
cls
,
arg
)
return
obj
@
property
def
canonical
(
self
):
if
hasattr
(
self
.
args
[
0
],
'canonical'
):
return
self
.
args
[
0
].
canonical
else
:
raise
NotImplementedError
()
@
property
def
is_commutative
(
self
):
return
self
.
args
[
0
].
is_commutative
@
property
def
dtype
(
self
):
if
hasattr
(
self
.
args
[
0
],
'dtype'
):
return
PointerType
(
self
.
args
[
0
].
dtype
,
restrict
=
True
)
else
:
return
PointerType
(
'void'
,
restrict
=
True
)
# noinspection PyPep8Naming
# noinspection PyPep8Naming
class
cast_func
(
sp
.
Function
):
class
cast_func
(
sp
.
Function
):
is_Atom
=
True
is_Atom
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment