Skip to content

refactor: Move MMCS implementation from dingo to volesti #113

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ASHISHBVB
Copy link
Contributor

Currently, the Multiphase Monte Carlo Sampling (MMCS) algorithm is implemented in both dingo and volesti libraries, causing code duplication. This issue proposes moving the implementation entirely to volesti, where it belongs as a core algorithm.

Changes:

  1. Move MMCS implementation to volesti/include/sampling/mmcs.hpp
  2. Update dingo bindings to use volesti's implementation
  3. Remove duplicate code from dingo
  4. Update build system configuration

Refactor mmcs algorithm #93

@ASHISHBVB
Copy link
Contributor Author

@vissarion @hariszaf sir, could you please review my PR

Copy link
Contributor

@vfisikop vfisikop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the efforts! dingo is already using mmcs from volesti. The only thing left is the functions from the old implementation e.g. HPolytopeCPP::mmcs_step. As far as I understand those are intentionally left for testing if the cpp functions have the same behaviour.

void get_polytope_as_matrices(double* new_A, double* new_b) const;

// the rounding() function
void apply_rounding(int rounding_method, double* new_A, double* new_b, double* T_matrix,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reason for removing this?

const Hpolytope HP_const = HP;
mmcs(HP_const, ess, S, total_ess, walk_len, rng);
samples = S.data();
} else if (strcmp(method, "mmcs") == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please comment on the reason you rewrite this part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was rewritten to redirect MMCS algorithm calls to volesti's implementation instead of using dingo's own code. This change was part of our larger refactoring effort to move all MMCS implementation details to volesti, which is the more appropriate home for sampling algorithms. The rewrite creates a cleaner separation of responsibilities between the libraries and eliminates code duplication, making future maintenance and improvements simpler.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the code before this PR was using the dingo's mmcs calls?

@vfisikop vfisikop requested a review from TolisChal April 4, 2025 07:54
@ASHISHBVB
Copy link
Contributor Author

Hi @vfisikop! You are totally right that we kept some functions HPolytopeCPP::mmcs_step for example for debugging reasons. I took apply_rounding out because it wasn´t being use anymore after moving to MMCS volesti it was only use on previous implementation

@ASHISHBVB ASHISHBVB requested a review from vfisikop April 8, 2025 09:46
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.

2 participants