# HG changeset patch # User jwe # Date 813111112 0 # Node ID d1fe5918e16b3fbe7a45d9d1978f9d3d47495295 # Parent 3c89376f951f0c171b357d6f9260b0c3b60bf6e4 [project @ 1995-10-08 00:11:52 by jwe] diff -r 3c89376f951f -r d1fe5918e16b liboctave/CMatrix.cc --- a/liboctave/CMatrix.cc Sat Oct 07 07:39:08 1995 +0000 +++ b/liboctave/CMatrix.cc Sun Oct 08 00:11:52 1995 +0000 @@ -817,6 +817,8 @@ ComplexMatrix ComplexMatrix::pseudo_inverse (double tol) { + ComplexMatrix retval; + ComplexSVD result (*this); DiagMatrix S = result.singular_values (); @@ -841,14 +843,16 @@ r--; if (r < 0) - return ComplexMatrix (nc, nr, 0.0); + retval = ComplexMatrix (nc, nr, 0.0); else { ComplexMatrix Ur = U.extract (0, 0, nr-1, r); DiagMatrix D = DiagMatrix (sigma.extract (0, r)) . inverse (); ComplexMatrix Vr = V.extract (0, 0, nc-1, r); - return Vr * D * Ur.hermitian (); + retval = Vr * D * Ur.hermitian (); } + + return retval; } ComplexMatrix