lemon/clp.cc
changeset 1205 57abff252556
parent 1130 0759d974de81
child 1206 86a5b114a066
equal deleted inserted replaced
9:4a3de63c53b1 10: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   }