K-Means Clustering

The subdirectories herein contain the K-Means Clustering examples from Chapter 11 of the book.

Listings

Listing File Summary
11.1 cilkplus/kmeans_cilk.h K-means clustering in Cilk Plus.
11.2 common/sum_and_count.h Type sum_and_count for computing mean of points in a cluster.
11.3 cilkplus/elementwise_reducer.h Defining a hyperobject for summing an array elementwise in Cilk Plus.
Bonus common/repair_empty_clusters.cpp Code for repairing empty clusters. Look at the code in the #if/#else to see the brevity that array notation sometimes brings.
11.4 tbb/view.h Declaring type tls_type for thread-local views in TBB.
11.5 tbb/reduce_local_sums_to_global_sum.h Walking local views to detect changes.
11.6 tbb/reduce_local_counts_to_global_count.h Walking local views to accumulate a global sum.
11.7 tbb/reduce_min_ind.h Routine for finding index of centroid closest to a given point.
11.8 tbb/kmeans_tbb.h K-means clustering in TBB.
Bonus common/test_kmeans.cpp Harness for testing K-Means implementations.

Parent directory