Skip to content

Replaced recursive functions with while loops to avoid hitting recursion limits#1

Open
h-joshi wants to merge 1 commit intocran:masterfrom
h-joshi:master
Open

Replaced recursive functions with while loops to avoid hitting recursion limits#1
h-joshi wants to merge 1 commit intocran:masterfrom
h-joshi:master

Conversation

@h-joshi
Copy link
Copy Markdown

@h-joshi h-joshi commented Oct 2, 2018

Hi, I've rewritten the probability calculation functions as while loops. The current implementation was hitting stack limits (due to self-recursion) when the no. of genotypes was particular large.

e.g.
HWExact(c(AA = 88447, AB = 30802, BB = 3563), x.linked = F)

On Linux, the error being displayed was
Error: node stack overflow

On OS X
C stack usage 7970184 is too close to the limit

Hopefully this alleviates that. I've done regression testing to ensure that the rewritten functions behave exactly as per existing ones.

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

Successfully merging this pull request may close these issues.

1 participant