Generic function for computing the Moore-Penrose pseudoinverse.
The HDF5Matrix method delegates to bdpseudoinv_hdf5().
This method reads the complete dataset into memory, computes the
pseudoinverse via a direct LAPACK SVD, and writes the result back to
HDF5. It is HDF5-backed but not block-wise: the full matrix and its
pseudoinverse must both fit in available RAM during the computation.
Result stored in the same HDF5 file under OUTPUT/<dataset>_pinv
by default.
The matrix method delegates to bdpseudoinv() and computes
the pseudoinverse of an in-memory matrix, returning a plain R matrix.
Both methods use the same singular-value tolerance (\(10^{-9}\)):
singular values at or below the tolerance are treated as zero,
following the standard Moore-Penrose construction
\(A^+ = V \Sigma^+ U^\top\).