Skip to content

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

@frapac

Description

@frapac

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions