changeset 6185:da5a11b3d13e

[project @ 2006-11-22 18:57:26 by dbateman]
author dbateman
date Wed, 22 Nov 2006 18:57:27 +0000
parents e96d66e0d634
children 237a7f535bbc
files liboctave/CSparse.cc liboctave/ChangeLog liboctave/dSparse.cc
diffstat 3 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/CSparse.cc	Tue Nov 21 19:14:14 2006 +0000
+++ b/liboctave/CSparse.cc	Wed Nov 22 18:57:27 2006 +0000
@@ -973,7 +973,10 @@
   else if (typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper)
     ret = tinverse (mattype, info, rcond, true, calc_cond).transpose();
   else if (typ == MatrixType::Lower || typ == MatrixType::Permuted_Lower)
-    ret = transpose().tinverse (mattype, info, rcond, true, calc_cond);
+    { 
+      MatrixType newtype = mattype.transpose();
+      ret = transpose().tinverse (newtype, info, rcond, true, calc_cond);
+    }
   else if (typ != MatrixType::Rectangular)
     {
       if (mattype.is_hermitian())
--- a/liboctave/ChangeLog	Tue Nov 21 19:14:14 2006 +0000
+++ b/liboctave/ChangeLog	Wed Nov 22 18:57:27 2006 +0000
@@ -1,3 +1,12 @@
+2006-11-22  David Bateman  <dbateman@free.fr>
+
+        * dSparse.cc (SparseMatrix SparseMatrix::inverse(...)): Transpose
+	the matrix type as well when calling tinverse for lower
+	triangular
+	matrices
+        * CSparse.cc (SparseComplexMatrix SparseComplexMatrix::inverse(...)):
+        ditto.
+					
 2006-11-21  John W. Eaton  <jwe@octave.org>
 
 	* oct-env.cc (do_absolute_pathname): Undo previous change.
--- a/liboctave/dSparse.cc	Tue Nov 21 19:14:14 2006 +0000
+++ b/liboctave/dSparse.cc	Wed Nov 22 18:57:27 2006 +0000
@@ -1049,7 +1049,10 @@
   else if (typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper)
     ret = tinverse (mattype, info, rcond, true, calc_cond).transpose();
   else if (typ == MatrixType::Lower || typ == MatrixType::Permuted_Lower)
-    ret = transpose().tinverse (mattype, info, rcond, true, calc_cond);
+    {
+      MatrixType newtype = mattype.transpose();
+      ret = transpose().tinverse (newtype, info, rcond, true, calc_cond);
+    }
   else if (typ != MatrixType::Rectangular)
     {
       if (mattype.is_hermitian())