Example code in Matlab.
R package
Test code (not optimized) in Matlab.
C++ code by Di Liu.
For details on the algorithm, see the Annals of Applied Statistics, Vol 2, No 2, 2008. [pdf]