Raise exception for sparse inputs in the case of svd solver

Fixes #3709, #3718.