GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
aggregate_k_means.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the GPUdb schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __AGGREGATE_K_MEANS_H__
7 #define __AGGREGATE_K_MEANS_H__
8 
9 namespace gpudb
10 {
11 
27  {
28 
34  tableName(std::string()),
35  columnNames(std::vector<std::string>()),
36  k(int32_t()),
37  tolerance(double()),
38  options(std::map<std::string, std::string>())
39  {
40  }
41 
77  AggregateKMeansRequest(const std::string& tableName_, const std::vector<std::string>& columnNames_, const int32_t k_, const double tolerance_, const std::map<std::string, std::string>& options_):
78  tableName( tableName_ ),
79  columnNames( columnNames_ ),
80  k( k_ ),
81  tolerance( tolerance_ ),
82  options( options_ )
83  {
84  }
85 
86  std::string tableName;
87  std::vector<std::string> columnNames;
88  int32_t k;
89  double tolerance;
90  std::map<std::string, std::string> options;
91  };
92 }
93 
94 namespace avro
95 {
96  template<> struct codec_traits<gpudb::AggregateKMeansRequest>
97  {
98  static void encode(Encoder& e, const gpudb::AggregateKMeansRequest& v)
99  {
100  ::avro::encode(e, v.tableName);
101  ::avro::encode(e, v.columnNames);
102  ::avro::encode(e, v.k);
103  ::avro::encode(e, v.tolerance);
104  ::avro::encode(e, v.options);
105  }
106 
107  static void decode(Decoder& d, gpudb::AggregateKMeansRequest& v)
108  {
109  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
110  {
111  const std::vector<size_t> fo = rd->fieldOrder();
112 
113  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
114  {
115  switch (*it)
116  {
117  case 0:
118  ::avro::decode(d, v.tableName);
119  break;
120 
121  case 1:
122  ::avro::decode(d, v.columnNames);
123  break;
124 
125  case 2:
126  ::avro::decode(d, v.k);
127  break;
128 
129  case 3:
130  ::avro::decode(d, v.tolerance);
131  break;
132 
133  case 4:
134  ::avro::decode(d, v.options);
135  break;
136 
137  default:
138  break;
139  }
140  }
141  }
142  else
143  {
144  ::avro::decode(d, v.tableName);
145  ::avro::decode(d, v.columnNames);
146  ::avro::decode(d, v.k);
147  ::avro::decode(d, v.tolerance);
148  ::avro::decode(d, v.options);
149  }
150  }
151  };
152 }
153 
154 namespace gpudb
155 {
156 
172  {
173 
179  means(std::vector<std::vector<double> >()),
180  counts(std::vector<int64_t>()),
181  rmsDists(std::vector<double>()),
182  count(int64_t()),
183  rmsDist(double()),
184  tolerance(double()),
185  numIters(int32_t())
186  {
187  }
188 
189  std::vector<std::vector<double> > means;
190  std::vector<int64_t> counts;
191  std::vector<double> rmsDists;
192  int64_t count;
193  double rmsDist;
194  double tolerance;
195  int32_t numIters;
196  };
197 }
198 
199 namespace avro
200 {
201  template<> struct codec_traits<gpudb::AggregateKMeansResponse>
202  {
203  static void encode(Encoder& e, const gpudb::AggregateKMeansResponse& v)
204  {
205  ::avro::encode(e, v.means);
206  ::avro::encode(e, v.counts);
207  ::avro::encode(e, v.rmsDists);
208  ::avro::encode(e, v.count);
209  ::avro::encode(e, v.rmsDist);
210  ::avro::encode(e, v.tolerance);
211  ::avro::encode(e, v.numIters);
212  }
213 
214  static void decode(Decoder& d, gpudb::AggregateKMeansResponse& v)
215  {
216  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
217  {
218  const std::vector<size_t> fo = rd->fieldOrder();
219 
220  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
221  {
222  switch (*it)
223  {
224  case 0:
225  ::avro::decode(d, v.means);
226  break;
227 
228  case 1:
229  ::avro::decode(d, v.counts);
230  break;
231 
232  case 2:
233  ::avro::decode(d, v.rmsDists);
234  break;
235 
236  case 3:
237  ::avro::decode(d, v.count);
238  break;
239 
240  case 4:
241  ::avro::decode(d, v.rmsDist);
242  break;
243 
244  case 5:
245  ::avro::decode(d, v.tolerance);
246  break;
247 
248  case 6:
249  ::avro::decode(d, v.numIters);
250  break;
251 
252  default:
253  break;
254  }
255  }
256  }
257  else
258  {
259  ::avro::decode(d, v.means);
260  ::avro::decode(d, v.counts);
261  ::avro::decode(d, v.rmsDists);
262  ::avro::decode(d, v.count);
263  ::avro::decode(d, v.rmsDist);
264  ::avro::decode(d, v.tolerance);
265  ::avro::decode(d, v.numIters);
266  }
267  }
268  };
269 }
270 
271 #endif
AggregateKMeansResponse()
Constructs an AggregateKMeansResponse object with default parameter values.
AggregateKMeansRequest(const std::string &tableName_, const std::vector< std::string > &columnNames_, const int32_t k_, const double tolerance_, const std::map< std::string, std::string > &options_)
Constructs an AggregateKMeansRequest object with the specified parameters.
A set of input parameters for const.
std::map< std::string, std::string > options
std::vector< std::string > columnNames
std::vector< std::vector< double > > means
A set of output parameters for const.
std::vector< int64_t > counts
std::vector< double > rmsDists
AggregateKMeansRequest()
Constructs an AggregateKMeansRequest object with default parameter values.