Go to the documentation of this file.
6 int32_t *basebin, int32_t nrows, int32_t *beg, int32_t *
ext) {
12 row = (int32_t *) calloc(n_bins_write,
sizeof (int32_t));
13 uniq = (int32_t *) calloc(
nrows + 1,
sizeof (int32_t));
18 for (
j = 0;
j < n_bins_write;
j++) {
19 for (
i = last_row;
i <=
nrows;
i++) {
20 if (basebin[
i] > binnum_data[
j]) {
27 printf(
"Zero row at bin: %d of %d total bins.\n",
j, n_bins_write);
28 printf(
"basebin: %ld binnum_data: %ld\n", (
long int) basebin[
i],
29 (
long int) binnum_data[
j]);
30 printf(
"%d %d\n",
i, last_row);
34 for (
i = 0;
i < n_bins_write - 1;
i++) {
35 if (row[
i] > row[
i + 1]) {
36 printf(
"Improper row number: %d at element: %d\n", row[
i],
i);
45 for (
j = 1;
j < n_bins_write;
j++) {
46 if (row[
j] != last_row) {
59 beg[row[uniq[
j]] - 1] = binnum_data[uniq[
j]];
61 if (row[uniq[
j]] - 1 < 0)
62 printf(
"bad row index: %d %d %d\n",
j, uniq[
j], row[uniq[
j]]);
65 uniq[
i] = n_bins_write;
69 for (
j = 0;
j <
i;
j++) {
73 ext[row[uniq[
j]] - 1] = uniq[
j + 1] - uniq[
j];
83 int64_t
get_beg_ext(int32_t n_bins_write, int64_t *binnum_data,
84 int64_t *basebin, int32_t nrows, int64_t *beg, int32_t *
ext) {
90 row = (int32_t *) calloc(n_bins_write,
sizeof (int32_t));
91 uniq = (int32_t *) calloc(
nrows + 1,
sizeof (int32_t));
96 for (
j = 0;
j < n_bins_write;
j++) {
97 for (
i = last_row;
i <=
nrows;
i++) {
98 if (basebin[
i] > binnum_data[
j]) {
105 printf(
"Zero row at bin: %d of %d total bins.\n",
j, n_bins_write);
106 printf(
"basebin: %ld binnum_data: %ld\n", (
long int) basebin[
i],
107 (
long int) binnum_data[
j]);
108 printf(
"%d %d\n",
i, last_row);
112 for (
i = 0;
i < n_bins_write - 1;
i++) {
113 if (row[
i] > row[
i + 1]) {
114 printf(
"Improper row number: %d at element: %d\n", row[
i],
i);
123 for (
j = 1;
j < n_bins_write;
j++) {
124 if (row[
j] != last_row) {
137 beg[row[uniq[
j]] - 1] = binnum_data[uniq[
j]];
139 if (row[uniq[
j]] - 1 < 0)
140 printf(
"bad row index: %d %d %d\n",
j, uniq[
j], row[uniq[
j]]);
143 uniq[
i] = n_bins_write;
147 for (
j = 0;
j <
i;
j++) {
151 ext[row[uniq[
j]] - 1] = uniq[
j + 1] - uniq[
j];
int64_t get_beg_ext(int32_t n_bins_write, int64_t *binnum_data, int64_t *basebin, int32_t nrows, int64_t *beg, int32_t *ext)
int32_t get_beg_ext32(int32_t n_bins_write, int32_t *binnum_data, int32_t *basebin, int32_t nrows, int32_t *beg, int32_t *ext)