lemon/clp.cc
changeset 1427 57abff252556
parent 1336 0759d974de81
child 1428 86a5b114a066
equal deleted inserted replaced
11:4a3de63c53b1 12:0efa86b07a87
   225   void ClpLp::_setCoeff(int ix, int jx, Value value) {
   225   void ClpLp::_setCoeff(int ix, int jx, Value value) {
   226     _prob->modifyCoefficient(ix, jx, value);
   226     _prob->modifyCoefficient(ix, jx, value);
   227   }
   227   }
   228 
   228 
   229   ClpLp::Value ClpLp::_getCoeff(int ix, int jx) const {
   229   ClpLp::Value ClpLp::_getCoeff(int ix, int jx) const {
   230     CoinBigIndex begin = _prob->clpMatrix()->getVectorStarts()[ix];
   230     CoinBigIndex begin = _prob->clpMatrix()->getVectorStarts()[jx];
   231     CoinBigIndex end = begin + _prob->clpMatrix()->getVectorLengths()[ix];
   231     CoinBigIndex end = begin + _prob->clpMatrix()->getVectorLengths()[jx];
   232 
   232 
   233     const int* indices = _prob->clpMatrix()->getIndices();
   233     const int* indices = _prob->clpMatrix()->getIndices();
   234     const double* elements = _prob->clpMatrix()->getElements();
   234     const double* elements = _prob->clpMatrix()->getElements();
   235 
   235 
   236     const int* it = std::lower_bound(indices + begin, indices + end, jx);
   236     const int* it = std::lower_bound(indices + begin, indices + end, ix);
   237     if (it != indices + end && *it == jx) {
   237     if (it != indices + end && *it == ix) {
   238       return elements[it - indices];
   238       return elements[it - indices];
   239     } else {
   239     } else {
   240       return 0.0;
   240       return 0.0;
   241     }
   241     }
   242   }
   242   }