# How to compute the generalized inverse of an arbitrary (finite or infinite dim'l) complex matrix using a least squares method?

I am trying to compute the generalized inverse of an arbitrary (finite or infinite dim'l) complex matrix using a least squares method.

Any idea for the finite and infinite cases?

The details of the finite dimensional case are in How does the SVD solve the least squares problem?. The input matrix is $$\mathbf{A}\in\mathbb{C}^{m\times n}_{\rho}$$ and the pseudoinverse solution is derived.