Parallel inner product

2009-01-26 Thread redhotmonk
Could someone who has a machine with more than 2 cores please run the following code? It calculates the inner product of two given vectors. Usage: (inner-product [1 2 3] [4 5 6]) => 32 You can change the "9000" which is sprinkled over the code (I know it's not beautiful, but I'm new to clojure so

Is this a bug ?!?

2009-02-16 Thread redhotmonk
Ok, perhaps I'm just dumb, but I have the problem with the following code: (import '(java.util ArrayList Collections)) (defn shuffle-java "Shuffles coll using a Java ArrayList." [coll] (let [l (ArrayList. coll)] (Collections/shuffle l) (seq l))) (defn- nodes-num [x-dim y-dim] (*