changeset 1549:d1fe5918e16b

[project @ 1995-10-08 00:11:52 by jwe]
author jwe
date Sun, 08 Oct 1995 00:11:52 +0000
parents 3c89376f951f
children d89532de8e72
files liboctave/CMatrix.cc
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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