What is a good representation for matrices in Clojure? I'm interested in dealing with dense matrices of floating point numbers. The "list of lists" representation springs to mind, but is there something better?
Some criteria for a good representation include:
- Efficiency: They won't be used for constant processing of huge data sets, but I don't want to spend hours calculating results that could have been done in minutes with a better design.
- Java Interoperability: It would be nice to pass the data back and forth between the two languages easily.
- Easy Parallelization: If I can use all the cores available simply by replacing
map
withpmap
, that would be nice. - Amenable to the use of
reduce
: It seems like lots of the calculations I'm doing work very well withreduce
. - Ability to Represent Image Scan Lines in Matrix Rows: Not really very important, but would be nice to have.
Any thoughts?