lucasmaystre / svdlibc

A fork of Doug Rohde's SVD C Library.
http://tedlab.mit.edu/~dr/SVDLIBC/
48 stars 19 forks source link

Doug Rohde's SVD C library

Good news: as of version 1.4, SVDLIBC is explicitly available under a BSD license.

SVDLIBC is a fast implementation of SVD matrix decomposition by Doug Rohde. It works particularly efficiently in the following cases:

These properties make it particularly well suited for latent semantic analysis, for example.

I ran an experiment on an Amazon EC2 m2.xlarge instance - which might be way overkill - with a 70k × 500k matrix containing 8M entries (density: 0.02%). Here is the running time for different values of d (= dimensions = number of singular values):

Why this fork ?

The latest official release of the library (version 1.34) dates back from 2005. It has a few quirks, such as:

A caveat

I'm not a release engineer, and have only limited knowledge of the different languages (C, Makefile) and tools (make, gcc) involved. The modifications in this fork are working for me, but nothing guarantees they'll work for you.

If you find a bug and fix it yourself, I'd be happy to get a pull your changes over.

Installation instructions

Easy as pie:

# Download the code. Alternatively you can also download the zip file.
git clone git://github.com/lucasmaystre/svdlibc.git
cd svdlibc

# Just like any other sane program...
make
make install

# You're done. Start using it!
svd -o result -d 10 THE_MATRIX