On 27.10.2009, at 17:46, Rock wrote: > What if we created a structmap (a sort of class), where we have a > flattened out one-dimensional clojure vector containing all the data > of our potentially multidimensional (rank n) array, together with its > dimensions and possibly other info? I believe the C scienitific
That's certainly possible. In fact, this is very much how Colt and netCDF represent multidimensional arrays, except that they use a Java array as the 1D element storage space. The real question is what you gain from such an implementation. Compared to 1) nested Clojure vectors 2) Colt or netCDF arrays what is the practical advantage of your proposed new data structure? One answer could be "the best of those two worlds", but do you have a concrete application in mind where this would be a real advantage? > I think such an approach could be more flexible. You can have the > vector as a data pool, and the rest would be sort of like a view on > that data (which can be changed at runtime if one chooses to). For That's how nested Clojure vectors behave as well. With Colt and netCDF arrays, creating such views is simple as well (but they are not immutable). Konrad. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---