Hi Rock,

Clojure isn't designed as an array processing language, so it doesn't have
multidimensional array-slicing or matrix algebra tools built in. That's just
not what Clojure's trying to be, and you're right, immutable data structures
might get in the way. There's probably nothing stopping you writing a
library to treat nested vectors as multidimensional arrays (they have
constant lookup after all), but I don't know if it's worth the trouble
considering the matrix algebra routines aren't there.

Incanter http://incanter.org/ is a project that links Clojure to Parallel
Colt for matrix algebra, adding nice statistical features a la R.

Clojuratica http://clojuratica.weebly.com/ is a project that links Clojure
to Mathematica, which (as you probably know) is similar to MATLAB in its
array-processing capabilities and has a whole host of other capabilities as
well. I develop Clojuratica and am working on a new release with better
syntactic integration. I anticipate the announcement of that release within
two weeks, but take a look at what on the site now anyway.

If all you need is a statistical or array-processing language like MATLAB,
my frank view is you're best off staying in R, or Mathematica, or MATLAB, or
Octave, or whatever... they're mature and great at what they do (Mathematica
most of all ;-) ). The reason you might want to use Clojuratica or Incanter
is if you're building applications that need Clojure's awesome features in,
say, concurrency, *plus* array processing.

Garth

On Fri, Oct 23, 2009 at 2:01 PM, Rock <rocco.ro...@gmail.com> wrote:

>
> What if I wanted to use Clojure for scientific computing, and in
> particular for doing linear algebra and matrix computations a la
> MATLAB?
>
> What would my options be for representing matrices, not to mention,
> especially, MULTIDIMENSIONAL ARRAYS?
>
> Would java arrays be the way to go, or nested vectors?
>
> I don't like the nested vector solution too much, but to be honest,
> there really doesn't seem to be an adequate solution to this problem
> at the moment. For instance, once you have a multidimensional array
> (whatever kind it is) you can't, I believe, access any property of
> that object at runtime to know its rank and dimensions, like you can
> do with MATLAB or Scientifc Python (NumPy), or other similar
> languages. And slicing, such as a[2:20:4, 1:9:3], which means every
> element in a with indices that go from start to finish with a certain
> step, seem to be problematic.
>
> Actually the whole buiseness of having to deal with immutable (and
> lazy) data structures appears to make computing with matrices and
> multidimensional arrays a lot more difficult. Maybe this is just an
> impression. Opinions?
>
> Does Rich intend to address this issue of having multidimensional
> arrays (for scientific computing purposes) sooner or later?
>
> Thanks.
>
> Rock
>
> >
>

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