You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// indices = (npy_int64*)realloc(indices, sizeof(npy_int64) * capacity);
3611
-
// if (indices == NULL) {
3612
-
// NpyIter_Deallocate(iter);
3613
-
// return NULL;
3614
-
// }
3615
-
// }
3616
-
// indices[count++] = i;
3617
-
// }
3618
-
// i++;
3619
-
// data += stride;
3620
-
// }
3621
-
// } while(iter_next(iter));
3622
-
// NpyIter_Deallocate(iter);
3623
-
3624
-
3625
-
3626
-
3627
3575
// Given a Boolean, contiguous 1D array, return the index positions in an int64 array. Through experimentation it has been verified that doing full-size allocation of memory does not permit outperforming NumPy at 10_000_000 scale; but doing less optimizations does help. Using bit masks does not improve perforamnce over pointer arithmetic. Prescanning for all empty is very effective. Note that NumPy befits from first counting the nonzeros, then allocating only enough data for the expexted number.
0 commit comments