How to cast self recursive data structure to python? #3942
Unanswered
jhonsonlaid
asked this question in
Q&A
Replies: 1 comment
-
I'm sorry, it's my C++ code problem. Fix by below: auto run(){
BVHNode *a = new BVHNode();
a->tri_indices = xt::pyarray<int>({ 1, 2, 3 });
BVHNode *b = new BVHNode();
b->tri_indices = xt::pyarray<int>({ 4, 5, 6 });
BVHNode c;
c.left = a;
c.right = b;
return c;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a self-recursive data structure
BVHNode
, whose members containBVHNode *
, which is initialized asnullptr
. But when the recursion depth >=1, it seems to lead to segmentation faults. (See python codeprint
for details)C++ Example code:
Python code:
Beta Was this translation helpful? Give feedback.
All reactions