Well, I also do not want to re-invent the wheel. Some of these
libraries are really optimized for both memory and speed (yes, I will
need both) and already provide a great deal of useful functionality
that I would otherwise have to implement myself. I just want to make
sure I am doing it right
Are you somehow required to use the Java library?
Otherwise you could also use a Clojure map as a sparse matrix.
This will be much easier to implement.
Walter
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
On 1/27/12 9:11 AM, Walter van der Laan wrote:
Are you somehow required to use the Java library?
Otherwise you could also use a Clojure map as a sparse matrix.
This will be much easier to implement.
Using a clojure map to store a sparse matrix is not a good solution if
you plan on doing any
Great, thanks people.
So to be surfe I understand, let me summarize as follows: There are
two ways to go:
(1) import the existing sparse matrix class in my clojure project and
wrap a new type around it that implements all required java interfaces
(using them as protocols)
(2) code a new java
Dear,
I am using a java class that implements sparse matrices (see
http://javasourcecode.org/html/open-source/mahout/mahout-0.5/org/apache/mahout/math/SparseMatrix.html).
I was wondering how to add them to clojure as a new type of
collection, so that I can use nth and count etc. on them?
Thanks,
The fundamental interfaces are all written in Java. ISeq,
IPersistentCollection, and so on. You can implement then in deftype.
Look at (ancestors (class [])) as a place to start.
-S
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
On 1/24/12 7:20 AM, Stuart Sierra wrote:
The fundamental interfaces are all written in Java. ISeq,
IPersistentCollection, and so on. You can implement then in deftype.
Look at (ancestors (class [])) as a place to start.
-S
I believe the OP wanted to know if they could extend a java data
Oh, I see. Yes, you can't do that in Clojure right now, because the core
functions are not based on Protocols.
ClojureScript is built on Protocols from the ground up. It would be nice to
have this in Clojure too, but would require some pretty serious redesign.
-S
--
You received this message
I know this isn't exactly what the OP is looking for, but the Incanter
project has done something for dense matrices that might work. The Matrix
type has been imported (which is a java class), and a whole bunch of
functions have been implemented on that class.
See here