MCPcopy Create free account
hub / github.com/numpy/numpy / _linear_search

Function _linear_search

numpy/core/src/multiarray/compiled_base.c:386–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384#pragma intel optimization_level 0
385#endif
386static inline npy_intp
387_linear_search(const npy_double key, const npy_double *arr, const npy_intp len, const npy_intp i0)
388{
389 npy_intp i;
390
391 for (i = i0; i < len && key >= arr[i]; i++);
392 return i - 1;
393}
394
395/** @brief find index of a sorted array such that arr[i] <= key < arr[i + 1].
396 *

Callers 1

binary_search_with_guessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected