Closed VJMCallewaert closed 2 years ago
Hi, one of the reasons for the efficiency of storing large Matrices in CBC is that they are stored compactly (one row adjacent to another); to add a term to one expression would involve a very expensive operation, possibly moving the entire matrix. The recommended way of doing it is:
Hi,
but wouldn't raising a NotImplementedError be preferable to silently ignoring the user's instructions? I just fell into the same trap.
Kind regards Peter
Closed as a duplicate to #123
Describe the bug Using the cbc solver, there is seems to be no convenient way to modify a constraint. The available methods silently fail to do what you would expect.
To Reproduce
When running the code in an IPython shell, the removal of constraints sometimes fails with error:
Invalid row index (-1), valid range is [0,1). At /home/travis/build/coin-or/Cbc/src/Cbc_C_Interface.cpp:1598
Expected behavior
SolverCbc.constr_set_expr
should maybe raise aNotImplementedError
instead of silently doing notthing?Desktop (please complete the following information):