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

Function sdata_from_svec

methods/svec/src/pg_gp/sparse_vector.h:67–82  ·  view source on GitHub ↗

* This routine supplies a pointer to a SparseData derived from an SvecType. * The SvecType is a serialized structure with fixed memory allocations, so * care must be taken not to append to the embedded StringInfo structs * without re-serializing the SparseData into the SvecType. */

Source from the content-addressed store, hash-verified

65 * without re-serializing the SparseData into the SvecType.
66 */
67static inline SparseData sdata_from_svec(SvecType *svec)
68{
69 char *sdataptr = SVEC_SDATAPTR(svec);
70 SparseData sdata = (SparseData)sdataptr;
71 sdata->vals = (StringInfo)SDATA_DATA_SINFO(sdataptr);
72 sdata->index = (StringInfo)SDATA_INDEX_SINFO(sdataptr);
73 sdata->vals->data = SVEC_VALS_PTR(svec);
74 if (sdata->index->maxlen == 0)
75 {
76 sdata->index->data = NULL;
77 } else
78 {
79 sdata->index->data = SVEC_INDEX_PTR(svec);
80 }
81 return(sdata);
82}
83
84static inline void printout_svec(SvecType *svec, char *msg, int stop);
85static inline void printout_svec(SvecType *svec, char *msg, int stop)

Callers 15

svec_unnestFunction · 0.85
svec_lapplyFunction · 0.85
svec_appendFunction · 0.85
svec_projFunction · 0.85
svec_subvecFunction · 0.85
svec_reverseFunction · 0.85
svec_changeFunction · 0.85
svec_eq_non_zeroFunction · 0.85
svec_containsFunction · 0.85
svec_countFunction · 0.85
svec_l2normFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected