MCPcopy Create free account
hub / github.com/apache/madlib / element_argmin

Function element_argmin

methods/array_ops/src/pg_gp/array_ops.c:1345–1358  ·  view source on GitHub ↗

* Return min(element, index). */

Source from the content-addressed store, hash-verified

1343 * Return min(element, index).
1344 */
1345static
1346inline
1347void*
1348element_argmin(Datum element, Oid elt_type, int elt_index, void *result) {
1349 Assert(result);
1350 value_index *vi = (value_index *)result;
1351 float8 elt = datum_float8_cast(element, elt_type);
1352 if (elt < vi->value) {
1353 vi->value = elt;
1354 vi->index = elt_index;
1355 }
1356
1357 return vi;
1358}
1359
1360/*
1361 * Return max2(elt1, result).

Callers

nothing calls this directly

Calls 1

datum_float8_castFunction · 0.85

Tested by

no test coverage detected