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

Max inscribed ellipsoid segfault when given 2d polytope #325

Open
lucaperju opened this issue Jul 19, 2024 · 3 comments
Open

Max inscribed ellipsoid segfault when given 2d polytope #325

lucaperju opened this issue Jul 19, 2024 · 3 comments

Comments

@lucaperju
Copy link
Contributor

Describe the bug
Sometimes, when trying to compute the max inscribed ellipsoid using the MAX_ELLIPSOID type, the process terminates with an instance of 'std::invalid_argument' thrown.

To Reproduce
Steps to reproduce the behavior:

  1. Go to examples/sampling-hpolytope-with-billiard-walks/sampler.cpp
  2. on line 78, change the EllipsoidType to MAX_ELLIPSOID
  3. optionally, add a print before and after that line to confirm that the process is terminated while trying to compute the max ellipsoid
  4. compile and run the example
  5. See error

It could also be reproduced by trying to compute the max inscribed ellipsoid for various 2d polytopes until one which doesn't work is found, but above I described the fastest way to obtain this error.

Expected behavior
The function should be able to compute the max inscribed ellipsoid even if the polytope is two dimensional.

Screenshots
image

@tanishapritha
Copy link

tanishapritha commented Jan 17, 2025

Hi @lucaperju,

The problem seems to come from nev not meeting the condition 1 <= nev <= n - 1.

We can:

  • Trace how nev is calculated and why it breaks for 2D polytopes.
  • Add early checks to handle such cases safely.
  • Update the test suite with edge cases like 2D polytopes and small matrices.

We can also refactor the MAX_ELLIPSOID logic to make it clearer and more reliable. Let me know if I can work on this, or about a different approach.

@vfisikop
Copy link
Contributor

vfisikop commented Feb 2, 2025

@tanishapritha sure, please feel free to work on this and open a PR.

@tanishapritha
Copy link

tanishapritha commented Feb 3, 2025

Hi @vfisikop,
I’m unable to proceed with the setup due to issues with the Boost dependency and the missing CMakeLists.txt file. Could you guide me on how to resolve these or clarify if there have been any updates to the setup process?

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

3 participants