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

Function svec_l1norm

methods/svec_util/src/pg_gp/svec_util.c:585–595  ·  view source on GitHub ↗

* svec_l1norm - computes the l1 norm of an svec */

Source from the content-addressed store, hash-verified

583 * svec_l1norm - computes the l1 norm of an svec
584 */
585Datum svec_l1norm(PG_FUNCTION_ARGS)
586{
587 SvecType *svec = PG_GETARG_SVECTYPE_P(0);
588 SparseData sdata = sdata_from_svec(svec);
589 double accum;
590 accum = l1norm_sdata_values_double(sdata);
591
592 if (IS_NVP(accum)) PG_RETURN_NULL();
593
594 PG_RETURN_FLOAT8(accum);
595}
596
597PG_FUNCTION_INFO_V1( svec_summate );
598/**

Callers

nothing calls this directly

Calls 2

sdata_from_svecFunction · 0.85

Tested by

no test coverage detected