I'm having a problem with java interop using one of the libraries in the Incanter package.

When I run the following code:

   (use '(incanter core charts))
   (import (edu.emory.mathcs.jtransforms.fft FloatFFT_2D))
   (def xt (make-array Double/TYPE 3 3 ))
   (for [x (range 3) y (range 3)] (aset xt x y 1))
   (.realForward (FloatFFT_2D. 3 3) xt)

I get this error:

java.lang.IllegalArgumentException: No matching method found: realForward for class edu.emory.mathcs.jtransforms.fft.FloatFFT_2D

That code is calling this method:
http://incanter.org/docs/parallelcolt/api/edu/emory/mathcs/jtransforms/fft/FloatFFT_2D.html#realForward%28float[][]%29

But if I do the same thing but call this method instead which takes a 1d array as an argument instead it works:
http://incanter.org/docs/parallelcolt/api/edu/emory/mathcs/jtransforms/fft/FloatFFT_2D.html#realForward%28float[]%29

I'm pretty new to Clojure so I'm not sure what's going on here, but I guess this has something to do with reflection? Is this going to be a general problem with passing multidimensional arrays to Java methods from Clojure?

Thanks,

-Ranjit

--
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