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

Global variables on updateRP_genomic_cpp() #22

Open
wleoncio opened this issue Oct 28, 2024 · 1 comment
Open

Global variables on updateRP_genomic_cpp() #22

wleoncio opened this issue Oct 28, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@wleoncio
Copy link
Member

Commit 0c2bf18 introduced header file updateRP_genomic_cpp.h which contains lots of global variables that might have been introduced by mistake and should be only internal to updateRP_genomic_cpp(). If that's the case, internalizing them should make the code more readable (and potentially memory-efficient).

@wleoncio wleoncio added the question Further information is requested label Oct 28, 2024
@zhizuio
Copy link
Collaborator

zhizuio commented Oct 28, 2024

Commit 0c2bf18 introduced header file updateRP_genomic_cpp.h which contains lots of global variables that might have been introduced by mistake and should be only internal to updateRP_genomic_cpp(). If that's the case, internalizing them should make the code more readable (and potentially memory-efficient).

I have doubled checked those variables and can confirm that they are local variables. One possible issue (not very sure if it is an issue) in my original updateRP_genomic_cpp.h might be that it is not recommended to initialise local variables in a function in the header file.

We can keep it as what you have changed. I might change it later on when implementing the issue#21.

In fact, I copied the header file from our R-package psbcSpeedUp in which those variables are shared by multiple functions but defined as private in the class PSBC{}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants