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

Change member functions in Model class from public to private in IDE model #1133

Closed
annawendler opened this issue Sep 30, 2024 · 1 comment · Fixed by #1166
Closed

Change member functions in Model class from public to private in IDE model #1133

annawendler opened this issue Sep 30, 2024 · 1 comment · Fixed by #1166
Assignees
Labels
class::improvement Cleanup that doesn't affect functionality loc::backend This issue concerns the C++ backend implementation. model::ide This issue concerns any kind of integro differential equations-based model.

Comments

@annawendler
Copy link
Member

In the implementation of the IDE model, some functions are public although they shouldn't be accessed from outside of the model without deeper knowledge of the numerical solver. This concerns functions such as compute_flow and set_transitiondistributions_support_max. However, they are needed for initialization based on reported data and are used in the file parameters_io.h which is why they have to be public.

One solution would be to rewrite the initialization as a class and define this class as well as the Simulation class as friend classes of Model. With this, functions from Model could be used in these classes but not anywhere else and errors could be prevented.

@annawendler annawendler added loc::backend This issue concerns the C++ backend implementation. model::ide This issue concerns any kind of integro differential equations-based model. class::improvement Cleanup that doesn't affect functionality labels Sep 30, 2024
@lenaploetzke
Copy link
Member

Functions can be declared as friend as well, such that it is not necessary to rewrite the initialization function. Therefore, this issue should not be very difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
class::improvement Cleanup that doesn't affect functionality loc::backend This issue concerns the C++ backend implementation. model::ide This issue concerns any kind of integro differential equations-based model.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants