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

Function minmax

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

Find the minimum and maximum of an integer array */

Source from the content-addressed store, hash-verified

77
78/* Find the minimum and maximum of an integer array */
79static void
80minmax(const npy_intp *data, npy_intp data_len, npy_intp *mn, npy_intp *mx)
81{
82 npy_intp min = *data;
83 npy_intp max = *data;
84
85 while (--data_len) {
86 const npy_intp val = *(++data);
87 if (val < min) {
88 min = val;
89 }
90 else if (val > max) {
91 max = val;
92 }
93 }
94
95 *mn = min;
96 *mx = max;
97}
98
99/*
100 * arr_bincount is registered as bincount.

Callers 1

arr_bincountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected