Skip to content

Instantly share code, notes, and snippets.

@xxling
xxling / cluster
Created July 3, 2014 10:45 — forked from jdeng/cluster
auto dist = [n, &dists](size_t i, size_t j) { return dists[i * n + j]; } // dists is pre-calculated n x n distances matrix
auto index = seq(n); //[0,...,n-1]
std::vector<size_t> rho(n);
for (size_t i=0; i<n; ++i) {
rho[i] = std::count_if(index.begin(), index.end(), [&](size_t j) { return dist(i,j) < dist_cutoff; });
}
std::vector<D> delta(n);
for (size_t i=0; i<n; ++i) {
#!/usr/bin/python
import glob
import os
import sys
from PIL import Image
EXTS = 'jpg', 'jpeg', 'JPG', 'JPEG', 'gif', 'GIF', 'png', 'PNG'