GPUdb C++ API  Version 5.2.0.0
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 
75  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):
76  tableName(tableName),
77  columnNames(columnNames),
78  k(k),
79  tolerance(tolerance),
80  options(options)
81  {
82  }
83 
84  std::string tableName;
85  std::vector<std::string> columnNames;
86  int32_t k;
87  double tolerance;
88  std::map<std::string, std::string> options;
89  };
90 }
91 
92 namespace avro
93 {
94  template<> struct codec_traits<gpudb::AggregateKMeansRequest>
95  {
96  static void encode(Encoder& e, const gpudb::AggregateKMeansRequest& v)
97  {
98  ::avro::encode(e, v.tableName);
99  ::avro::encode(e, v.columnNames);
100  ::avro::encode(e, v.k);
101  ::avro::encode(e, v.tolerance);
102  ::avro::encode(e, v.options);
103  }
104 
105  static void decode(Decoder& d, gpudb::AggregateKMeansRequest& v)
106  {
107  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
108  {
109  const std::vector<size_t> fo = rd->fieldOrder();
110 
111  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
112  {
113  switch (*it)
114  {
115  case 0:
116  ::avro::decode(d, v.tableName);
117  break;
118 
119  case 1:
120  ::avro::decode(d, v.columnNames);
121  break;
122 
123  case 2:
124  ::avro::decode(d, v.k);
125  break;
126 
127  case 3:
128  ::avro::decode(d, v.tolerance);
129  break;
130 
131  case 4:
132  ::avro::decode(d, v.options);
133  break;
134 
135  default:
136  break;
137  }
138  }
139  }
140  else
141  {
142  ::avro::decode(d, v.tableName);
143  ::avro::decode(d, v.columnNames);
144  ::avro::decode(d, v.k);
145  ::avro::decode(d, v.tolerance);
146  ::avro::decode(d, v.options);
147  }
148  }
149  };
150 }
151 
152 namespace gpudb
153 {
154 
170  {
171 
177  means(std::vector<std::vector<double> >()),
178  counts(std::vector<int64_t>()),
179  rmsDists(std::vector<double>()),
180  count(int64_t()),
181  rmsDist(double()),
182  tolerance(double()),
183  numIters(int32_t())
184  {
185  }
186 
187  std::vector<std::vector<double> > means;
188  std::vector<int64_t> counts;
189  std::vector<double> rmsDists;
190  int64_t count;
191  double rmsDist;
192  double tolerance;
193  int32_t numIters;
194  };
195 }
196 
197 namespace avro
198 {
199  template<> struct codec_traits<gpudb::AggregateKMeansResponse>
200  {
201  static void encode(Encoder& e, const gpudb::AggregateKMeansResponse& v)
202  {
203  ::avro::encode(e, v.means);
204  ::avro::encode(e, v.counts);
205  ::avro::encode(e, v.rmsDists);
206  ::avro::encode(e, v.count);
207  ::avro::encode(e, v.rmsDist);
208  ::avro::encode(e, v.tolerance);
209  ::avro::encode(e, v.numIters);
210  }
211 
212  static void decode(Decoder& d, gpudb::AggregateKMeansResponse& v)
213  {
214  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
215  {
216  const std::vector<size_t> fo = rd->fieldOrder();
217 
218  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
219  {
220  switch (*it)
221  {
222  case 0:
223  ::avro::decode(d, v.means);
224  break;
225 
226  case 1:
227  ::avro::decode(d, v.counts);
228  break;
229 
230  case 2:
231  ::avro::decode(d, v.rmsDists);
232  break;
233 
234  case 3:
235  ::avro::decode(d, v.count);
236  break;
237 
238  case 4:
239  ::avro::decode(d, v.rmsDist);
240  break;
241 
242  case 5:
243  ::avro::decode(d, v.tolerance);
244  break;
245 
246  case 6:
247  ::avro::decode(d, v.numIters);
248  break;
249 
250  default:
251  break;
252  }
253  }
254  }
255  else
256  {
257  ::avro::decode(d, v.means);
258  ::avro::decode(d, v.counts);
259  ::avro::decode(d, v.rmsDists);
260  ::avro::decode(d, v.count);
261  ::avro::decode(d, v.rmsDist);
262  ::avro::decode(d, v.tolerance);
263  ::avro::decode(d, v.numIters);
264  }
265  }
266  };
267 }
268 
269 #endif
AggregateKMeansResponse()
Constructs an AggregateKMeansResponse object with default parameter values.
A set of input parameters for aggregateKMeans(const AggregateKMeansRequest&) 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 aggregateKMeans(const AggregateKMeansRequest&) const.
std::vector< int64_t > counts
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.
std::vector< double > rmsDists
AggregateKMeansRequest()
Constructs an AggregateKMeansRequest object with default parameter values.