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

Function element_argmax

methods/array_ops/src/pg_gp/array_ops.c:1327–1340  ·  view source on GitHub ↗

* Return max(element, index). */

Source from the content-addressed store, hash-verified

1325 * Return max(element, index).
1326 */
1327static
1328inline
1329void*
1330element_argmax(Datum element, Oid elt_type, int elt_index, void *result) {
1331 Assert(result);
1332 value_index *vi = (value_index *)result;
1333 float8 elt = datum_float8_cast(element, elt_type);
1334 if (elt > vi->value) {
1335 vi->value = elt;
1336 vi->index = elt_index;
1337 }
1338
1339 return vi;
1340}
1341
1342/*
1343 * Return min(element, index).

Callers

nothing calls this directly

Calls 1

datum_float8_castFunction · 0.85

Tested by

no test coverage detected