Lines Matching defs:n1
36 /* Merge the sorted arrays src1[0..n1-1] and src2[0..n2-1] into
37 dst[0..n1+n2-1]. In case of ambiguity, put the elements of src1
39 n1 and n2 must be > 0.
41 src1 may be dst[n2..n1+n2-1], or src2 may be dst[n1..n1+n2-1]. */
43 merge (const ELEMENT *src1, size_t n1,
47 for (;;) /* while (n1 > 0 && n2 > 0) */
52 n1--;
53 if (n1 == 0)
64 /* Here n1 == 0 || n2 == 0 but also n1 > 0 || n2 > 0. */
65 if (n1 > 0)
71 n1--;
73 while (n1 > 0);
168 size_t n1 = n / 2;
170 /* Note: n1 + n2 = n, n1 <= n2. */
171 /* Sort src[n1..n-1] into dst[n1..n-1], scratching tmp[0..n2/2-1]. */
172 merge_sort_fromto (src + n1, dst + n1, n2, tmp);
173 /* Sort src[0..n1-1] into tmp[0..n1-1], scratching dst[0..n1-1]. */
174 merge_sort_fromto (src, tmp, n1, dst);
176 merge (tmp, n1, dst + n1, n2, dst);
258 size_t n1 = n / 2;
260 /* Note: n1 + n2 = n, n1 <= n2. */
261 /* Sort src[n1..n-1], scratching tmp[0..n2-1]. */
262 merge_sort_inplace (src + n1, n2, tmp);
263 /* Sort src[0..n1-1] into tmp[0..n1-1], scratching tmp[n1..2*n1-1]. */
264 merge_sort_fromto (src, tmp, n1, tmp + n1);
266 merge (tmp, n1, src + n1, n2, src);