scalala / Scalala

Scalala has been superseded by dlwh/breeze. Scalala is a high performance numeric linear algebra library for Scala, with rich Matlab-like operators on vectors and matrices; a library of numerical routines; support for plotting.
http://groups.google.com/group/scalala
GNU Lesser General Public License v2.1
298 stars 30 forks source link

Unified logSum and logDiff behavior, load and store facilities for matrices. #8

Closed afwlehmann closed 13 years ago

afwlehmann commented 13 years ago

Adapted logSum and logDiff such that they have the same consistent behavior w.r.t. the (extended) logarithm of 0 represented (also before) by Double.NegativeInfinity.

Wrote unit tests to assure the correct behavior.

2nd commit fixes a bug that I accidentally introduced in the first commit.

Corresponding to the addition of reduceLeft by Daniel, I added reduceRight, foldLeft and foldRight. However, instead of using own implementations I think it might be advantageous to use the iterator's supplied methods and only provide appropriate proxies. If you feel this is not what you want please make sure that reduceLeft throws an UnsupportedOperationException in case of an empty dataset (so does Scala's stdlib, e.g. List.empty[Double] reduceLeft (+)).

Added load and store facilities for matrices.

dramage commented 13 years ago

Incorporated. Thanks for taking a crack at an IO API. It's a good first step, but eventually the IO API will look more like (or actually just use) the scalanlp-data project's serialization API. I've included your stuff for now, but it'll get swapped out eventually.