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

Function svec_summate

methods/svec_util/src/pg_gp/svec_util.c:601–611  ·  view source on GitHub ↗

* svec_summate - computes the sum of all the elements in an svec */

Source from the content-addressed store, hash-verified

599 * svec_summate - computes the sum of all the elements in an svec
600 */
601Datum svec_summate(PG_FUNCTION_ARGS)
602{
603 SvecType *svec = PG_GETARG_SVECTYPE_P(0);
604 SparseData sdata = sdata_from_svec(svec);
605 double accum;
606 accum = sum_sdata_values_double(sdata);
607
608 if (IS_NVP(accum)) PG_RETURN_NULL();
609
610 PG_RETURN_FLOAT8(accum);
611}
612
613PG_FUNCTION_INFO_V1( svec_log );
614/**

Callers

nothing calls this directly

Calls 2

sdata_from_svecFunction · 0.85
sum_sdata_values_doubleFunction · 0.85

Tested by

no test coverage detected