File Coverage

autogen/include/Lucy/Index/Similarity.h
Criterion Covered Total %
statement 2 2 100.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 2 2 100.0


line stmt bran cond sub pod time code
1            
2            
3            

perltidy

4            
 
5             /* * *********************************************** * * !!!! DO NOT EDIT !!!! * * This file was auto-generated by Build.PL. * * *********************************************** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef H_LUCY_INDEX_SIMILARITY #define H_LUCY_INDEX_SIMILARITY 1 #ifdef __cplusplus extern "C" { #endif #include "lucy_parcel.h" /* Include the header for this class's parent. */ #include "Clownfish/Obj.h" /* Define the struct layout for instances of this class. */ #ifdef C_LUCY_SIMILARITY extern uint32_t lucy_Sim_IVARS_OFFSET; typedef struct lucy_SimilarityIVARS lucy_SimilarityIVARS; static CFISH_INLINE lucy_SimilarityIVARS* lucy_Sim_IVARS(lucy_Similarity *self) { char *ptr = (char*)self + lucy_Sim_IVARS_OFFSET; return (lucy_SimilarityIVARS*)ptr; } #ifdef LUCY_USE_SHORT_NAMES #define SimilarityIVARS lucy_SimilarityIVARS #define Sim_IVARS lucy_Sim_IVARS #endif struct lucy_SimilarityIVARS { float* norm_decoder; }; #endif /* C_LUCY_SIMILARITY */ /* Declare this class's inert variables. */ /* Declare both this class's inert functions and the C functions which * implement this class's dynamic methods. */ LUCY_VISIBLE lucy_Similarity* lucy_Sim_new(void); LUCY_VISIBLE lucy_Similarity* lucy_Sim_init(lucy_Similarity* self); lucy_Posting* LUCY_Sim_Make_Posting_IMP(lucy_Similarity* self); lucy_PostingWriter* LUCY_Sim_Make_Posting_Writer_IMP(lucy_Similarity* self, lucy_Schema* schema, lucy_Snapshot* snapshot, lucy_Segment* segment, lucy_PolyReader* polyreader, int32_t field_num); float LUCY_Sim_TF_IMP(lucy_Similarity* self, float freq); float LUCY_Sim_IDF_IMP(lucy_Similarity* self, int64_t doc_freq, int64_t total_docs); float LUCY_Sim_Coord_IMP(lucy_Similarity* self, uint32_t overlap, uint32_t max_overlap); float LUCY_Sim_Length_Norm_IMP(lucy_Similarity* self, uint32_t num_tokens); float LUCY_Sim_Query_Norm_IMP(lucy_Similarity* self, float sum_of_squared_weights); uint8_t LUCY_Sim_Encode_Norm_IMP(lucy_Similarity* self, float f); float LUCY_Sim_Decode_Norm_IMP(lucy_Similarity* self, uint32_t input); float* LUCY_Sim_Get_Norm_Decoder_IMP(lucy_Similarity* self); void LUCY_Sim_Destroy_IMP(lucy_Similarity* self); cfish_Obj* LUCY_Sim_Dump_IMP(lucy_Similarity* self); lucy_Similarity* LUCY_Sim_Load_IMP(lucy_Similarity* self, cfish_Obj* dump); bool LUCY_Sim_Equals_IMP(lucy_Similarity* self, cfish_Obj* other); void LUCY_Sim_Serialize_IMP(lucy_Similarity* self, lucy_OutStream* outstream); lucy_Similarity* LUCY_Sim_Deserialize_IMP(lucy_Similarity* self, lucy_InStream* instream); /* Define typedefs for each dynamic method, allowing us to cast generic * pointers to the appropriate function pointer type more cleanly. */ typedef void* (*LUCY_Sim_To_Host_t)(lucy_Similarity* self, void* vcache); typedef cfish_Obj* (*LUCY_Sim_Clone_t)(lucy_Similarity* self); typedef bool (*LUCY_Sim_Equals_t)(lucy_Similarity* self, cfish_Obj* other); typedef int32_t (*LUCY_Sim_Compare_To_t)(lucy_Similarity* self, cfish_Obj* other); typedef void (*LUCY_Sim_Destroy_t)(lucy_Similarity* self); typedef cfish_String* (*LUCY_Sim_To_String_t)(lucy_Similarity* self); typedef lucy_Posting* (*LUCY_Sim_Make_Posting_t)(lucy_Similarity* self); typedef lucy_PostingWriter* (*LUCY_Sim_Make_Posting_Writer_t)(lucy_Similarity* self, lucy_Schema* schema, lucy_Snapshot* snapshot, lucy_Segment* segment, lucy_PolyReader* polyreader, int32_t field_num); typedef float (*LUCY_Sim_TF_t)(lucy_Similarity* self, float freq); typedef float (*LUCY_Sim_IDF_t)(lucy_Similarity* self, int64_t doc_freq, int64_t total_docs); typedef float (*LUCY_Sim_Coord_t)(lucy_Similarity* self, uint32_t overlap, uint32_t max_overlap); typedef float (*LUCY_Sim_Length_Norm_t)(lucy_Similarity* self, uint32_t num_tokens); typedef float (*LUCY_Sim_Query_Norm_t)(lucy_Similarity* self, float sum_of_squared_weights); typedef uint8_t (*LUCY_Sim_Encode_Norm_t)(lucy_Similarity* self, float f); typedef float (*LUCY_Sim_Decode_Norm_t)(lucy_Similarity* self, uint32_t input); typedef float* (*LUCY_Sim_Get_Norm_Decoder_t)(lucy_Similarity* self); typedef cfish_Obj* (*LUCY_Sim_Dump_t)(lucy_Similarity* self); typedef lucy_Similarity* (*LUCY_Sim_Load_t)(lucy_Similarity* self, cfish_Obj* dump); typedef void (*LUCY_Sim_Serialize_t)(lucy_Similarity* self, lucy_OutStream* outstream); typedef lucy_Similarity* (*LUCY_Sim_Deserialize_t)(lucy_Similarity* self, lucy_InStream* instream); /* Define type-safe wrappers for inert functions of Obj. */ static CFISH_INLINE cfish_Class* lucy_Sim_get_class(lucy_Similarity *self) { return cfish_Obj_get_class((cfish_Obj*)self); } static CFISH_INLINE cfish_String* lucy_Sim_get_class_name(lucy_Similarity *self) { return cfish_Obj_get_class_name((cfish_Obj*)self); } static CFISH_INLINE bool lucy_Sim_is_a(lucy_Similarity *self, cfish_Class *ancestor) { return cfish_Obj_is_a((cfish_Obj*)self, ancestor); } /* Define the inline functions which implement this class's virtual methods. */ extern LUCY_VISIBLE uint32_t LUCY_Sim_To_Host_OFFSET; static CFISH_INLINE void* LUCY_Sim_To_Host(lucy_Similarity* self, void* vcache) { const LUCY_Sim_To_Host_t method = (LUCY_Sim_To_Host_t)cfish_obj_method(self, LUCY_Sim_To_Host_OFFSET); return method(self, vcache); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Clone_OFFSET; static CFISH_INLINE cfish_Obj* LUCY_Sim_Clone(lucy_Similarity* self) { const LUCY_Sim_Clone_t method = (LUCY_Sim_Clone_t)cfish_obj_method(self, LUCY_Sim_Clone_OFFSET); return method(self); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Equals_OFFSET; static CFISH_INLINE bool LUCY_Sim_Equals(lucy_Similarity* self, cfish_Obj* other) { const LUCY_Sim_Equals_t method = (LUCY_Sim_Equals_t)cfish_obj_method(self, LUCY_Sim_Equals_OFFSET); return method(self, other); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Compare_To_OFFSET; static CFISH_INLINE int32_t LUCY_Sim_Compare_To(lucy_Similarity* self, cfish_Obj* other) { const LUCY_Sim_Compare_To_t method = (LUCY_Sim_Compare_To_t)cfish_obj_method(self, LUCY_Sim_Compare_To_OFFSET); return method(self, other); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Destroy_OFFSET; static CFISH_INLINE void LUCY_Sim_Destroy(lucy_Similarity* self) { const LUCY_Sim_Destroy_t method = (LUCY_Sim_Destroy_t)cfish_obj_method(self, LUCY_Sim_Destroy_OFFSET); method(self); } extern LUCY_VISIBLE uint32_t LUCY_Sim_To_String_OFFSET; static CFISH_INLINE cfish_String* LUCY_Sim_To_String(lucy_Similarity* self) { const LUCY_Sim_To_String_t method = (LUCY_Sim_To_String_t)cfish_obj_method(self, LUCY_Sim_To_String_OFFSET); return method(self); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Make_Posting_OFFSET; static CFISH_INLINE lucy_Posting* LUCY_Sim_Make_Posting(lucy_Similarity* self) { const LUCY_Sim_Make_Posting_t method = (LUCY_Sim_Make_Posting_t)cfish_obj_method(self, LUCY_Sim_Make_Posting_OFFSET); return method(self); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Make_Posting_Writer_OFFSET; static CFISH_INLINE lucy_PostingWriter* LUCY_Sim_Make_Posting_Writer(lucy_Similarity* self, lucy_Schema* schema, lucy_Snapshot* snapshot, lucy_Segment* segment, lucy_PolyReader* polyreader, int32_t field_num) { const LUCY_Sim_Make_Posting_Writer_t method = (LUCY_Sim_Make_Posting_Writer_t)cfish_obj_method(self, LUCY_Sim_Make_Posting_Writer_OFFSET); return method(self, schema, snapshot, segment, polyreader, field_num); } extern LUCY_VISIBLE uint32_t LUCY_Sim_TF_OFFSET; static CFISH_INLINE float LUCY_Sim_TF(lucy_Similarity* self, float freq) { const LUCY_Sim_TF_t method = (LUCY_Sim_TF_t)cfish_obj_method(self, LUCY_Sim_TF_OFFSET); return method(self, freq); } extern LUCY_VISIBLE uint32_t LUCY_Sim_IDF_OFFSET; static CFISH_INLINE float LUCY_Sim_IDF(lucy_Similarity* self, int64_t doc_freq, int64_t total_docs) { const LUCY_Sim_IDF_t method = (LUCY_Sim_IDF_t)cfish_obj_method(self, LUCY_Sim_IDF_OFFSET); return method(self, doc_freq, total_docs); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Coord_OFFSET; static CFISH_INLINE float LUCY_Sim_Coord(lucy_Similarity* self, uint32_t overlap, uint32_t max_overlap) { const LUCY_Sim_Coord_t method = (LUCY_Sim_Coord_t)cfish_obj_method(self, LUCY_Sim_Coord_OFFSET); return method(self, overlap, max_overlap); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Length_Norm_OFFSET; static CFISH_INLINE float LUCY_Sim_Length_Norm(lucy_Similarity* self, uint32_t num_tokens) { const LUCY_Sim_Length_Norm_t method = (LUCY_Sim_Length_Norm_t)cfish_obj_method(self, LUCY_Sim_Length_Norm_OFFSET); return method(self, num_tokens); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Query_Norm_OFFSET; static CFISH_INLINE float LUCY_Sim_Query_Norm(lucy_Similarity* self, float sum_of_squared_weights) { const LUCY_Sim_Query_Norm_t method = (LUCY_Sim_Query_Norm_t)cfish_obj_method(self, LUCY_Sim_Query_Norm_OFFSET); return method(self, sum_of_squared_weights); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Encode_Norm_OFFSET; static CFISH_INLINE uint8_t LUCY_Sim_Encode_Norm(lucy_Similarity* self, float f) { const LUCY_Sim_Encode_Norm_t method = (LUCY_Sim_Encode_Norm_t)cfish_obj_method(self, LUCY_Sim_Encode_Norm_OFFSET); return method(self, f); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Decode_Norm_OFFSET; static CFISH_INLINE float LUCY_Sim_Decode_Norm(lucy_Similarity* self, uint32_t input) { const LUCY_Sim_Decode_Norm_t method = (LUCY_Sim_Decode_Norm_t)cfish_obj_method(self, LUCY_Sim_Decode_Norm_OFFSET); return method(self, input); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Get_Norm_Decoder_OFFSET; static CFISH_INLINE float* LUCY_Sim_Get_Norm_Decoder(lucy_Similarity* self) { const LUCY_Sim_Get_Norm_Decoder_t method = (LUCY_Sim_Get_Norm_Decoder_t)cfish_obj_method(self, LUCY_Sim_Get_Norm_Decoder_OFFSET); return method(self); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Dump_OFFSET; static CFISH_INLINE cfish_Obj* LUCY_Sim_Dump(lucy_Similarity* self) { const LUCY_Sim_Dump_t method = (LUCY_Sim_Dump_t)cfish_obj_method(self, LUCY_Sim_Dump_OFFSET); return method(self); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Load_OFFSET; static CFISH_INLINE lucy_Similarity* LUCY_Sim_Load(lucy_Similarity* self, cfish_Obj* dump) { const LUCY_Sim_Load_t method = (LUCY_Sim_Load_t)cfish_obj_method(self, LUCY_Sim_Load_OFFSET); return method(self, dump); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Serialize_OFFSET; static CFISH_INLINE void LUCY_Sim_Serialize(lucy_Similarity* self, lucy_OutStream* outstream) { const LUCY_Sim_Serialize_t method = (LUCY_Sim_Serialize_t)cfish_obj_method(self, LUCY_Sim_Serialize_OFFSET); method(self, outstream); } extern LUCY_VISIBLE uint32_t LUCY_Sim_Deserialize_OFFSET; static CFISH_INLINE lucy_Similarity* LUCY_Sim_Deserialize(lucy_Similarity* self, lucy_InStream* instream) { const LUCY_Sim_Deserialize_t method = (LUCY_Sim_Deserialize_t)cfish_obj_method(self, LUCY_Sim_Deserialize_OFFSET); return method(self, instream); } /* Declare callbacks for wrapping host overrides. */ #ifdef CFISH_NO_DYNAMIC_OVERRIDES #define Lucy_Sim_Make_Posting_OVERRIDE NULL #define Lucy_Sim_Make_Posting_Writer_OVERRIDE NULL #define Lucy_Sim_TF_OVERRIDE NULL #define Lucy_Sim_IDF_OVERRIDE NULL #define Lucy_Sim_Coord_OVERRIDE NULL #define Lucy_Sim_Length_Norm_OVERRIDE NULL #define Lucy_Sim_Query_Norm_OVERRIDE NULL #define Lucy_Sim_Encode_Norm_OVERRIDE NULL #define Lucy_Sim_Decode_Norm_OVERRIDE NULL #define Lucy_Sim_Get_Norm_Decoder_OVERRIDE NULL #define Lucy_Sim_Dump_OVERRIDE NULL #define Lucy_Sim_Load_OVERRIDE NULL #define Lucy_Sim_Serialize_OVERRIDE NULL #define Lucy_Sim_Deserialize_OVERRIDE NULL #else lucy_Posting* Lucy_Sim_Make_Posting_OVERRIDE(lucy_Similarity* self); lucy_PostingWriter* Lucy_Sim_Make_Posting_Writer_OVERRIDE(lucy_Similarity* self, lucy_Schema* schema, lucy_Snapshot* snapshot, lucy_Segment* segment, lucy_PolyReader* polyreader, int32_t field_num); float Lucy_Sim_TF_OVERRIDE(lucy_Similarity* self, float freq); float Lucy_Sim_IDF_OVERRIDE(lucy_Similarity* self, int64_t doc_freq, int64_t total_docs); float Lucy_Sim_Coord_OVERRIDE(lucy_Similarity* self, uint32_t overlap, uint32_t max_overlap); float Lucy_Sim_Length_Norm_OVERRIDE(lucy_Similarity* self, uint32_t num_tokens); float Lucy_Sim_Query_Norm_OVERRIDE(lucy_Similarity* self, float sum_of_squared_weights); uint8_t Lucy_Sim_Encode_Norm_OVERRIDE(lucy_Similarity* self, float f); float Lucy_Sim_Decode_Norm_OVERRIDE(lucy_Similarity* self, uint32_t input); float* Lucy_Sim_Get_Norm_Decoder_OVERRIDE(lucy_Similarity* self); cfish_Obj* Lucy_Sim_Dump_OVERRIDE(lucy_Similarity* self); lucy_Similarity* Lucy_Sim_Load_OVERRIDE(lucy_Similarity* self, cfish_Obj* dump); void Lucy_Sim_Serialize_OVERRIDE(lucy_Similarity* self, lucy_OutStream* outstream); lucy_Similarity* Lucy_Sim_Deserialize_OVERRIDE(lucy_Similarity* self, lucy_InStream* instream); #endif /* Define "short names" for this class's symbols. */ #ifdef LUCY_USE_SHORT_NAMES #define Similarity lucy_Similarity #define SIMILARITY LUCY_SIMILARITY #define Sim_new lucy_Sim_new #define Sim_init lucy_Sim_init #define Sim_get_class lucy_Sim_get_class #define Sim_get_class_name lucy_Sim_get_class_name #define Sim_is_a lucy_Sim_is_a #define Sim_Make_Posting_IMP LUCY_Sim_Make_Posting_IMP #define Sim_Make_Posting_Writer_IMP LUCY_Sim_Make_Posting_Writer_IMP #define Sim_TF_IMP LUCY_Sim_TF_IMP #define Sim_IDF_IMP LUCY_Sim_IDF_IMP #define Sim_Coord_IMP LUCY_Sim_Coord_IMP #define Sim_Length_Norm_IMP LUCY_Sim_Length_Norm_IMP #define Sim_Query_Norm_IMP LUCY_Sim_Query_Norm_IMP #define Sim_Encode_Norm_IMP LUCY_Sim_Encode_Norm_IMP #define Sim_Decode_Norm_IMP LUCY_Sim_Decode_Norm_IMP #define Sim_Get_Norm_Decoder_IMP LUCY_Sim_Get_Norm_Decoder_IMP #define Sim_Destroy_IMP LUCY_Sim_Destroy_IMP #define Sim_Dump_IMP LUCY_Sim_Dump_IMP #define Sim_Load_IMP LUCY_Sim_Load_IMP #define Sim_Equals_IMP LUCY_Sim_Equals_IMP #define Sim_Serialize_IMP LUCY_Sim_Serialize_IMP #define Sim_Deserialize_IMP LUCY_Sim_Deserialize_IMP #define Sim_To_Host LUCY_Sim_To_Host #define Sim_To_Host_t LUCY_Sim_To_Host_t #define Sim_Clone LUCY_Sim_Clone #define Sim_Clone_t LUCY_Sim_Clone_t #define Sim_Equals LUCY_Sim_Equals #define Sim_Equals_t LUCY_Sim_Equals_t #define Sim_Compare_To LUCY_Sim_Compare_To #define Sim_Compare_To_t LUCY_Sim_Compare_To_t #define Sim_Destroy LUCY_Sim_Destroy #define Sim_Destroy_t LUCY_Sim_Destroy_t #define Sim_To_String LUCY_Sim_To_String #define Sim_To_String_t LUCY_Sim_To_String_t #define Sim_Make_Posting LUCY_Sim_Make_Posting #define Sim_Make_Posting_t LUCY_Sim_Make_Posting_t #define Sim_Make_Posting_Writer LUCY_Sim_Make_Posting_Writer #define Sim_Make_Posting_Writer_t LUCY_Sim_Make_Posting_Writer_t #define Sim_TF LUCY_Sim_TF #define Sim_TF_t LUCY_Sim_TF_t #define Sim_IDF LUCY_Sim_IDF #define Sim_IDF_t LUCY_Sim_IDF_t #define Sim_Coord LUCY_Sim_Coord #define Sim_Coord_t LUCY_Sim_Coord_t #define Sim_Length_Norm LUCY_Sim_Length_Norm #define Sim_Length_Norm_t LUCY_Sim_Length_Norm_t #define Sim_Query_Norm LUCY_Sim_Query_Norm #define Sim_Query_Norm_t LUCY_Sim_Query_Norm_t #define Sim_Encode_Norm LUCY_Sim_Encode_Norm #define Sim_Encode_Norm_t LUCY_Sim_Encode_Norm_t #define Sim_Decode_Norm LUCY_Sim_Decode_Norm #define Sim_Decode_Norm_t LUCY_Sim_Decode_Norm_t #define Sim_Get_Norm_Decoder LUCY_Sim_Get_Norm_Decoder #define Sim_Get_Norm_Decoder_t LUCY_Sim_Get_Norm_Decoder_t #define Sim_Dump LUCY_Sim_Dump #define Sim_Dump_t LUCY_Sim_Dump_t #define Sim_Load LUCY_Sim_Load #define Sim_Load_t LUCY_Sim_Load_t #define Sim_Serialize LUCY_Sim_Serialize #define Sim_Serialize_t LUCY_Sim_Serialize_t #define Sim_Deserialize LUCY_Sim_Deserialize #define Sim_Deserialize_t LUCY_Sim_Deserialize_t #endif /* LUCY_USE_SHORT_NAMES */ #ifdef __cplusplus } #endif #endif /* H_LUCY_INDEX_SIMILARITY */