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

vptree default constructor/vptree reinitialization #2

Open
JECBello opened this issue Dec 4, 2019 · 2 comments
Open

vptree default constructor/vptree reinitialization #2

JECBello opened this issue Dec 4, 2019 · 2 comments

Comments

@JECBello
Copy link

JECBello commented Dec 4, 2019

Hello! I am working on an application requiring a vptree. I only want to initialize the vptree once within a particular method and then use the tree repeatedly within another method. This requires that I declare the vptree within the class's definition. This in turn requires that the vptree have a default constructor. I was wondering if it would be possible to implement this.

If not, is there any way you can include a method within the vptree class definition which allows the tree to be reinitialized using a different array?

Thank you!

@Masuzu
Copy link

Masuzu commented Jan 3, 2020

@JECBello Why don't you just have the vp structure declared as a pointer, and make sure to free the allocated resources after?

@anselanza
Copy link

Agreed. I used a pointer.

In my class, I declared a member:

vpt::VpTree* mVpTree = NULL;

And then when it came time to build the tree, I assigned it like this:

mVpTree = new vpt::VpTree(points);

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

3 participants