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

Function svec_proj

methods/svec_util/src/pg_gp/svec_util.c:256–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254Datum svec_proj(PG_FUNCTION_ARGS);
255PG_FUNCTION_INFO_V1( svec_proj );
256Datum svec_proj(PG_FUNCTION_ARGS)
257{
258 if (PG_ARGISNULL(0))
259 PG_RETURN_NULL();
260
261 SvecType * sv = PG_GETARG_SVECTYPE_P(0);
262 int idx = PG_GETARG_INT32(1);
263
264 SparseData in = sdata_from_svec(sv);
265 double ret = sd_proj(in,idx);
266
267 if (IS_NVP(ret)) PG_RETURN_NULL();
268
269 PG_RETURN_FLOAT8(sd_proj(in,idx));
270}
271
272/**
273 * svec_subvec - computes a subvector of an svec

Callers

nothing calls this directly

Calls 2

sdata_from_svecFunction · 0.85
sd_projFunction · 0.85

Tested by

no test coverage detected