GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
36  {
37 
43  tableName(std::string()),
44  columnNames(std::vector<std::string>()),
45  k(int32_t()),
46  tolerance(double()),
47  options(std::map<std::string, std::string>())
48  {
49  }
50 
135  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_):
136  tableName( tableName_ ),
137  columnNames( columnNames_ ),
138  k( k_ ),
139  tolerance( tolerance_ ),
140  options( options_ )
141  {
142  }
143 
144  std::string tableName;
145  std::vector<std::string> columnNames;
146  int32_t k;
147  double tolerance;
148  std::map<std::string, std::string> options;
149  };
150 }
151 
152 namespace avro
153 {
154  template<> struct codec_traits<gpudb::AggregateKMeansRequest>
155  {
156  static void encode(Encoder& e, const gpudb::AggregateKMeansRequest& v)
157  {
158  ::avro::encode(e, v.tableName);
159  ::avro::encode(e, v.columnNames);
160  ::avro::encode(e, v.k);
161  ::avro::encode(e, v.tolerance);
162  ::avro::encode(e, v.options);
163  }
164 
165  static void decode(Decoder& d, gpudb::AggregateKMeansRequest& v)
166  {
167  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
168  {
169  const std::vector<size_t> fo = rd->fieldOrder();
170 
171  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
172  {
173  switch (*it)
174  {
175  case 0:
176  ::avro::decode(d, v.tableName);
177  break;
178 
179  case 1:
180  ::avro::decode(d, v.columnNames);
181  break;
182 
183  case 2:
184  ::avro::decode(d, v.k);
185  break;
186 
187  case 3:
188  ::avro::decode(d, v.tolerance);
189  break;
190 
191  case 4:
192  ::avro::decode(d, v.options);
193  break;
194 
195  default:
196  break;
197  }
198  }
199  }
200  else
201  {
202  ::avro::decode(d, v.tableName);
203  ::avro::decode(d, v.columnNames);
204  ::avro::decode(d, v.k);
205  ::avro::decode(d, v.tolerance);
206  ::avro::decode(d, v.options);
207  }
208  }
209  };
210 }
211 
212 namespace gpudb
213 {
214 
239  {
240 
246  means(std::vector<std::vector<double> >()),
247  counts(std::vector<int64_t>()),
248  rmsDists(std::vector<double>()),
249  count(int64_t()),
250  rmsDist(double()),
251  tolerance(double()),
252  numIters(int32_t()),
253  info(std::map<std::string, std::string>())
254  {
255  }
256 
257  std::vector<std::vector<double> > means;
258  std::vector<int64_t> counts;
259  std::vector<double> rmsDists;
260  int64_t count;
261  double rmsDist;
262  double tolerance;
263  int32_t numIters;
264  std::map<std::string, std::string> info;
265  };
266 }
267 
268 namespace avro
269 {
270  template<> struct codec_traits<gpudb::AggregateKMeansResponse>
271  {
272  static void encode(Encoder& e, const gpudb::AggregateKMeansResponse& v)
273  {
274  ::avro::encode(e, v.means);
275  ::avro::encode(e, v.counts);
276  ::avro::encode(e, v.rmsDists);
277  ::avro::encode(e, v.count);
278  ::avro::encode(e, v.rmsDist);
279  ::avro::encode(e, v.tolerance);
280  ::avro::encode(e, v.numIters);
281  ::avro::encode(e, v.info);
282  }
283 
284  static void decode(Decoder& d, gpudb::AggregateKMeansResponse& v)
285  {
286  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
287  {
288  const std::vector<size_t> fo = rd->fieldOrder();
289 
290  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
291  {
292  switch (*it)
293  {
294  case 0:
295  ::avro::decode(d, v.means);
296  break;
297 
298  case 1:
299  ::avro::decode(d, v.counts);
300  break;
301 
302  case 2:
303  ::avro::decode(d, v.rmsDists);
304  break;
305 
306  case 3:
307  ::avro::decode(d, v.count);
308  break;
309 
310  case 4:
311  ::avro::decode(d, v.rmsDist);
312  break;
313 
314  case 5:
315  ::avro::decode(d, v.tolerance);
316  break;
317 
318  case 6:
319  ::avro::decode(d, v.numIters);
320  break;
321 
322  case 7:
323  ::avro::decode(d, v.info);
324  break;
325 
326  default:
327  break;
328  }
329  }
330  }
331  else
332  {
333  ::avro::decode(d, v.means);
334  ::avro::decode(d, v.counts);
335  ::avro::decode(d, v.rmsDists);
336  ::avro::decode(d, v.count);
337  ::avro::decode(d, v.rmsDist);
338  ::avro::decode(d, v.tolerance);
339  ::avro::decode(d, v.numIters);
340  ::avro::decode(d, v.info);
341  }
342  }
343  };
344 }
345 
346 #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
std::map< std::string, std::string > info
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.