MCPcopy Create free account
hub / github.com/apache/cloudberry / mda_get_prod

Function mda_get_prod

src/backend/utils/adt/arrayutils.c:158–166  ·  view source on GitHub ↗

* Compute products of array dimensions, ie, scale factors for subscripts * * We assume caller has validated dimensions, so overflow is impossible */

Source from the content-addressed store, hash-verified

156 * We assume caller has validated dimensions, so overflow is impossible
157 */
158void
159mda_get_prod(int n, const int *range, int *prod)
160{
161 int i;
162
163 prod[n - 1] = 1;
164 for (i = n - 2; i >= 0; i--)
165 prod[i] = prod[i + 1] * range[i + 1];
166}
167
168/*
169 * From products of whole-array dimensions and spans of a sub-array,

Callers 4

ReadArrayStrFunction · 0.85
array_slice_sizeFunction · 0.85
array_extract_sliceFunction · 0.85
array_insert_sliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected