cormr_rank(3)corm

NAME

cormr_rank - Ranking loop

SYNOPSIS

Typedefs

typedef int(* cormr_score_fn) (void *ud, cormr_ref_t r, float *score)

Functions

cormr_rank_t * cormr_rank_new (size_t top_k, float min_score)
void cormr_rank_push (cormr_rank_t *rk, cormr_ref_t r, float score)
size_t cormr_rank_sorted (const cormr_rank_t *rk, cormr_ref_t *refs, float *scores)
void cormr_rank_free (cormr_rank_t *rk)

Detailed Description

Typedef Documentation

typedef int(* cormr_score_fn) (void *ud, cormr_ref_t r, float *score)

Score function over a ref. Returns 0 on success, nonzero on failure (ref skipped). score is written regardless on success.

Function Documentation

void cormr_rank_free (cormr_rank_t * rk)

Release the ranking buffer.

cormr_rank_t * cormr_rank_new (size_t top_k, float min_score)

Create a ranking buffer bounded to top_k results (top_k == 0 โ†’ NULL). min_score drops refs below the threshold at push time.

void cormr_rank_push (cormr_rank_t * rk, cormr_ref_t r, float score)

Stream a scored candidate into the buffer. O(log top_k) when bounded.

size_t cormr_rank_sorted (const cormr_rank_t * rk, cormr_ref_t * refs, float * scores)

Write the retained results sorted best-first (desc score; ties by asc ref) into caller arrays sized >= top_k. Returns the count written.

Author

Generated automatically by Doxygen for corm from the source code.