Core and evaluation code for the Diagonalized Newton Algorithm 

Author: Hugo Van hamme - KU Leuven, Belgium
        hugo.vanhamme@esat.kuleuven.be
License: free for academic use. For any other use, ask for permission via
        email. No warantee.

Refer to :
H. Van hamme, "The Diagonalized Newton Algorithm for Non-negative Matrix Factorization" submitted to ICLR 2013
     Available at http://arxiv.org/abs/1301.3389
H. Van hamme, "A diagonalized Newton Algorithm for non-negative sparse coding" submitted to ICASSP2013. 
     See proceedings or http://www.esat.kuleuven.be/psi/spraak/publications/

Naming convention: xxx_[gpu_]yyy_zzz_vn.m where
  xxx: the problem: nmf (nonnegative matrix factorization) or nsc (nonnegative sparse coding)
  gpu: optional qualifier indicating code is gpu-ready
  yyy: algorithm: dna (diagonal newton algorithm) or em (estimate/maximize i.e. multiplicative updates)
  zzz: optimized for full or sprs (sparse) data matrix
  _vn: software version

The sprs routines use a mex function "spprod" for which the c-code is include.
You can always backoff to the equivalent matlab implementation given in the
header coment of the c-implementation. 

Tip for setting parameters.
The DNA algorithm has one extra parameter that multiplicative updates doesn't have (called K in the implementations). K determines after how many successive successful Newton steps we stop checking if the steps are successful. If you want to play safe, you can take the default, which implies we never stop checking. If you have some experience with the data, setting it to a lower value (like K=5) can give you serious speedups, but the cost is not guaranteed to decrease in each step. 

Modification history:
* 16 Jan 2013: initial release
* 22 March 2013: modified nsc_dna_full_v1 for "denormals", added timing measurement and added the function call in the help
* 31 Oct 2013: the denorm fix may cause convergence to a point with a suboptimal support. This is fixed in nsc_dna_full_v2

