cormr_set(3)corm

NAME

cormr_set - Candidate sets

SYNOPSIS

Enumerations

enum cormr_set_exactness { CORMR_SET_EXACT = 0, CORMR_SET_APPROX = 1 }

Functions

cormr_set_t * cormr_set_new (void)
void cormr_set_push (cormr_set_t *s, cormr_ref_t r)
void cormr_set_seal (cormr_set_t *s)
int cormr_set_drain (cormr_set_t *s, uint32_t hd)
int cormr_set_intersect (cormr_set_t *dst, const cormr_set_t *a, const cormr_set_t *b)
int cormr_set_subtract (cormr_set_t *dst, const cormr_set_t *a, const cormr_set_t *b)
int cormr_set_union (cormr_set_t *dst, const cormr_set_t *a, const cormr_set_t *b)
size_t cormr_set_count (const cormr_set_t *s)
const cormr_ref_t * cormr_set_at (const cormr_set_t *s)
void cormr_set_free (cormr_set_t *s)
int cormr_set_approx (cormr_set_t *s, int approx, float recall_bound)
int cormr_set_is_approx (const cormr_set_t *s)
float cormr_set_bound (const cormr_set_t *s)

Detailed Description

Enumeration Type Documentation

enum cormr_set_exactness

Exactness of a filled set. Approximate fills (e.g. ANN neighbors) must declare themselves: intersecting with an approximate set bounds final recall by the approximate one. Default for every set: exact, bound 1.0.

Enumerator

CORMR_SET_EXACT
every matching ref is reported
CORMR_SET_APPROX
bounded candidate window m; owed recall@k < 1

Function Documentation

int cormr_set_approx (cormr_set_t * s, int approx, float recall_bound)

Mark the set approximate/exact and its owed recall@k bound (0 < bound <= 1). Exact sets carry bound 1.0. Returns 0 on success, -1 when the set is NULL or the bound is outside (0,1] (the flag is left unchanged). Joins propagate exactness: intersect/union produce an approximate set when either operand is (bound = min); subtract keeps the left operand's flag and bound (the result is a subset of it).

const cormr_ref_t * cormr_set_at (const cormr_set_t * s)

Get a pointer to the backing array (sealed โ†’ sorted, deduped).

float cormr_set_bound (const cormr_set_t * s)

Owed recall@k bound (default 1.0 for exact sets).

size_t cormr_set_count (const cormr_set_t * s)

Number of refs currently held (works before and after sealing).

int cormr_set_drain (cormr_set_t * s, uint32_t hd)

Drain a corm handle's iteration into the set (keys must be fixed-length, <= 4 bytes; refs are read from the key bytes). Excludes nothing; call cormr_set_seal afterwards. Returns 0 on success, -1 if keys are variable length or wider than a ref.

void cormr_set_free (cormr_set_t * s)

Release the set's storage.

int cormr_set_intersect (cormr_set_t * dst, const cormr_set_t * a, const cormr_set_t * b)

dst := a โˆฉ b. a and b must be sealed; dst content is discarded.

int cormr_set_is_approx (const cormr_set_t * s)

1 if the set is approximate (CORMR_SET_APPROX), 0 if exact (default).

cormr_set_t * cormr_set_new (void )

Create an empty, unsorted set (arena-backed, grows on demand).

void cormr_set_push (cormr_set_t * s, cormr_ref_t r)

Append a ref. Unseals a previously sealed set.

void cormr_set_seal (cormr_set_t * s)

Sort + dedup in place. Joins require sealed inputs.

int cormr_set_subtract (cormr_set_t * dst, const cormr_set_t * a, const cormr_set_t * b)

dst := a โˆ’ b. a and b must be sealed; dst content is discarded.

int cormr_set_union (cormr_set_t * dst, const cormr_set_t * a, const cormr_set_t * b)

dst := a โˆช b. a and b must be sealed; dst content is discarded.

Author

Generated automatically by Doxygen for corm from the source code.