Skip to content

add support for MultiFloats#162

Open
araujoms wants to merge 4 commits into
ds4dm:masterfrom
araujoms:ieee
Open

add support for MultiFloats#162
araujoms wants to merge 4 commits into
ds4dm:masterfrom
araujoms:ieee

Conversation

@araujoms

Copy link
Copy Markdown
Contributor

Tulip relies on IEEE 754 treatment of Infs, and therefore doesn't work with non-IEEE types like MultiFloats: https://github.com/dzhang314/MultiFloats.jl

For example, here Tulip relies on diving an Inf by a normal number remaining an Inf, but MultiFloats turn it into a NaN.

pb.lcon[i] /= rscale[i]
pb.ucon[i] /= rscale[i]

Luckily the fix is simple: if we regard NaNs as Infs then everything works. I'd be happy to add tests if you're ok with this solution.

@mtanneau

Copy link
Copy Markdown
Member

I remember having that exact issue and decided not to support MultiFloats. I can't remember exactly why though.
I believe it might be something about later comparisons with Inf, or something like a division by Inf that should have been zero.

Keeping Infs around was a fairly early design decision that sometimes comes back in moments like this.
Papilo keeps an additional vector of booleans that tracks whether a bound is finite or infinite, that might be a valid strategy as well.

@araujoms

Copy link
Copy Markdown
Contributor Author

I see, we get a test failure in the unbounded example. It should be easy to fix though, one can simply do it manually if it's a single operation with Inf. Redesigning Tulip to use booleans would be a lot of work.

@araujoms

Copy link
Copy Markdown
Contributor Author

I've tried a new approach now, defining some functions to do Inf arithmetic manually for non-IEEE floats. I think it's the optimal solution, as it doesn't affect currently working cases.

I just don't know whether I found all the places in the code where Inf arithmetic is needed. Tests pass, but I don't know how comprehensive they are.

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