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

LoadError when adding too many new cuts in an empty CutPruner #19

Open
frapac opened this issue Jun 26, 2017 · 0 comments
Open

LoadError when adding too many new cuts in an empty CutPruner #19

frapac opened this issue Jun 26, 2017 · 0 comments

Comments

@frapac
Copy link
Collaborator

frapac commented Jun 26, 2017

The use case is the following:

  • I define a new CutPruner with a max cut set as 10:
man = CutPruner(AvgCutPruningAlgo(10), :Max)
  • Then, I add 20 new cuts to this cut pruner:
addcuts!(man, A, b, mycut)

and it renders a LoadError

The problem is that you add directly 20 new cuts to an empty pruner which must store a maximum of 10 new cuts.
Thus, we enter in this loop:
https://github.com/JuliaPolyhedra/CutPruners.jl/blob/master/src/abstract.jl#L195

which calls gettrust in choosecutstoremove:
https://github.com/JuliaPolyhedra/CutPruners.jl/blob/master/src/abstract.jl#L93

As no cut is stored inside man, we have an empty trust, and we obtain an error when we want to select the cuts to keep:
https://github.com/JuliaPolyhedra/CutPruners.jl/blob/master/src/abstract.jl#L108

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

1 participant