This example is beside the point of the original question. It uses mutable 
arrays. It's very much dropping to the Java level. Am I missing something?

-Fred

--
Science answers questions; philosophy questions answers.

On Jul 17, 2010, at 6:04 PM, David Nolen wrote:

> (defn ^{:static true} convolve ^doubles [^doubles xs ^doubles is]
>   (let [xlen (count xs)
>         ilen (count is)
>         ys   (double-array (dec (+ xlen ilen)))]
>     (dotimes [p xlen]
>       (dotimes [q ilen]
>         (let [n (+ p q), x (aget xs p), i (aget is q), y (aget ys n)]
>           (aset ys n (+ (* x i) y)))))
>     ys))
> 
> I don't think this is so bad and it can do a million points in ~400ms on my 
> machine. 100,000 points in ~25ms. I don't consider this dropping to the Java 
> level at all.
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to