Comments (5)
Looking at #339, I can see problems - including large overheads. But I think you have a much simpler request if you are just modifying one coefficient - even simpler if you are not changing the coefficient to or from zero.
ClpModel.cpp has -
/// Modify one element of a matrix
inline void modifyCoefficient(int row, int column, double newElement,
bool keepZero = false)
and it should be easy to transfer functionality to the C interface.
Will this be done outside a solve - or at least before cuts have been added? Inside Cbc there are really two solvers - one as passed in and the other after cuts and fixing.
So it could be done at Osi level e.g.
CBCLIB_EXPORT void CBC_LINKAGE
Osi_modifyCoef(void *osi, int row, int column, double newValue);
or at Cbc level
CBCLIB_EXPORT void CBC_LINKAGE
Cbc_modifyCoef(Cbc_Model *model, int row, int column, double newValue );
from cbc.
Thanks for the advice. I'll take a look over the next couple of days. Will you want this against the stable or master branch (or both)?
from cbc.
Will this be done outside a solve - or at least before cuts have been added?
For my use case, the update is between solves.
from cbc.
Do it to master. Looking at code, modifyCoefficient in ClpModel doesn't do some things that would make it safer e.g. check if there is matrix stored by row which would also need updating. Also if a factorization has been saved it may not may not be valid so that should be noted. It is unlikely that any of that will matter, but I may add a safer version.
from cbc.
Only needed a tiny change to make safer - done that in master.
Also I was only looking Cbc C interface. When I looked at Clp C interface the function you need is already there.
/* Change matrix coefficients */
void CLP_LINKAGE
Clp_modifyCoefficient(Clp_Simplex *model, int row, int column, double newElement,
int keepZero)
{
model->model_->modifyCoefficient(row, column, newElement, keepZero);
}
from cbc.
Related Issues (20)
- missing Result after TimeOut HOT 4
- Discrepancy in config.guess between Releases and Master Branch HOT 1
- "Conditional jump or move depends on uninitialised value" for model with SOS 2 and MIP start (master) HOT 2
- CBC fails when initial solution is passed with mipstart HOT 2
- Undefined reference to `node_count` when compiling HOT 5
- Feature Request -- Retrieving multiple optimal solutions
- Question - interpretation of a sol file
- Bug: got Infeasible on obviously feasible problem HOT 3
- Bug? Huge variance in solving time HOT 3
- Error installing Cbc solver in a docker image HOT 2
- osiUnitTest failure HOT 2
- Trying to end CBC Promt with ctrl-d leads to endless loop
- mipStart_ not copied in CbcModel copy constructor HOT 1
- Wrong result with current master build HOT 3
- Option '-threads 8' causes unpredictable hanging due to lock issue HOT 10
- How to use latest CBC solver in Python PULP on MacOS HOT 1
- cbc crash ( segmentation fault) when model was solved during presolve process and given lp is large HOT 2
- No static library in MacOS builds HOT 3
- File content mismatch between releases and repo HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cbc.