NetDest.cc (10004:5d8b72563869) | NetDest.cc (10005:8c2b0dc16ccd) |
---|---|
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; --- 88 unchanged lines hidden (view full) --- 97 machine < MachineType_NUM; ++machine) { 98 broadcast(machine); 99 } 100} 101 102void 103NetDest::broadcast(MachineType machineType) 104{ | 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; --- 88 unchanged lines hidden (view full) --- 97 machine < MachineType_NUM; ++machine) { 98 broadcast(machine); 99 } 100} 101 102void 103NetDest::broadcast(MachineType machineType) 104{ |
105 for (int i = 0; i < MachineType_base_count(machineType); i++) { | 105 for (NodeID i = 0; i < MachineType_base_count(machineType); i++) { |
106 MachineID mach = {machineType, i}; 107 add(mach); 108 } 109} 110 111//For Princeton Network 112std::vector<NodeID> 113NetDest::getAllDest() --- 27 unchanged lines hidden (view full) --- 141 return m_bits[vecIndex(index)].elementAt(bitIndex(index.num)); 142} 143 144MachineID 145NetDest::smallestElement() const 146{ 147 assert(count() > 0); 148 for (int i = 0; i < m_bits.size(); i++) { | 106 MachineID mach = {machineType, i}; 107 add(mach); 108 } 109} 110 111//For Princeton Network 112std::vector<NodeID> 113NetDest::getAllDest() --- 27 unchanged lines hidden (view full) --- 141 return m_bits[vecIndex(index)].elementAt(bitIndex(index.num)); 142} 143 144MachineID 145NetDest::smallestElement() const 146{ 147 assert(count() > 0); 148 for (int i = 0; i < m_bits.size(); i++) { |
149 for (int j = 0; j < m_bits[i].getSize(); j++) { | 149 for (NodeID j = 0; j < m_bits[i].getSize(); j++) { |
150 if (m_bits[i].isElement(j)) { 151 MachineID mach = {MachineType_from_base_level(i), j}; 152 return mach; 153 } 154 } 155 } 156 panic("No smallest element of an empty set."); 157} 158 159MachineID 160NetDest::smallestElement(MachineType machine) const 161{ 162 int size = m_bits[MachineType_base_level(machine)].getSize(); | 150 if (m_bits[i].isElement(j)) { 151 MachineID mach = {MachineType_from_base_level(i), j}; 152 return mach; 153 } 154 } 155 } 156 panic("No smallest element of an empty set."); 157} 158 159MachineID 160NetDest::smallestElement(MachineType machine) const 161{ 162 int size = m_bits[MachineType_base_level(machine)].getSize(); |
163 for (int j = 0; j < size; j++) { | 163 for (NodeID j = 0; j < size; j++) { |
164 if (m_bits[MachineType_base_level(machine)].isElement(j)) { 165 MachineID mach = {machine, j}; 166 return mach; 167 } 168 } 169 170 panic("No smallest element of given MachineType."); 171} --- 116 unchanged lines hidden --- | 164 if (m_bits[MachineType_base_level(machine)].isElement(j)) { 165 MachineID mach = {machine, j}; 166 return mach; 167 } 168 } 169 170 panic("No smallest element of given MachineType."); 171} --- 116 unchanged lines hidden --- |