BitVecMatcher* BitVecMatcher_init(BitVecMatcher *self, BitVector *bit_vector) { BitVecMatcherIVARS *const ivars = BitVecMatcher_IVARS(self); Matcher_init((Matcher*)self); ivars->bit_vec = (BitVector*)INCREF(bit_vector); ivars->doc_id = 0; return self; }
BitVecMatcher* BitVecMatcher_init(BitVecMatcher *self, BitVector *bit_vector) { Matcher_init((Matcher*)self); self->bit_vec = (BitVector*)INCREF(bit_vector); self->doc_id = 0; return self; }
MatchAllScorer* MatchAllScorer_init(MatchAllScorer *self, float score, i32_t doc_max) { Matcher_init((Matcher*)self); self->doc_id = 0; self->score = score; self->doc_max = doc_max; return self; }
MockMatcher* MockMatcher_init(MockMatcher *self, I32Array *doc_ids, ByteBuf *scores) { Matcher_init((Matcher*)self); MockMatcherIVARS *const ivars = MockMatcher_IVARS(self); ivars->tick = -1; ivars->size = I32Arr_Get_Size(doc_ids); ivars->doc_ids = (I32Array*)INCREF(doc_ids); ivars->scores = (ByteBuf*)INCREF(scores); return self; }
PolyMatcher* PolyMatcher_init(PolyMatcher *self, VArray *children, Similarity *similarity) { u32_t i; Matcher_init((Matcher*)self); self->num_kids = VA_Get_Size(children); self->sim = similarity ? (Similarity*)INCREF(similarity) : NULL; self->children = (VArray*)INCREF(children); self->coord_factors = MALLOCATE(self->num_kids + 1, float); for (i = 0; i <= self->num_kids; i++) { self->coord_factors[i] = similarity ? Sim_Coord(similarity, i, self->num_kids) : 1.0f; } return self; }
RangeMatcher* RangeMatcher_init(RangeMatcher *self, int32_t lower_bound, int32_t upper_bound, SortCache *sort_cache, int32_t doc_max) { Matcher_init((Matcher*)self); // Init. self->doc_id = 0; // Assign. self->lower_bound = lower_bound; self->upper_bound = upper_bound; self->sort_cache = (SortCache*)INCREF(sort_cache); self->doc_max = doc_max; // Derive. return self; }
SeriesMatcher* SeriesMatcher_init(SeriesMatcher *self, VArray *matchers, I32Array *offsets) { Matcher_init((Matcher*)self); /* Init. */ self->current_matcher = NULL; self->current_offset = 0; self->next_offset = 0; self->doc_id = 0; self->tick = 0; /* Assign. */ self->matchers = (VArray*)INCREF(matchers); self->offsets = (I32Array*)INCREF(offsets); /* Derive. */ self->num_matchers = (i32_t)I32Arr_Get_Size(offsets); return self; }