MyNixOS website logo
Description

SVDLIBC bindings for HMatrix.

Bindings for the sparse singular value decomposition provided by SVDLIBC.

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:

  • the matrix is sparse,
  • only a few singular values are needed.

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):

  • -d 50: 39s wall time
  • -d 300: 4m53s wall time
  • -d 1000: 31m48s wall time

Why this fork ?

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

  • make / make install don't work "as expected"
  • it doesn't compile on Mac OS X out of the box
  • some bugs have been found, e.g. by piskvorky

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
Metadata

Version

0.5.0.1

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows