Debian Codegraph @

lib/rset.c

raw symbols SCIP
1 /*
2 Copyright (C) 2009-2015 Brazil
3 Copyright (C) 2020-2024 Sutou Kouhei <[email protected]>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include "grn_db.h"cxx . . $ `<file>/lib/grn_db.h`/
21
22 inline static void
23 grn_rset_subrecs_pushcxx . . $ grn_rset_subrecs_push(1afcb1895ec04f3f).(bytecxx . . $ byte# *subrecs,
24 size_t size,
25 size_t n_subrecs,
26 double score,
27 void *body,
28 int dir)
29 {
30 bytecxx . . $ byte# *v;
31 double *c2;
32 size_t n = n_subrecs - 1;
33 size_t n2;
34 while (n > 0) {
35 n2 = (n - 1) >> 1;
36 c2 = GRN_RSET_SUBRECS_NTHcxx . . $ `lib/grn_rset.h:62:9`!(subrecs,size,n2);
37 if (GRN_RSET_SUBRECS_CMPcxx . . $ `lib/grn_rset.h:61:9`!(score, *c2, dir) >= 0) { break; }
38 GRN_RSET_SUBRECS_COPYcxx . . $ `lib/grn_rset.h:64:9`!(subrecs,size,n,c2);
39 n = n2;
40 }
41 v = subrecs + n * (GRN_RSET_SCORE_SIZEcxx . . $ `lib/grn_rset.h:55:9`! + size);
42 *((double *)v) = score;
43 grn_memcpycxx . . $ `include/groonga/portability.h:32:13`!(v + GRN_RSET_SCORE_SIZEcxx . . $ `lib/grn_rset.h:55:9`!, body, size);
44 }
45
46 inline static void
47 grn_rset_subrecs_replace_mincxx . . $ grn_rset_subrecs_replace_min(1afcb1895ec04f3f).(bytecxx . . $ byte# *subrecs,
48 size_t size,
49 size_t n_subrecs,
50 double score,
51 void *body,
52 int dir)
53 {
54 bytecxx . . $ byte# *v;
55 size_t n = 0;
56 size_t n1;
57 size_t n2;
58 double *c1, *c2;
59 for (;;) {
60 n1 = n * 2 + 1;
61 n2 = n1 + 1;
62 c1 = n1 < n_subrecs ? GRN_RSET_SUBRECS_NTHcxx . . $ `lib/grn_rset.h:62:9`!(subrecs,size,n1) : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
63 c2 = n2 < n_subrecs ? GRN_RSET_SUBRECS_NTHcxx . . $ `lib/grn_rset.h:62:9`!(subrecs,size,n2) : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
64 if (c1 && GRN_RSET_SUBRECS_CMPcxx . . $ `lib/grn_rset.h:61:9`!(score, *c1, dir) > 0) {
65 if (c2 &&
66 GRN_RSET_SUBRECS_CMPcxx . . $ `lib/grn_rset.h:61:9`!(score, *c2, dir) > 0 &&
67 GRN_RSET_SUBRECS_CMPcxx . . $ `lib/grn_rset.h:61:9`!(*c1, *c2, dir) > 0) {
68 GRN_RSET_SUBRECS_COPYcxx . . $ `lib/grn_rset.h:64:9`!(subrecs,size,n,c2);
69 n = n2;
70 } else {
71 GRN_RSET_SUBRECS_COPYcxx . . $ `lib/grn_rset.h:64:9`!(subrecs,size,n,c1);
72 n = n1;
73 }
74 } else {
75 if (c2 && GRN_RSET_SUBRECS_CMPcxx . . $ `lib/grn_rset.h:61:9`!(score, *c2, dir) > 0) {
76 GRN_RSET_SUBRECS_COPYcxx . . $ `lib/grn_rset.h:64:9`!(subrecs,size,n,c2);
77 n = n2;
78 } else {
79 break;
80 }
81 }
82 }
83 v = subrecs + n * (GRN_RSET_SCORE_SIZEcxx . . $ `lib/grn_rset.h:55:9`! + size);
84 grn_memcpycxx . . $ `include/groonga/portability.h:32:13`!(v, &score, GRN_RSET_SCORE_SIZEcxx . . $ `lib/grn_rset.h:55:9`!);
85 grn_memcpycxx . . $ `include/groonga/portability.h:32:13`!(v + GRN_RSET_SCORE_SIZEcxx . . $ `lib/grn_rset.h:55:9`!, body, size);
86 }
87
88 void
89 grn_rset_add_subreccxx . . $ grn_rset_add_subrec(90901368b7cc1474).(grn_ctxcxx . . $ grn_ctx# *ctx,
90 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
91 grn_objcxx . . $ grn_obj# *table,
92 double score,
93 grn_rset_posinfocxx . . $ grn_rset_posinfo# *pi,
94 int dir)
95 {
96 uint32_tcxx . . $ uint32_t# limit = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->max_n_subrecscxx . . $ $anonymous_type_4a7c1014017e4c5d_0#max_n_subrecs.;
97 if (limit == 0) {
98 return;
99 }
100
101 if (!pi) {
102 return;
103 }
104
105 size_t subrec_size = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->subrec_sizecxx . . $ $anonymous_type_4a7c1014017e4c5d_0#subrec_size.;
106 size_t n_subrecs = GRN_RSET_N_SUBRECScxx . . $ `lib/grn_rset.h:57:9`!(ri);
107 bytecxx . . $ byte# *body = (bytecxx . . $ byte# *)pi + DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->subrec_offsetcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#subrec_offset.;
108 if (limit < n_subrecs) {
109 if (GRN_RSET_SUBRECS_CMPcxx . . $ `lib/grn_rset.h:61:9`!(score, *((double *)(ri->subrecs)), dir) > 0) {
110 grn_rset_subrecs_replace_mincxx . . $ grn_rset_subrecs_replace_min(1afcb1895ec04f3f).((bytecxx . . $ byte# *)ri->subrecscxx . . $ $anonymous_type_cc21d51c44e8310a_0#subrecs.,
111 subrec_size,
112 limit,
113 score,
114 body,
115 dir);
116 }
117 } else {
118 grn_rset_subrecs_pushcxx . . $ grn_rset_subrecs_push(1afcb1895ec04f3f).((bytecxx . . $ byte# *)ri->subrecscxx . . $ $anonymous_type_cc21d51c44e8310a_0#subrecs.,
119 subrec_size,
120 n_subrecs,
121 score,
122 body,
123 dir);
124 }
125 }
126
127 uint32_tcxx . . $ uint32_t#
128 grn_rset_recinfo_calc_values_sizecxx . . $ grn_rset_recinfo_calc_values_size(30f4e46071c8b3c9).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_table_group_flagscxx . . $ grn_table_group_flags# flags)
129 {
130 uint32_tcxx . . $ uint32_t# size = 0;
131
132 if (flags & GRN_TABLE_GROUP_CALC_MAXcxx . . $ `include/groonga/table.h:724:9`!) {
133 size += GRN_RSET_MAX_SIZEcxx . . $ `lib/grn_rset.h:50:9`!;
134 }
135 if (flags & GRN_TABLE_GROUP_CALC_MINcxx . . $ `include/groonga/table.h:725:9`!) {
136 size += GRN_RSET_MIN_SIZEcxx . . $ `lib/grn_rset.h:51:9`!;
137 }
138 if (flags & GRN_TABLE_GROUP_CALC_SUMcxx . . $ `include/groonga/table.h:726:9`!) {
139 size += GRN_RSET_SUM_SIZEcxx . . $ `lib/grn_rset.h:52:9`!;
140 }
141 if (flags & GRN_TABLE_GROUP_CALC_MEANcxx . . $ `include/groonga/table.h:729:9`!) {
142 size += GRN_RSET_MEAN_SIZEcxx . . $ `lib/grn_rset.h:53:9`!;
143 }
144
145 return size;
146 }
147
148 typedef structcxx . . $ $anonymous_type_5151e44b86ead79f_0# {
149 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ricxx . . $ $anonymous_type_5151e44b86ead79f_0#ri.;
150 bytecxx . . $ byte# *valuescxx . . $ $anonymous_type_5151e44b86ead79f_0#values.;
151 grn_table_group_flagscxx . . $ grn_table_group_flags# flagscxx . . $ $anonymous_type_5151e44b86ead79f_0#flags.;
152 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_float_sourcecxx . . $ $anonymous_type_5151e44b86ead79f_0#is_float_source.;
153 grn_objcxx . . $ grn_obj# value_int64cxx . . $ $anonymous_type_5151e44b86ead79f_0#value_int64.;
154 grn_objcxx . . $ grn_obj# value_floatcxx . . $ $anonymous_type_5151e44b86ead79f_0#value_float.;
155 } grn_rset_recinfo_update_calc_values_datacxx . . $ grn_rset_recinfo_update_calc_values_data#;
156
157 static void
158 grn_rset_recinfo_update_calc_values_bulkcxx . . $ grn_rset_recinfo_update_calc_values_bulk(80dc3f8360b73149).(
159 grn_ctxcxx . . $ grn_ctx# *ctx,
160 grn_rset_recinfo_update_calc_values_datacxx . . $ grn_rset_recinfo_update_calc_values_data# *data,
161 grn_objcxx . . $ grn_obj# *value,
162 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_first_value)
163 {
164 grn_objcxx . . $ grn_obj# *value_int64 = &(data->value_int64cxx . . $ $anonymous_type_5151e44b86ead79f_0#value_int64.);
165 grn_objcxx . . $ grn_obj# *value_float = &(data->value_floatcxx . . $ $anonymous_type_5151e44b86ead79f_0#value_float.);
166 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! need_int64_value = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
167 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! need_float_value = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
168
169 if (data->flagscxx . . $ $anonymous_type_5151e44b86ead79f_0#flags. & (GRN_TABLE_GROUP_CALC_MAXcxx . . $ `include/groonga/table.h:724:9`! |
170 GRN_TABLE_GROUP_CALC_MINcxx . . $ `include/groonga/table.h:725:9`! |
171 GRN_TABLE_GROUP_CALC_SUMcxx . . $ `include/groonga/table.h:726:9`!)) {
172 if (data->is_float_sourcecxx . . $ $anonymous_type_5151e44b86ead79f_0#is_float_source.) {
173 need_float_value = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
174 } else {
175 need_int64_value = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
176 }
177 }
178 if (data->flagscxx . . $ $anonymous_type_5151e44b86ead79f_0#flags. & GRN_TABLE_GROUP_CALC_MEANcxx . . $ `include/groonga/table.h:729:9`!) {
179 need_float_value = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
180 }
181 if (need_int64_value) {
182 GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(value_int64);
183 grn_obj_castcxx . . $ grn_obj_cast(a6fd93da1614eccd).(ctx, value, value_int64, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!);
184 }
185 if (need_float_value) {
186 GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(value_float);
187 grn_obj_castcxx . . $ grn_obj_cast(a6fd93da1614eccd).(ctx, value, value_float, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!);
188 }
189
190 bytecxx . . $ byte# *values = data->valuescxx . . $ $anonymous_type_5151e44b86ead79f_0#values.;
191 if (data->flagscxx . . $ $anonymous_type_5151e44b86ead79f_0#flags. & GRN_TABLE_GROUP_CALC_MAXcxx . . $ `include/groonga/table.h:724:9`!) {
192 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *current_max = (grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *)values;
193 if (data->is_float_sourcecxx . . $ $anonymous_type_5151e44b86ead79f_0#is_float_source.) {
194 double value_raw = GRN_FLOAT_VALUEcxx . . $ `include/groonga/groonga.h:3108:9`!(value_float);
195 if (is_first_value || value_raw > current_max->value_doublecxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_double.) {
196 current_max->value_doublecxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_double. = value_raw;
197 }
198 } else {
199 int64_tcxx . . $ int64_t# value_raw = GRN_INT64_VALUEcxx . . $ `include/groonga/groonga.h:3104:9`!(value_int64);
200 if (is_first_value || value_raw > current_max->value_int64cxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_int64.) {
201 current_max->value_int64cxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_int64. = value_raw;
202 }
203 }
204 values += GRN_RSET_MAX_SIZEcxx . . $ `lib/grn_rset.h:50:9`!;
205 }
206 if (data->flagscxx . . $ $anonymous_type_5151e44b86ead79f_0#flags. & GRN_TABLE_GROUP_CALC_MINcxx . . $ `include/groonga/table.h:725:9`!) {
207 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *current_min = (grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *)values;
208 if (data->is_float_sourcecxx . . $ $anonymous_type_5151e44b86ead79f_0#is_float_source.) {
209 double value_raw = GRN_FLOAT_VALUEcxx . . $ `include/groonga/groonga.h:3108:9`!(value_float);
210 if (is_first_value || value_raw < current_min->value_doublecxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_double.) {
211 current_min->value_doublecxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_double. = value_raw;
212 }
213 } else {
214 int64_tcxx . . $ int64_t# value_raw = GRN_INT64_VALUEcxx . . $ `include/groonga/groonga.h:3104:9`!(value_int64);
215 if (is_first_value || value_raw < current_min->value_int64cxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_int64.) {
216 current_min->value_int64cxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_int64. = value_raw;
217 }
218 }
219 values += GRN_RSET_MIN_SIZEcxx . . $ `lib/grn_rset.h:51:9`!;
220 }
221 if (data->flagscxx . . $ $anonymous_type_5151e44b86ead79f_0#flags. & GRN_TABLE_GROUP_CALC_SUMcxx . . $ `include/groonga/table.h:726:9`!) {
222 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *current_sum = (grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *)values;
223 if (data->is_float_sourcecxx . . $ $anonymous_type_5151e44b86ead79f_0#is_float_source.) {
224 double value_raw = GRN_FLOAT_VALUEcxx . . $ `include/groonga/groonga.h:3108:9`!(value_float);
225 current_sum->value_doublecxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_double. += value_raw;
226 } else {
227 int64_tcxx . . $ int64_t# value_raw = GRN_INT64_VALUEcxx . . $ `include/groonga/groonga.h:3104:9`!(value_int64);
228 current_sum->value_int64cxx . . $ $anonymous_type_cc21d51c44e8310a_2#value_int64. += value_raw;
229 }
230 values += GRN_RSET_SUM_SIZEcxx . . $ `lib/grn_rset.h:52:9`!;
231 }
232 if (data->flagscxx . . $ $anonymous_type_5151e44b86ead79f_0#flags. & GRN_TABLE_GROUP_CALC_MEANcxx . . $ `include/groonga/table.h:729:9`!) {
233 double *current_mean = (double *)values;
234 uint64_tcxx . . $ uint64_t# *n_values = (uint64_tcxx . . $ uint64_t# *)(((double *)values) + 1);
235 double value_raw = GRN_FLOAT_VALUEcxx . . $ `include/groonga/groonga.h:3108:9`!(value_float);
236 (*n_values)++;
237 *current_mean += (value_raw - *current_mean) / (double)(*n_values);
238 values += GRN_RSET_MEAN_SIZEcxx . . $ `lib/grn_rset.h:53:9`!;
239 }
240 }
241
242 static void
243 grn_rset_recinfo_update_calc_values_uvectorcxx . . $ grn_rset_recinfo_update_calc_values_uvector(8209ae2ef84fad73).(
244 grn_ctxcxx . . $ grn_ctx# *ctx,
245 grn_rset_recinfo_update_calc_values_datacxx . . $ grn_rset_recinfo_update_calc_values_data# *data,
246 grn_objcxx . . $ grn_obj# *value)
247 {
248 grn_objcxx . . $ grn_obj# element_value;
249 unsigned int element_size;
250 size_t i, n_elements;
251
252 element_size = grn_uvector_element_sizecxx . . $ grn_uvector_element_size(8dd58acc9865e889).(ctx, value);
253 if (element_size == 0) {
254 return;
255 }
256
257 GRN_VALUE_FIX_SIZE_INITcxx . . $ `include/groonga/groonga.h:2738:9`!(&element_value, 0, value->header.domain);
258 n_elements = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, value);
259 for (i = 0; i < n_elements; i++) {
260 GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(&element_value);
261 grn_bulk_writecxx . . $ grn_bulk_write(4609c18fd87cf054).(ctx,
262 &element_value,
263 GRN_BULK_HEADcxx . . $ `include/groonga/groonga.h:2648:9`!(value) + (element_size * i),
264 element_size);
265 const boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_first_value = (data->ricxx . . $ $anonymous_type_5151e44b86ead79f_0#ri.->n_subrecscxx . . $ $anonymous_type_cc21d51c44e8310a_0#n_subrecs. == 1 && i == 0);
266 grn_rset_recinfo_update_calc_values_bulkcxx . . $ grn_rset_recinfo_update_calc_values_bulk(80dc3f8360b73149).(ctx,
267 data,
268 &element_value,
269 is_first_value);
270 }
271 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &element_value);
272 }
273
274 void
275 grn_rset_recinfo_update_calc_valuescxx . . $ grn_rset_recinfo_update_calc_values(d160979e3161d1e5).(grn_ctxcxx . . $ grn_ctx# *ctx,
276 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
277 grn_objcxx . . $ grn_obj# *table,
278 grn_objcxx . . $ grn_obj# *value)
279 {
280 grn_rset_recinfo_update_calc_values_datacxx . . $ grn_rset_recinfo_update_calc_values_data# data;
281
282 data.ricxx . . $ $anonymous_type_5151e44b86ead79f_0#ri. = ri;
283 data.valuescxx . . $ $anonymous_type_5151e44b86ead79f_0#values. = (((bytecxx . . $ byte# *)ri->subrecscxx . . $ $anonymous_type_cc21d51c44e8310a_0#subrecs.) +
284 GRN_RSET_SUBRECS_SIZEcxx . . $ `lib/grn_rset.h:66:9`!(DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->subrec_size,
285 DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->max_n_subrecs));
286 data.flagscxx . . $ $anonymous_type_5151e44b86ead79f_0#flags. = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->groupcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#group..flagscxx . . $ $anonymous_type_4a7c1014017e4c5d_0#$anonymous_type_1#flags.;
287 data.is_float_sourcecxx . . $ $anonymous_type_5151e44b86ead79f_0#is_float_source. =
288 (DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->groupcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#group..aggregated_value_type_idcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#$anonymous_type_1#aggregated_value_type_id. == GRN_DB_FLOATcxx . . $ GRN_DB_FLOAT.);
289 GRN_INT64_INITcxx . . $ `include/groonga/groonga.h:2856:9`!(&(data.value_int64), 0);
290 GRN_FLOAT_INITcxx . . $ `include/groonga/groonga.h:2864:9`!(&(data.value_float), 0);
291
292 switch (value->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
293 case GRN_BULKcxx . . $ `include/groonga/groonga.h:868:9`! :
294 grn_rset_recinfo_update_calc_values_bulkcxx . . $ grn_rset_recinfo_update_calc_values_bulk(80dc3f8360b73149).(ctx,
295 &data,
296 value,
297 ri->n_subrecscxx . . $ $anonymous_type_cc21d51c44e8310a_0#n_subrecs. == 1);
298 break;
299 case GRN_UVECTORcxx . . $ `include/groonga/groonga.h:875:9`! :
300 grn_rset_recinfo_update_calc_values_uvectorcxx . . $ grn_rset_recinfo_update_calc_values_uvector(8209ae2ef84fad73).(ctx, &data, value);
301 break;
302 default :
303 break;
304 }
305
306 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(data.value_float));
307 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(data.value_int64));
308 }
309
310 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *
311 grn_rset_recinfo_get_max_cxx . . $ grn_rset_recinfo_get_max_(29d30f31e781d407).(grn_ctxcxx . . $ grn_ctx# *ctx,
312 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
313 grn_objcxx . . $ grn_obj# *table)
314 {
315 const grn_table_group_flagscxx . . $ grn_table_group_flags# flags = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->groupcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#group..flagscxx . . $ $anonymous_type_4a7c1014017e4c5d_0#$anonymous_type_1#flags.;
316 if (!(flags & GRN_TABLE_GROUP_CALC_MAXcxx . . $ `include/groonga/table.h:724:9`!)) {
317 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
318 }
319
320 bytecxx . . $ byte# *values = (((bytecxx . . $ byte# *)ri->subrecscxx . . $ $anonymous_type_cc21d51c44e8310a_0#subrecs.) +
321 GRN_RSET_SUBRECS_SIZEcxx . . $ `lib/grn_rset.h:66:9`!(DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->subrec_size,
322 DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->max_n_subrecs));
323 return (grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *)values;
324 }
325
326 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value#
327 grn_rset_recinfo_get_maxcxx . . $ grn_rset_recinfo_get_max(4d5d00189b196bd0).(grn_ctxcxx . . $ grn_ctx# *ctx,
328 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
329 grn_objcxx . . $ grn_obj# *table)
330 {
331 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *max_address;
332
333 max_address = grn_rset_recinfo_get_max_cxx . . $ grn_rset_recinfo_get_max_(29d30f31e781d407).(ctx, ri, table);
334 if (max_address) {
335 return *max_address;
336 } else {
337 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# value = {0};
338 return value;
339 }
340 }
341
342 void
343 grn_rset_recinfo_set_maxcxx . . $ grn_rset_recinfo_set_max(8ce3fda028077970).(grn_ctxcxx . . $ grn_ctx# *ctx,
344 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
345 grn_objcxx . . $ grn_obj# *table,
346 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# max)
347 {
348 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *max_address =
349 grn_rset_recinfo_get_max_cxx . . $ grn_rset_recinfo_get_max_(29d30f31e781d407).(ctx, ri, table);
350 if (!max_address) {
351 return;
352 }
353 *max_address = max;
354 }
355
356 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *
357 grn_rset_recinfo_get_min_cxx . . $ grn_rset_recinfo_get_min_(29d30f31e781d407).(grn_ctxcxx . . $ grn_ctx# *ctx,
358 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
359 grn_objcxx . . $ grn_obj# *table)
360 {
361 const grn_table_group_flagscxx . . $ grn_table_group_flags# flags = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->groupcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#group..flagscxx . . $ $anonymous_type_4a7c1014017e4c5d_0#$anonymous_type_1#flags.;
362 if (!(flags & GRN_TABLE_GROUP_CALC_MINcxx . . $ `include/groonga/table.h:725:9`!)) {
363 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
364 }
365
366 bytecxx . . $ byte# *values = (((bytecxx . . $ byte# *)ri->subrecscxx . . $ $anonymous_type_cc21d51c44e8310a_0#subrecs.) +
367 GRN_RSET_SUBRECS_SIZEcxx . . $ `lib/grn_rset.h:66:9`!(DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->subrec_size,
368 DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->max_n_subrecs));
369
370 if (flags & GRN_TABLE_GROUP_CALC_MAXcxx . . $ `include/groonga/table.h:724:9`!) {
371 values += GRN_RSET_MAX_SIZEcxx . . $ `lib/grn_rset.h:50:9`!;
372 }
373
374 return (grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *)values;
375 }
376
377 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value#
378 grn_rset_recinfo_get_mincxx . . $ grn_rset_recinfo_get_min(4d5d00189b196bd0).(grn_ctxcxx . . $ grn_ctx# *ctx,
379 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
380 grn_objcxx . . $ grn_obj# *table)
381 {
382 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *min_address =
383 grn_rset_recinfo_get_min_cxx . . $ grn_rset_recinfo_get_min_(29d30f31e781d407).(ctx, ri, table);
384 if (min_address) {
385 return *min_address;
386 } else {
387 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# value = {0};
388 return value;
389 }
390 }
391
392 void
393 grn_rset_recinfo_set_mincxx . . $ grn_rset_recinfo_set_min(8ce3fda028077970).(grn_ctxcxx . . $ grn_ctx# *ctx,
394 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
395 grn_objcxx . . $ grn_obj# *table,
396 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# min)
397 {
398 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *min_address =
399 grn_rset_recinfo_get_min_cxx . . $ grn_rset_recinfo_get_min_(29d30f31e781d407).(ctx, ri, table);
400 if (!min_address) {
401 return;
402 }
403 *min_address = min;
404 }
405
406 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *
407 grn_rset_recinfo_get_sum_cxx . . $ grn_rset_recinfo_get_sum_(29d30f31e781d407).(grn_ctxcxx . . $ grn_ctx# *ctx,
408 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
409 grn_objcxx . . $ grn_obj# *table)
410 {
411 const grn_table_group_flagscxx . . $ grn_table_group_flags# flags = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->groupcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#group..flagscxx . . $ $anonymous_type_4a7c1014017e4c5d_0#$anonymous_type_1#flags.;
412 if (!(flags & GRN_TABLE_GROUP_CALC_SUMcxx . . $ `include/groonga/table.h:726:9`!)) {
413 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
414 }
415
416 bytecxx . . $ byte# *values = (((bytecxx . . $ byte# *)ri->subrecscxx . . $ $anonymous_type_cc21d51c44e8310a_0#subrecs.) +
417 GRN_RSET_SUBRECS_SIZEcxx . . $ `lib/grn_rset.h:66:9`!(DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->subrec_size,
418 DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->max_n_subrecs));
419
420 if (flags & GRN_TABLE_GROUP_CALC_MAXcxx . . $ `include/groonga/table.h:724:9`!) {
421 values += GRN_RSET_MAX_SIZEcxx . . $ `lib/grn_rset.h:50:9`!;
422 }
423 if (flags & GRN_TABLE_GROUP_CALC_MINcxx . . $ `include/groonga/table.h:725:9`!) {
424 values += GRN_RSET_MIN_SIZEcxx . . $ `lib/grn_rset.h:51:9`!;
425 }
426
427 return (grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *)values;
428 }
429
430 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value#
431 grn_rset_recinfo_get_sumcxx . . $ grn_rset_recinfo_get_sum(4d5d00189b196bd0).(grn_ctxcxx . . $ grn_ctx# *ctx,
432 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
433 grn_objcxx . . $ grn_obj# *table)
434 {
435 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *sum_address =
436 grn_rset_recinfo_get_sum_cxx . . $ grn_rset_recinfo_get_sum_(29d30f31e781d407).(ctx, ri, table);
437 if (sum_address) {
438 return *sum_address;
439 } else {
440 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# value = {0};
441 return value;
442 }
443 }
444
445 void
446 grn_rset_recinfo_set_sumcxx . . $ grn_rset_recinfo_set_sum(8ce3fda028077970).(grn_ctxcxx . . $ grn_ctx# *ctx,
447 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
448 grn_objcxx . . $ grn_obj# *table,
449 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# sum)
450 {
451 grn_rset_aggregated_valuecxx . . $ grn_rset_aggregated_value# *sum_address =
452 grn_rset_recinfo_get_sum_cxx . . $ grn_rset_recinfo_get_sum_(29d30f31e781d407).(ctx, ri, table);
453 if (!sum_address) {
454 return;
455 }
456 *sum_address = sum;
457 }
458
459 double *
460 grn_rset_recinfo_get_mean_cxx . . $ grn_rset_recinfo_get_mean_(91a0039b47361b06).(grn_ctxcxx . . $ grn_ctx# *ctx,
461 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
462 grn_objcxx . . $ grn_obj# *table)
463 {
464 const grn_table_group_flagscxx . . $ grn_table_group_flags# flags = DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->groupcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#group..flagscxx . . $ $anonymous_type_4a7c1014017e4c5d_0#$anonymous_type_1#flags.;
465 if (!(flags & GRN_TABLE_GROUP_CALC_MEANcxx . . $ `include/groonga/table.h:729:9`!)) {
466 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
467 }
468
469 bytecxx . . $ byte# *values = (((bytecxx . . $ byte# *)ri->subrecscxx . . $ $anonymous_type_cc21d51c44e8310a_0#subrecs.) +
470 GRN_RSET_SUBRECS_SIZEcxx . . $ `lib/grn_rset.h:66:9`!(DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->subrec_size,
471 DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->max_n_subrecs));
472
473 if (flags & GRN_TABLE_GROUP_CALC_MAXcxx . . $ `include/groonga/table.h:724:9`!) {
474 values += GRN_RSET_MAX_SIZEcxx . . $ `lib/grn_rset.h:50:9`!;
475 }
476 if (flags & GRN_TABLE_GROUP_CALC_MINcxx . . $ `include/groonga/table.h:725:9`!) {
477 values += GRN_RSET_MIN_SIZEcxx . . $ `lib/grn_rset.h:51:9`!;
478 }
479 if (flags & GRN_TABLE_GROUP_CALC_SUMcxx . . $ `include/groonga/table.h:726:9`!) {
480 values += GRN_RSET_SUM_SIZEcxx . . $ `lib/grn_rset.h:52:9`!;
481 }
482
483 return (double *)values;
484 }
485
486 double
487 grn_rset_recinfo_get_meancxx . . $ grn_rset_recinfo_get_mean(6fa2d70f23f65159).(grn_ctxcxx . . $ grn_ctx# *ctx,
488 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
489 grn_objcxx . . $ grn_obj# *table)
490 {
491 double *mean_address = grn_rset_recinfo_get_mean_cxx . . $ grn_rset_recinfo_get_mean_(91a0039b47361b06).(ctx, ri, table);
492 if (mean_address) {
493 return *mean_address;
494 } else {
495 return 0;
496 }
497 }
498
499 void
500 grn_rset_recinfo_set_meancxx . . $ grn_rset_recinfo_set_mean(5607c5dbd568d2ff).(grn_ctxcxx . . $ grn_ctx# *ctx,
501 grn_rset_recinfocxx . . $ grn_rset_recinfo# *ri,
502 grn_objcxx . . $ grn_obj# *table,
503 double mean)
504 {
505 double *mean_address = grn_rset_recinfo_get_mean_cxx . . $ grn_rset_recinfo_get_mean_(91a0039b47361b06).(ctx, ri, table);
506 if (!mean_address) {
507 return;
508 }
509 *mean_address = mean;
510 }