mikera / vectorz-clj

Fast matrix and vector maths library for Clojure - as a core.matrix implementation
203 stars 19 forks source link

Vectorz protocol implementations #46

Closed drone29a closed 9 years ago

drone29a commented 9 years ago

Not sure why I missed this before, but I had added some protocol implementations to speed up operations (e.g., PNonZeroIndices).

These should be reviewed for design sensibility. Posting it here so we can discuss and I'm happy to modify.

mikera commented 9 years ago

Hi @mattrepl the extra protocol implementations are very welcome!

Can you remove the redundancy however? In most cases you don't need to implement for specific subclasses of AVector for example since the implementation for AVector will do the job. Standard Java virtual method dispatch will take care of getting the right overriden implementation on the Java side.

If you can simplify all this then I will merge.

drone29a commented 9 years ago

Ah yes, thanks for pointing that out. Some of this code was written under duress. =) There's more work needed to fully take advantage of the sparse structures.

mikera commented 9 years ago

Looks good, thanks!