Thrill
0.1
|
#include <examples/k-means/k-means.hpp>
#include <thrill/api/gather.hpp>
#include <thrill/api/generate.hpp>
#include <thrill/api/read_lines.hpp>
#include <thrill/common/logger.hpp>
#include <thrill/common/string.hpp>
#include <tlx/cmdline_parser.hpp>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <random>
#include <string>
#include <utility>
#include <vector>
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
std::ostream & | operator<< (std::ostream &os, const SVGColor &c) |
template<typename Point > | |
void | OutputSVG (const std::string &svg_path, double svg_scale, const DIA< Point > &list, const KMeansModel< Point > &model) |
Output the points and centroids as a SVG drawing. More... | |
template<> | |
void | OutputSVG (const std::string &svg_path, double svg_scale, const DIA< Point< 2 > > &point_dia, const KMeansModel< Point< 2 > > &model) |
Output the points and centroids as a 2-D SVG drawing. More... | |
template<typename Point > | |
static void | RunKMeansFile (thrill::Context &ctx, bool bisecting, size_t dimensions, size_t num_clusters, size_t iterations, double eps, const std::string &svg_path, double svg_scale, const std::vector< std::string > &input_paths) |
template<typename Point > | |
static void | RunKMeansGenerated (thrill::Context &ctx, bool bisecting, size_t dimensions, size_t num_clusters, size_t iterations, double eps, const std::string &svg_path, double svg_scale, const std::vector< std::string > &input_paths) |
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 220 of file k-means_run.cpp.
References CmdlineParser::add_bool(), CmdlineParser::add_double(), CmdlineParser::add_param_size_t(), CmdlineParser::add_param_stringlist(), CmdlineParser::add_size_t(), CmdlineParser::add_string(), die, CmdlineParser::print_result(), CmdlineParser::process(), and thrill::api::Run().
std::ostream& operator<< | ( | std::ostream & | os, |
const SVGColor & | c | ||
) |
Definition at line 39 of file k-means_run.cpp.
void OutputSVG | ( | const std::string & | svg_path, |
double | svg_scale, | ||
const DIA< Point > & | list, | ||
const KMeansModel< Point > & | model | ||
) |
Output the points and centroids as a SVG drawing.
Definition at line 49 of file k-means_run.cpp.
References tlx::unused().
Referenced by RunKMeansFile(), and RunKMeansGenerated().
void OutputSVG | ( | const std::string & | svg_path, |
double | svg_scale, | ||
const DIA< Point< 2 > > & | point_dia, | ||
const KMeansModel< Point< 2 > > & | model | ||
) |
Output the points and centroids as a 2-D SVG drawing.
Definition at line 60 of file k-means_run.cpp.
References max().
|
static |
Definition at line 163 of file k-means_run.cpp.
References FlowControlChannel::Barrier(), examples::k_means::BisecKMeans(), die, examples::k_means::KMeans(), LOG1, Vector< D, double >::Make(), Context::my_rank(), Context::net, Context::net_manager(), Context::num_hosts(), OutputSVG(), thrill::api::ReadLines(), and Manager::Traffic().
|
static |
Definition at line 109 of file k-means_run.cpp.
References FlowControlChannel::Barrier(), examples::k_means::BisecKMeans(), die, thrill::api::Generate(), examples::k_means::KMeans(), LOG1, Context::my_rank(), Context::net, Context::net_manager(), Context::num_hosts(), OutputSVG(), Vector< D, double >::Random(), and Manager::Traffic().