scipopt / soplex

Sequential object-oriented simPlex
Other
59 stars 18 forks source link

Macro's leak #16

Closed JoD closed 11 months ago

JoD commented 1 year ago

Macro's defined in header files leak into projects using SoPlex as library. In my case, it's the EPSILON macro at https://github.com/scipopt/soplex/blob/master/src/soplex/spxfastrt.hpp#L53 that replaces some code in a header file from a different library.

One way to fix this is to replace the macro's by constexpr's. This may yield some subtle changes as they are combined with templated types (i.e., the macro's type is unknown and automatically matches the templated type) as picking one type (e.g., double) may subtly change behavior.

Another way to fix this is to #undef these macro's at the bottom of the header. At least then they don't seem to leak anymore into the other code.

What are your thoughts? I'd be happy to add a bit of boilerplate to catch most of them.

ambros-gleixner commented 1 year ago

Hi Jo! Funny that you are creating this issue right now. We have also just been running into the current handling of tolerances in a different context. If you give us 1-2 weeks, we may have a branch ready that solves this problem, too.

ambros-gleixner commented 1 year ago

Would that be sufficient?

JoD commented 1 year ago

Ha, that's indeed a coincidence :)

Sure, a couple of weeks is great. Good luck with the tolerances!

JoD commented 11 months ago

Great, I don't need my own patch for SoPlex anymore :)

Thanks for fixing!