6 #ifndef __AGGREGATE_K_MEANS_H__
7 #define __AGGREGATE_K_MEANS_H__
41 options(std::map<std::string, std::string>())
80 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_):
93 std::map<std::string, std::string>
options;
99 template<>
struct codec_traits<gpudb::AggregateKMeansRequest>
105 ::avro::encode(e, v.
k);
112 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
114 const std::vector<size_t> fo = rd->fieldOrder();
116 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
129 ::avro::decode(d, v.
k);
149 ::avro::decode(d, v.
k);
185 means(std::vector<std::vector<double> >()),
186 counts(std::vector<int64_t>()),
192 info(std::map<std::string, std::string>())
196 std::vector<std::vector<double> >
means;
203 std::map<std::string, std::string>
info;
209 template<>
struct codec_traits<gpudb::AggregateKMeansResponse>
213 ::avro::encode(e, v.
means);
214 ::avro::encode(e, v.
counts);
216 ::avro::encode(e, v.
count);
220 ::avro::encode(e, v.
info);
225 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
227 const std::vector<size_t> fo = rd->fieldOrder();
229 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
234 ::avro::decode(d, v.
means);
238 ::avro::decode(d, v.
counts);
246 ::avro::decode(d, v.
count);
262 ::avro::decode(d, v.
info);
272 ::avro::decode(d, v.
means);
273 ::avro::decode(d, v.
counts);
275 ::avro::decode(d, v.
count);
279 ::avro::decode(d, v.
info);
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.