modify sparse svd implementation to support any matrix type