lemon/lp_base.h
changeset 2514 57143c09dc20
parent 2495 e4f8367beb41
child 2553 bfced05fa852
equal deleted inserted replaced
57:8dda3c518732 58:a62dc376fbb4
  1367       return _getProblemType();
  1367       return _getProblemType();
  1368     }
  1368     }
  1369 
  1369 
  1370     ///\e
  1370     ///\e
  1371     Value primal(Col c) const { return _getPrimal(_lpId(c)); }
  1371     Value primal(Col c) const { return _getPrimal(_lpId(c)); }
       
  1372     ///\e
       
  1373     Value primal(const Expr& e) const {
       
  1374       double res = e.constComp();
       
  1375       for (std::map<Col, double>::const_iterator it = e.begin();
       
  1376 	   it != e.end(); ++it) {
       
  1377 	res += _getPrimal(_lpId(it->first)) * it->second;
       
  1378       }
       
  1379       return res; 
       
  1380     }
  1372 
  1381 
  1373     ///\e
  1382     ///\e
  1374     Value dual(Row r) const { return _getDual(_lpId(r)); }
  1383     Value dual(Row r) const { return _getDual(_lpId(r)); }
       
  1384     ///\e
       
  1385     Value dual(const DualExpr& e) const {
       
  1386       double res = 0.0;
       
  1387       for (std::map<Row, double>::const_iterator it = e.begin();
       
  1388 	   it != e.end(); ++it) {
       
  1389 	res += _getPrimal(_lpId(it->first)) * it->second;
       
  1390       }
       
  1391       return res; 
       
  1392     }
  1375 
  1393 
  1376     ///\e
  1394     ///\e
  1377     bool isBasicCol(Col c) const { return _isBasicCol(_lpId(c)); }
  1395     bool isBasicCol(Col c) const { return _isBasicCol(_lpId(c)); }
  1378 
  1396 
  1379     ///\e
  1397     ///\e