lemon/lp_base.h
changeset 601 e8349c6f12ca
parent 511 06787db0ef5f
child 540 9db62975c32b
equal deleted inserted replaced
4:3e6eba53de92 5:8edf61fc8ebc
  1381     ///Value or \ref INF.
  1381     ///Value or \ref INF.
  1382 #ifdef DOXYGEN
  1382 #ifdef DOXYGEN
  1383     template<class T>
  1383     template<class T>
  1384     void colUpperBound(T &t, Value value) { return 0;}
  1384     void colUpperBound(T &t, Value value) { return 0;}
  1385 #else
  1385 #else
  1386     template<class T>
  1386     template<class T1>
  1387     typename enable_if<typename T::value_type::LpCol,void>::type
  1387     typename enable_if<typename T1::value_type::LpCol,void>::type
  1388     colUpperBound(T &t, Value value,dummy<0> = 0) {
  1388     colUpperBound(T1 &t, Value value,dummy<0> = 0) {
  1389       for(typename T::iterator i=t.begin();i!=t.end();++i) {
  1389       for(typename T1::iterator i=t.begin();i!=t.end();++i) {
  1390         colUpperBound(*i, value);
  1390         colUpperBound(*i, value);
  1391       }
  1391       }
  1392     }
  1392     }
  1393     template<class T>
  1393     template<class T1>
  1394     typename enable_if<typename T::value_type::second_type::LpCol,
  1394     typename enable_if<typename T1::value_type::second_type::LpCol,
  1395                        void>::type
  1395                        void>::type
  1396     colUpperBound(T &t, Value value,dummy<1> = 1) {
  1396     colUpperBound(T1 &t, Value value,dummy<1> = 1) {
  1397       for(typename T::iterator i=t.begin();i!=t.end();++i) {
  1397       for(typename T1::iterator i=t.begin();i!=t.end();++i) {
  1398         colUpperBound(i->second, value);
  1398         colUpperBound(i->second, value);
  1399       }
  1399       }
  1400     }
  1400     }
  1401     template<class T>
  1401     template<class T1>
  1402     typename enable_if<typename T::MapIt::Value::LpCol,
  1402     typename enable_if<typename T1::MapIt::Value::LpCol,
  1403                        void>::type
  1403                        void>::type
  1404     colUpperBound(T &t, Value value,dummy<2> = 2) {
  1404     colUpperBound(T1 &t, Value value,dummy<2> = 2) {
  1405       for(typename T::MapIt i(t); i!=INVALID; ++i){
  1405       for(typename T1::MapIt i(t); i!=INVALID; ++i){
  1406         colUpperBound(*i, value);
  1406         colUpperBound(*i, value);
  1407       }
  1407       }
  1408     }
  1408     }
  1409 #endif
  1409 #endif
  1410 
  1410 
  1430     /// Value, -\ref INF or \ref INF.
  1430     /// Value, -\ref INF or \ref INF.
  1431 #ifdef DOXYGEN
  1431 #ifdef DOXYGEN
  1432     template<class T>
  1432     template<class T>
  1433     void colBounds(T &t, Value lower, Value upper) { return 0;}
  1433     void colBounds(T &t, Value lower, Value upper) { return 0;}
  1434 #else
  1434 #else
  1435     template<class T>
  1435     template<class T2>
  1436     typename enable_if<typename T::value_type::LpCol,void>::type
  1436     typename enable_if<typename T2::value_type::LpCol,void>::type
  1437     colBounds(T &t, Value lower, Value upper,dummy<0> = 0) {
  1437     colBounds(T2 &t, Value lower, Value upper,dummy<0> = 0) {
  1438       for(typename T::iterator i=t.begin();i!=t.end();++i) {
  1438       for(typename T2::iterator i=t.begin();i!=t.end();++i) {
  1439         colBounds(*i, lower, upper);
  1439         colBounds(*i, lower, upper);
  1440       }
  1440       }
  1441     }
  1441     }
  1442     template<class T>
  1442     template<class T2>
  1443     typename enable_if<typename T::value_type::second_type::LpCol, void>::type
  1443     typename enable_if<typename T2::value_type::second_type::LpCol, void>::type
  1444     colBounds(T &t, Value lower, Value upper,dummy<1> = 1) {
  1444     colBounds(T2 &t, Value lower, Value upper,dummy<1> = 1) {
  1445       for(typename T::iterator i=t.begin();i!=t.end();++i) {
  1445       for(typename T2::iterator i=t.begin();i!=t.end();++i) {
  1446         colBounds(i->second, lower, upper);
  1446         colBounds(i->second, lower, upper);
  1447       }
  1447       }
  1448     }
  1448     }
  1449     template<class T>
  1449     template<class T2>
  1450     typename enable_if<typename T::MapIt::Value::LpCol, void>::type
  1450     typename enable_if<typename T2::MapIt::Value::LpCol, void>::type
  1451     colBounds(T &t, Value lower, Value upper,dummy<2> = 2) {
  1451     colBounds(T2 &t, Value lower, Value upper,dummy<2> = 2) {
  1452       for(typename T::MapIt i(t); i!=INVALID; ++i){
  1452       for(typename T2::MapIt i(t); i!=INVALID; ++i){
  1453         colBounds(*i, lower, upper);
  1453         colBounds(*i, lower, upper);
  1454       }
  1454       }
  1455     }
  1455     }
  1456 #endif
  1456 #endif
  1457 
  1457