MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / getLocationOrdered

Method getLocationOrdered

SRC/matrix/ID.cpp:223–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221
222
223int
224ID::getLocationOrdered(int value) const
225{
226 int middle = 0;
227 int left = 0;
228 int right = sz-1;
229 if (sz != 0) {
230 while (left <= right) {
231 middle = (left + right)/2;
232 double dataMiddle = data[middle];
233 if (value == dataMiddle)
234 return middle; // already there
235 else if (value > dataMiddle)
236 left = middle + 1;
237 else
238 right = middle-1;
239 }
240 }
241
242 // if we get here the value is not in the array
243 return -1;
244}
245
246
247int

Callers 9

clearMethod · 0.45
meshMethod · 0.45
meshMethod · 0.45
meshMethod · 0.45
setSizeMethod · 0.45
addAMethod · 0.45
savePart0Method · 0.45
savePartMethod · 0.45
writeModelNodesMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected