changeset 1656:5a8ad3d12304

[project @ 1995-12-20 10:58:39 by jwe]
author jwe
date Wed, 20 Dec 1995 11:02:49 +0000
parents 593fff2e7e39
children 67678f04b8ba
files liboctave/CMatrix.cc liboctave/CMatrix.h liboctave/dMatrix.cc liboctave/dMatrix.h src/inv.cc src/xpow.cc
diffstat 6 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/CMatrix.cc	Wed Dec 20 10:53:00 1995 +0000
+++ b/liboctave/CMatrix.cc	Wed Dec 20 11:02:49 1995 +0000
@@ -774,7 +774,7 @@
 }
 
 ComplexMatrix
-ComplexMatrix::inverse (int& info, double& rcond) const
+ComplexMatrix::inverse (int& info, double& rcond, int force) const
 {
   int nr = rows ();
   int nc = cols ();
@@ -794,7 +794,7 @@
   F77_FCN (zgeco, ZGECO) (tmp_data, nr, nc, ipvt, rcond, z);
 
   volatile double rcond_plus_one = rcond + 1.0;
-  if (rcond_plus_one == 1.0)
+  if (rcond_plus_one == 1.0 && ! force)
     {
       info = -1;
       copy (tmp_data, data (), len);  // Restore contents.
--- a/liboctave/CMatrix.h	Wed Dec 20 10:53:00 1995 +0000
+++ b/liboctave/CMatrix.h	Wed Dec 20 11:02:49 1995 +0000
@@ -124,7 +124,7 @@
 
   ComplexMatrix inverse (void) const;
   ComplexMatrix inverse (int& info) const;
-  ComplexMatrix inverse (int& info, double& rcond) const;
+  ComplexMatrix inverse (int& info, double& rcond, int force = 0) const;
 
   ComplexMatrix pseudo_inverse (double tol = 0.0);
 
--- a/liboctave/dMatrix.cc	Wed Dec 20 10:53:00 1995 +0000
+++ b/liboctave/dMatrix.cc	Wed Dec 20 11:02:49 1995 +0000
@@ -503,7 +503,7 @@
 }
 
 Matrix
-Matrix::inverse (int& info, double& rcond) const
+Matrix::inverse (int& info, double& rcond, int force) const
 {
   int nr = rows ();
   int nc = cols ();
@@ -523,7 +523,7 @@
   F77_FCN (dgeco, DGECO) (tmp_data, nr, nc, ipvt, rcond, z);
 
   volatile double rcond_plus_one = rcond + 1.0;
-  if (rcond_plus_one == 1.0)
+  if (rcond_plus_one == 1.0 && ! force)
     {
       info = -1;
       copy (tmp_data, data (), len);  // Restore matrix contents.
--- a/liboctave/dMatrix.h	Wed Dec 20 10:53:00 1995 +0000
+++ b/liboctave/dMatrix.h	Wed Dec 20 11:02:49 1995 +0000
@@ -108,7 +108,7 @@
 
   Matrix inverse (void) const;
   Matrix inverse (int& info) const;
-  Matrix inverse (int& info, double& rcond) const;
+  Matrix inverse (int& info, double& rcond, int force = 0) const;
 
   Matrix pseudo_inverse (double tol = 0.0);
 
--- a/src/inv.cc	Wed Dec 20 10:53:00 1995 +0000
+++ b/src/inv.cc	Wed Dec 20 11:02:49 1995 +0000
@@ -76,7 +76,7 @@
 	  int info;
 	  double rcond = 0.0;
 
-	  retval = m.inverse (info, rcond);
+	  retval = m.inverse (info, rcond, 1);
 
 	  if (info == -1)
 	    warning ("inverse: matrix singular to machine precision,\
@@ -92,7 +92,7 @@
 	  int info;
 	  double rcond = 0.0;
 
-	  retval = m.inverse (info, rcond);
+	  retval = m.inverse (info, rcond, 1);
 
 	  if (info == -1)
 	    warning ("inverse: matrix singular to machine precision,\
--- a/src/xpow.cc	Wed Dec 20 10:53:00 1995 +0000
+++ b/src/xpow.cc	Wed Dec 20 11:02:49 1995 +0000
@@ -206,7 +206,7 @@
 		  int info;
 		  double rcond = 0.0;
 
-		  atmp = a.inverse (info, rcond);
+		  atmp = a.inverse (info, rcond, 1);
 
 		  if (info == -1)
 		    warning ("inverse: matrix singular to machine\
@@ -399,7 +399,7 @@
 		  int info;
 		  double rcond = 0.0;
 
-		  atmp = a.inverse (info, rcond);
+		  atmp = a.inverse (info, rcond, 1);
 
 		  if (info == -1)
 		    warning ("inverse: matrix singular to machine\