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

⚠️ arithmetic operations with Inf #12

Open
mtanneau opened this issue Dec 26, 2020 · 2 comments
Open

⚠️ arithmetic operations with Inf #12

mtanneau opened this issue Dec 26, 2020 · 2 comments

Comments

@mtanneau
Copy link
Owner

If we want to be able to use Multifloats.jl, we need to be careful about arithmetic operations with Inf.
Our current implementation relies on conventions like Inf + 1 == Inf and -1 * Inf == -Inf, from which Multifloats.jl deviates.
After taking a quick glance, it shouldn't be too hard for us to add manual checks to avoid arithmetic operations with Inf when possible.

Pointers: here and here.

We can also add Float64x2 to the tests.

@joehuchette
Copy link
Collaborator

+1 to exploring higher precision floats, and that compliance with IEEE standard handling of Infs and NaNs is probably not going to be all that important.

Relatedly, @Anhtu07 had a question about handling Inf in presolve routines, since 1e30 is used as a sentinel value for infinity in a number of solvers (and the presolve "bible" paper).

@mtanneau
Copy link
Owner Author

Historically, the handling of Inf was not clear in C and not always supported (Infinity was introduced in C99, possibly after some solvers were written). Fortunately, we don't have to deal with that :)

1e30 is used as a sentinel value for infinity in a number of solvers

My preference would be that all the routines handle finite and infinite values equally well; provided the arithmetic follows some conventions on the handling of Inf.

If we choose to have a cutoff value M and round larger values to ±Inf, then I would see it as a user-modifiable parameter, with arithmetic-aware default values.
Likewise, we could have some drop tolerance and round small coefficients/bounds to zero.

I would see that cleaning be performed once at the beginning of presolve, and (at least as a user), I would want to see a warning if some values were dropped/rounded to infinity.

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

2 participants