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

Function npy_amerge_left

numpy/core/src/npysort/timsort.cpp:2496–2518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2494}
2495
2496static void
2497npy_amerge_left(char *arr, npy_intp *p1, npy_intp l1, npy_intp *p2,
2498 npy_intp l2, npy_intp *p3, size_t len,
2499 PyArray_CompareFunc *cmp, PyArrayObject *py_arr)
2500{
2501 npy_intp *end = p2 + l2;
2502 memcpy(p3, p1, sizeof(npy_intp) * l1);
2503 /* first element must be in p2 otherwise skipped in the caller */
2504 *p1++ = *p2++;
2505
2506 while (p1 < p2 && p2 < end) {
2507 if (cmp(arr + (*p2) * len, arr + (*p3) * len, py_arr) < 0) {
2508 *p1++ = *p2++;
2509 }
2510 else {
2511 *p1++ = *p3++;
2512 }
2513 }
2514
2515 if (p1 != p2) {
2516 memcpy(p1, p3, sizeof(npy_intp) * (p2 - p1));
2517 }
2518}
2519
2520static void
2521npy_amerge_right(char *arr, npy_intp *p1, npy_intp l1, npy_intp *p2,

Callers 1

npy_amerge_atFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected