Skip to content

Instantly share code, notes, and snippets.

@brakmic
Created February 11, 2017 21:38
Show Gist options
  • Save brakmic/848e59316ff80d322907b1e48d48592c to your computer and use it in GitHub Desktop.
Save brakmic/848e59316ff80d322907b1e48d48592c to your computer and use it in GitHub Desktop.
void Process(thrill::Context& ctx) {
std::default_random_engine rng(std::random_device { } ());
std::uniform_real_distribution<double> dist(0.0, 1000.0);
// generate 100 random points using uniform distribution
DIA<Point> points =
Generate(
ctx, /* size */ 100,
[&](const size_t& /* index */) {
return Point { dist(rng), dist(rng) };
})
.Cache();
// print out the points
points.Print("points");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment