MCPcopy Create free account
hub / github.com/VexDB-THU/VexDB-Lite / floatvector_send

Function floatvector_send

vexdb_pg/src/floatvector.cpp:333–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331 */
332PG_FUNCTION_INFO_V1(floatvector_send);
333Datum floatvector_send(PG_FUNCTION_ARGS)
334{
335 FloatVector *vec = PG_GETARG_FLOATVECTOR_P(0);
336 StringInfoData buf;
337 pq_begintypsend(&buf);
338 pq_sendint(&buf, vec->dim, sizeof(int16));
339 pq_sendint(&buf, vec->unused, sizeof(int16));
340 for (int16 i = 0; i < vec->dim; ++i) {
341 pq_sendfloat4(&buf, vec->x[i]);
342 }
343 PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
344}
345
346/*
347 * Convert vector to vector

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected