Skip to content

Instantly share code, notes, and snippets.

@bdesham
Created August 15, 2013 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdesham/6240709 to your computer and use it in GitHub Desktop.
Save bdesham/6240709 to your computer and use it in GitHub Desktop.
(defn matrix
[vectors]
(for [i (range (count vectors))
j (range (count vectors))]
(distance-between (nth vectors i) (nth vectors j))))
; originally written in Python as
; def generate_matrix(vectors):
; size = len(vectors)
; return [[distance_between(vectors[i], vectors[j]) for i in range(size)] for j in range(size)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment