Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to use direct C++ code #5

Open
videlec opened this issue Aug 23, 2022 · 0 comments
Open

Make it possible to use direct C++ code #5

videlec opened this issue Aug 23, 2022 · 0 comments

Comments

@videlec
Copy link
Collaborator

videlec commented Aug 23, 2022

moved from gitlab issue #2

The pplpy library does not support extension type construction from an already constructed C++ object. The following construction should be supported

from ppl.ppl_decl cimport PPL_Variable
from ppl.linear_algebra cimport Variable
cdef PPL_Variable * x = new PPL_Variable(0)
cdef Variable py_x = Variable.__new__(Variable)
py_x.thisptr = x

The reason why it is not currently possible is that the initialization is done within the __cinit__ method instead of __init__.

Also, most of the binary operators are not declared in ppl_decl.pxd. It is for example impossible to create linear expression from pure C++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant