-
Notifications
You must be signed in to change notification settings - Fork 67
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
[Simplex tree] empty dummies with if constexpr #977
Comments
I didn't check this particular case, but note that the dummy could return by value and the non-dummy return by reference, that's not forbidden. And then it may be convenient to use
We would have to see in details what the new code looks like compared to the old one. Having the dummy provide a filtration value of 0 means that a number of things "just worked", for instance computing the cohomology of a non-filtered complex, without having to spam |
That is what I thought about first, but we had some weird issues because of it. I don't remember exactly what, because we corrected quite a few things that day, but using a
I admit that the
I agree that those are unclear... That is why I thought it would be a good idea to open the issue to remember myself to test that at some point. |
This is related to PR #976 / #817 : with vectors as filtration values, the method
filtration
needs to return references instead of copies now.Before the integration of C++17 to Gudhi, to handle the different options, the "dummy" options had to implement the optional method too, just trivially. For the filtration values, it means that the dummy has to return a reference too when calling
filtration
, forcing the addition of a dummy empty value to point to.Instead we could just empty out the dummies (except non default constructors) and put
if constexpr
in front of the use of optional methods. It would not only avoid useless calls, but also having to maintain them.The text was updated successfully, but these errors were encountered: