@@ -290,12 +290,11 @@ static void count_bidir_routing_transistors(int num_switch, float R_minW_nmos, f
290290 /* Now add in the input connection block transistors. */
291291
292292 // Get most frequent ipin switch
293- RRSwitchId most_frequent_ipin_switch = std::max_element (ipin_switch_count.begin (),
294- ipin_switch_count.end (),
295- [](const auto & a, const auto & b) {
296- return a.second < b.second ;
297- })
298- ->first ;
293+ std::pair<RRSwitchId, size_t > most_frequent_ipin_switch_pair = std::ranges::max (ipin_switch_count,
294+ {},
295+ [](const auto & p) { return p.second ; });
296+ RRSwitchId most_frequent_ipin_switch = most_frequent_ipin_switch_pair.first ;
297+
299298 input_cblock_trans = get_cblock_trans (num_inputs_to_cblock,
300299 most_frequent_ipin_switch,
301300 max_inputs_to_cblock,
@@ -491,9 +490,10 @@ static void count_unidir_routing_transistors(std::vector<t_segment_inf>& /*segme
491490 /* Now add in the input connection block transistors. */
492491
493492 // Get most frequent ipin switch
494- RRSwitchId most_frequent_ipin_switch = std::max_element (ipin_switch_count.begin (), ipin_switch_count.end (), [](const auto & a, const auto & b) {
495- return a.second < b.second ;
496- })->first ;
493+ std::pair<RRSwitchId, size_t > most_frequent_ipin_switch_pair = std::ranges::max (ipin_switch_count,
494+ {},
495+ [](const auto & p) { return p.second ; });
496+ RRSwitchId most_frequent_ipin_switch = most_frequent_ipin_switch_pair.first ;
497497
498498 input_cblock_trans = get_cblock_trans (num_inputs_to_cblock,
499499 most_frequent_ipin_switch,
0 commit comments