Fixed newline characters throughout the code
[com/gs-lite.git] / include / lfta / rts_udaf.h
1 /* ------------------------------------------------
2  Copyright 2014 AT&T Intellectual Property
3  Licensed under the Apache License, Version 2.0 (the "License");
4  you may not use this file except in compliance with the License.
5  You may obtain a copy of the License at
6  
7  http://www.apache.org/licenses/LICENSE-2.0
8  
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14  ------------------------------------------- */
15 #ifndef _RTS_UDAF_H_INCLUDED_
16 #define _RTS_UDAF_H_INCLUDED_
17
18 #include "gsconfig.h"
19 #include "gstypes.h"
20 #include "rts_external.h"
21
22
23 //                      avg_udaf
24 void avg_udaf_lfta_LFTA_AGGR_INIT_(gs_sp_t);
25 void avg_udaf_lfta_LFTA_AGGR_UPDATE_(gs_sp_t,gs_uint32_t);
26 gs_retval_t avg_udaf_lfta_LFTA_AGBGR_FLUSHME_(gs_sp_t);
27 void avg_udaf_lfta_LFTA_AGGR_OUTPUT_(struct gs_string *,gs_sp_t);
28 void avg_udaf_lfta_LFTA_AGGR_DESTROY_(gs_sp_t);
29
30 //              moving sum
31 void moving_sum_lfta_LFTA_AGGR_INIT_(gs_sp_t b);
32 void moving_sum_lfta_LFTA_AGGR_UPDATE_(gs_sp_t b, gs_uint32_t v, gs_uint32_t N);
33 gs_retval_t moving_sum_lfta_LFTA_AGGR_FLUSHME_(gs_sp_t b);
34 void moving_sum_lfta_LFTA_AGGR_OUTPUT_(gs_uint64_t *r, gs_sp_t b);
35 gs_retval_t moving_sum_lfta_LFTA_AGGR_DESTROY_(gs_sp_t b);
36
37
38 //      first aggregate
39 void FIRST_lfta_LFTA_AGGR_INIT_(gs_uint32_t* scratch);
40 void FIRST_lfta_LFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val);
41 gs_retval_t FIRST_lfta_LFTA_AGGR_FLUSHME_(gs_uint32_t* scratch);
42 void FIRST_lfta_LFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch);
43 void FIRST_lfta_LFTA_AGGR_DESTROY_(gs_uint32_t* scratch);
44
45 void FIRST_ULL_lfta_LFTA_AGGR_INIT_(gs_uint64_t* scratch);
46 void FIRST_ULL_lfta_LFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val);
47 gs_retval_t FIRST_ULL_lfta_LFTA_AGGR_FLUSHME_(gs_uint64_t* scratch);
48 void FIRST_ULL_lfta_LFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch);
49 void FIRST_ULL_lfta_LFTA_AGGR_DESTROY_(gs_uint64_t* scratch);
50
51 void FIRST_STR_lfta_LFTA_AGGR_INIT_(struct gs_string* scratch);
52 void FIRST_STR_lfta_LFTA_AGGR_UPDATE_(struct gs_string* scratch, struct gs_string* val);
53 gs_retval_t FIRST_STR_lfta_LFTA_AGGR_FLUSHME_(struct gs_string* scratch);
54 void FIRST_STR_lfta_LFTA_AGGR_OUTPUT_(struct gs_string* res, struct gs_string* scratch);
55 void FIRST_STR_lfta_LFTA_AGGR_DESTROY_(struct gs_string* scratch);
56
57 //      last aggregate
58 void LAST_lfta_LFTA_AGGR_INIT_(gs_uint32_t* scratch);
59 void LAST_lfta_LFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val);
60 gs_retval_t LAST_lfta_LFTA_AGGR_FLUSHME_(gs_uint32_t* scratch);
61 void LAST_lfta_LFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch);
62 void LAST_lfta_LFTA_AGGR_DESTROY_(gs_uint32_t* scratch);
63
64 void LAST_ULL_lfta_LFTA_AGGR_INIT_(gs_uint64_t* scratch);
65 void LAST_ULL_lfta_LFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val);
66 gs_retval_t LAST_ULL_lfta_LFTA_AGGR_FLUSHME_(gs_uint64_t* scratch);
67 void LAST_ULL_lfta_LFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch);
68 void LAST_ULL_lfta_LFTA_AGGR_DESTROY_(gs_uint64_t* scratch);
69
70 void LAST_STR_lfta_LFTA_AGGR_INIT_(struct gs_string* scratch);
71 void LAST_STR_lfta_LFTA_AGGR_UPDATE_(struct gs_string* scratch, struct gs_string* val);
72 gs_retval_t LAST_STR_lfta_LFTA_AGGR_FLUSHME_(struct gs_string* scratch);
73 void LAST_STR_lfta_LFTA_AGGR_OUTPUT_(struct gs_string* res, struct gs_string* scratch);
74 void LAST_STR_lfta_LFTA_AGGR_DESTROY_(struct gs_string* scratch);
75
76 //              running_array_aggr aggregate
77 void running_array_aggr_lfta_LFTA_AGGR_INIT_(char* scratch);
78 void running_array_aggr_lfta_LFTA_AGGR_UPDATE_(char* scratch, gs_uint32_t val);
79 gs_retval_t running_array_aggr_lfta_LFTA_AGGR_FLUSHME_(char* scratch);
80 void running_array_aggr_lfta_LFTA_AGGR_OUTPUT_(struct gs_string* res, char* scratch);
81 void running_array_aggr_lfta_LFTA_AGGR_DESTROY_(char* scratch);
82
83 //////////////////////////////////////////////////////////////////
84 ///             Flip-s sample-based quantiles
85
86 /****************************************************************/
87 /* LFTA functions                                               */
88 /****************************************************************/
89
90 void quant_udaf_lfta3_LFTA_AGGR_INIT_(gs_sp_t);
91 void quant_udaf_lfta3_LFTA_AGGR_UPDATE_(gs_sp_t, gs_uint32_t);
92 gs_retval_t quant_udaf_lfta3_LFTA_AGGR_FLUSHME_(gs_sp_t);
93 void quant_udaf_lfta3_LFTA_AGGR_OUTPUT_(struct gs_string *, gs_sp_t);
94 void quant_udaf_lfta3_LFTA_AGGR_DESTROY_(gs_sp_t);
95
96
97 #endif