void LinearConstraint::augmentStructure(MIP &mip, Cost &cost, int varindex, map<Value, Cost> &delta) {

	for (map<Value, Cost>::iterator i = delta.begin(); i != delta.end();i++) {
		
		int var1 = mapvar[varindex][i->first];
		mip.objCoeff(var1, mip.objCoeff(var1)-i->second); // update unary cost
		if (mip.sol(var1) == 1){ // using this value?
			cost -= i->second;
		}
	}

}
Esempio n. 2
0
	virtual void objCoeff(int var1, int i) { // Set the coefficient of the variable 
             if (solver) solver->objCoeff(var1, i);     
        }
Esempio n. 3
0
	virtual int objCoeff(int var1) { //Get the coefficient of the variable from the MIP
            if (solver) return solver->objCoeff(var1);     
            return 0;
        }