X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=include%2Fhfta%2Fhfta_udaf.h;fp=include%2Fhfta%2Fhfta_udaf.h;h=9c960b57fe06d50532934ef7e795dfb435286894;hb=87cd81502f23b63c980bbce93b6159379299c782;hp=6281859aae52fadf4db73a7eca25a879ffdd3b60;hpb=989d19428b3d21982b048cf256f625a8ca664c2e;p=com%2Fgs-lite.git diff --git a/include/hfta/hfta_udaf.h b/include/hfta/hfta_udaf.h index 6281859..9c960b5 100644 --- a/include/hfta/hfta_udaf.h +++ b/include/hfta/hfta_udaf.h @@ -298,4 +298,31 @@ gs_uint32_t extr_quant_hfta0_fcn(vstring *, gs_float_t); gs_uint32_t extr_med_hfta0_fcn(vstring *); gs_uint32_t extr_quant_hfta0_space(vstring *); + +/****************************************************************/ +// Approximate count distinct. +// Rely on the minhashing approach. +// Currently HFTA-only +// Uses a 32-bit hash, tested up to 100,000,000 elements +// and it gave good results (within 7%) +/****************************************************************/ + +// --------------------------------------------- +// HFTA-only +void approx_count_distinct_udaf_HFTA_AGGR_INIT_(gs_sp_t buf); +void approx_count_distinct_udaf_HFTA_AGGR_REINIT_(gs_sp_t buf); +void approx_count_distinct_udaf_HFTA_AGGR_DESTROY_(gs_sp_t buf); +void approx_count_distinct_udaf_HFTA_AGGR_UPDATE_(gs_sp_t buf, vstring *val); +void approx_count_distinct_udaf_HFTA_AGGR_OUTPUT_(vstring *res, gs_sp_t buf); + +void running_approx_count_distinct_udaf_HFTA_AGGR_INIT_(gs_sp_t buf); +void running_approx_count_distinct_udaf_HFTA_AGGR_REINIT_(gs_sp_t buf); +void running_approx_count_distinct_udaf_HFTA_AGGR_DESTROY_(gs_sp_t buf); +void running_approx_count_distinct_udaf_HFTA_AGGR_UPDATE_(gs_sp_t buf, vstring *val); +void running_approx_count_distinct_udaf_HFTA_AGGR_OUTPUT_(vstring *res, gs_sp_t buf); + +gs_float_t extr_approx_count_distinct(vstring *v); + + + #endif