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

Function array_cos

methods/array_ops/src/pg_gp/array_ops.c:845–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843 */
844PG_FUNCTION_INFO_V1(array_cos);
845Datum
846array_cos(PG_FUNCTION_ARGS){
847 if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); }
848
849 ArrayType *v1 = PG_GETARG_ARRAYTYPE_P(0);
850 Oid element_type = ARR_ELEMTYPE(v1);
851 Datum v2 = float8_datum_cast(0, element_type);
852
853 ArrayType *res = General_Array_to_Array(v1, v2, element_cos);
854
855 PG_FREE_IF_COPY(v1, 0);
856
857 PG_RETURN_ARRAYTYPE_P(res);
858}
859
860/*
861 * This function multiplies the specified value to each element.

Callers

nothing calls this directly

Calls 2

float8_datum_castFunction · 0.85
General_Array_to_ArrayFunction · 0.85

Tested by

no test coverage detected