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

Function element_op

methods/array_ops/src/pg_gp/array_ops.c:1254–1272  ·  view source on GitHub ↗

* Template for element-wise help functions */

Source from the content-addressed store, hash-verified

1252 * Template for element-wise help functions
1253 */
1254static
1255inline
1256Datum
1257element_op(Datum element, Oid elt_type, Datum result,
1258 Oid result_type, Datum opt_elt, Oid opt_type,
1259 float8 (*op)(float8, float8, float8)) {
1260 if (op == float8_div &&
1261 (result_type == INT2OID ||
1262 result_type == INT4OID ||
1263 result_type == INT8OID)) {
1264 int64 num = datum_int64_cast(element, elt_type);
1265 int64 denom = datum_int64_cast(opt_elt, opt_type);
1266 return int64_datum_cast(int64_div(num, denom), result_type);
1267 }
1268 float8 elt = datum_float8_cast(element, elt_type );
1269 float8 res = datum_float8_cast(result , result_type);
1270 float8 opt = datum_float8_cast(opt_elt, opt_type );
1271 return float8_datum_cast((*op)(elt, res, opt), result_type);
1272}
1273
1274
1275// ------------------------------------------------------------------------

Callers 15

element_diffFunction · 0.85
element_abs_sumFunction · 0.85
element_sumFunction · 0.85
element_minFunction · 0.85
element_maxFunction · 0.85
element_dotFunction · 0.85
element_containsFunction · 0.85
element_setFunction · 0.85
element_cosFunction · 0.85
element_addFunction · 0.85
element_subFunction · 0.85
element_multFunction · 0.85

Calls 5

datum_int64_castFunction · 0.85
int64_datum_castFunction · 0.85
int64_divFunction · 0.85
datum_float8_castFunction · 0.85
float8_datum_castFunction · 0.85

Tested by

no test coverage detected