1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 137 unchanged lines hidden (view full) --- 146 for (int i = 0; i < m_bits.size(); i++) { 147 for (int j = 0; j < m_bits[i].getSize(); j++) { 148 if (m_bits[i].isElement(j)) { 149 MachineID mach = {MachineType_from_base_level(i), j}; 150 return mach; 151 } 152 } 153 } |
154 panic("No smallest element of an empty set."); |
155} 156 157MachineID 158NetDest::smallestElement(MachineType machine) const 159{ 160 int size = m_bits[MachineType_base_level(machine)].getSize(); 161 for (int j = 0; j < size; j++) { 162 if (m_bits[MachineType_base_level(machine)].isElement(j)) { 163 MachineID mach = {machine, j}; 164 return mach; 165 } 166 } 167 |
168 panic("No smallest element of given MachineType."); |
169} 170 171// Returns true iff all bits are set 172bool 173NetDest::isBroadcast() const 174{ 175 for (int i = 0; i < m_bits.size(); i++) { 176 if (!m_bits[i].isBroadcast()) { --- 99 unchanged lines hidden --- |