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

Unable to create path using GenTree() #203

Open
SveinHogemo opened this issue Sep 3, 2020 · 0 comments
Open

Unable to create path using GenTree() #203

SveinHogemo opened this issue Sep 3, 2020 · 0 comments

Comments

@SveinHogemo
Copy link

I am using snap.py with Python 3.7.8. When I tried to create a tree with fanout 1 (i.e. a path) in the interactive shell, the session quit abruptly with no error message.

I looked at the C++ code and it seems this line is the culprit (/snap-core/ggen.h, line 134):
const int Nodes = (int) (pow(double(Fanout), double(Levels+1)) - 1) / (Fanout - 1);

So the number of nodes is calculated using the formula for geometric sums, and with fanout 1 you get a division by zero. I do not have any perfect suggestion for how to resolve this, but I think either the number of nodes should be calculated another way, or it should be specified in docs that fanout must be >=2.

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