Thrill  0.1
k-means_run.cpp File Reference
#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>
+ Include dependency graph for k-means_run.cpp:

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)
 

Function Documentation

◆ main()

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const SVGColor &  c 
)

Definition at line 39 of file k-means_run.cpp.

◆ OutputSVG() [1/2]

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().

◆ OutputSVG() [2/2]

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().

◆ RunKMeansFile()

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 
)
static

◆ RunKMeansGenerated()

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 
)
static