Changes in lemon/network_simplex.h [656:e6927fe719e6:665:b95898314e09] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/network_simplex.h
r656 r665 382 382 const int MIN_BLOCK_SIZE = 10; 383 383 384 _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)), 384 _block_size = std::max( int(BLOCK_SIZE_FACTOR * 385 std::sqrt(double(_arc_num))), 385 386 MIN_BLOCK_SIZE ); 386 387 } … … 458 459 const int MIN_MINOR_LIMIT = 3; 459 460 460 _list_length = std::max( int(LIST_LENGTH_FACTOR * sqrt(_arc_num)), 461 _list_length = std::max( int(LIST_LENGTH_FACTOR * 462 std::sqrt(double(_arc_num))), 461 463 MIN_LIST_LENGTH ); 462 464 _minor_limit = std::max( int(MINOR_LIMIT_FACTOR * _list_length), … … 578 580 const int MIN_HEAD_LENGTH = 3; 579 581 580 _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)), 582 _block_size = std::max( int(BLOCK_SIZE_FACTOR * 583 std::sqrt(double(_arc_num))), 581 584 MIN_BLOCK_SIZE ); 582 585 _head_length = std::max( int(HEAD_LENGTH_FACTOR * _block_size), … … 1145 1148 // Run Circulation to check if a feasible solution exists 1146 1149 typedef ConstMap<Arc, Flow> ConstArcMap; 1150 ConstArcMap zero_arc_map(0), inf_arc_map(inf_cap); 1147 1151 FlowNodeMap *csup = NULL; 1148 1152 bool local_csup = false; … … 1165 1169 } else { 1166 1170 Circulation<GR, FlowArcMap, ConstArcMap, FlowNodeMap> 1167 circ(_graph, *_plower, ConstArcMap(inf_cap), *csup);1171 circ(_graph, *_plower, inf_arc_map, *csup); 1168 1172 circ_result = circ.run(); 1169 1173 } … … 1171 1175 if (_pupper) { 1172 1176 Circulation<GR, ConstArcMap, FlowArcMap, FlowNodeMap> 1173 circ(_graph, ConstArcMap(0), *_pupper, *csup);1177 circ(_graph, zero_arc_map, *_pupper, *csup); 1174 1178 circ_result = circ.run(); 1175 1179 } else { 1176 1180 Circulation<GR, ConstArcMap, ConstArcMap, FlowNodeMap> 1177 circ(_graph, ConstArcMap(0), ConstArcMap(inf_cap), *csup);1181 circ(_graph, zero_arc_map, inf_arc_map, *csup); 1178 1182 circ_result = circ.run(); 1179 1183 } … … 1192 1196 } else { 1193 1197 Circulation<RevGraph, FlowArcMap, ConstArcMap, NegNodeMap> 1194 circ(rgraph, *_plower, ConstArcMap(inf_cap), neg_csup);1198 circ(rgraph, *_plower, inf_arc_map, neg_csup); 1195 1199 circ_result = circ.run(); 1196 1200 } … … 1198 1202 if (_pupper) { 1199 1203 Circulation<RevGraph, ConstArcMap, FlowArcMap, NegNodeMap> 1200 circ(rgraph, ConstArcMap(0), *_pupper, neg_csup);1204 circ(rgraph, zero_arc_map, *_pupper, neg_csup); 1201 1205 circ_result = circ.run(); 1202 1206 } else { 1203 1207 Circulation<RevGraph, ConstArcMap, ConstArcMap, NegNodeMap> 1204 circ(rgraph, ConstArcMap(0), ConstArcMap(inf_cap), neg_csup);1208 circ(rgraph, zero_arc_map, inf_arc_map, neg_csup); 1205 1209 circ_result = circ.run(); 1206 1210 } … … 1226 1230 1227 1231 // Store the arcs in a mixed order 1228 int k = std::max(int(s qrt(_arc_num)), 10);1232 int k = std::max(int(std::sqrt(double(_arc_num))), 10); 1229 1233 int i = 0; 1230 1234 for (ArcIt e(_graph); e != INVALID; ++e) {
Note: See TracChangeset
for help on using the changeset viewer.