python svd translated into c