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

Function floatvector_cmp_internal

vexdb_pg/src/floatvector.cpp:667–688  ·  view source on GitHub ↗

* Internal helper to compare floatvectors */

Source from the content-addressed store, hash-verified

665 * Internal helper to compare floatvectors
666 */
667static int floatvector_cmp_internal(FloatVector *a, FloatVector *b)
668{
669 int dim = Min(a->dim, b->dim);
670 for (int16 i = 0, imax = dim; i < imax; ++i) {
671 if (a->x[i] < b->x[i]) {
672 return -1;
673 }
674 if (a->x[i] > b->x[i]) {
675 return 1;
676 }
677 }
678
679 if (a->dim < b->dim) {
680 return -1;
681 }
682
683 if (a->dim > b->dim) {
684 return 1;
685 }
686
687 return 0;
688}
689
690PG_FUNCTION_INFO_V1(floatvector_lt);
691Datum floatvector_lt(PG_FUNCTION_ARGS)

Callers 8

floatvector_ltFunction · 0.85
floatvector_leFunction · 0.85
floatvector_eqFunction · 0.85
floatvector_neFunction · 0.85
floatvector_geFunction · 0.85
floatvector_gtFunction · 0.85
floatvector_cmpFunction · 0.85
floatvector_fastcmpFunction · 0.85

Calls 1

MinFunction · 0.85

Tested by

no test coverage detected