code: function (X) {
  		var N = X.length;
  		var dist = zeros(N * N); // allocate contiguous array
  		for (var i = 0; i < N; i++) {
  			for (var j = i + 1; j < N; j++) {
  				var d = L2(X[i], X[j]);
  				dist[i * N + j] = d;
  				dist[j * N + i] = d;
  			}
  		}
  		return dist;
  	}
docs: compute pairwise distance in all vectors in X