# HG changeset patch # User dbateman # Date 1164221847 0 # Node ID da5a11b3d13e3a713161661e257f2b67ee0f57e7 # Parent e96d66e0d634d34cacb41a74c5cf7e1ce8bc9b5f [project @ 2006-11-22 18:57:26 by dbateman] diff -r e96d66e0d634 -r da5a11b3d13e liboctave/CSparse.cc --- 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()) diff -r e96d66e0d634 -r da5a11b3d13e liboctave/ChangeLog --- 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 + + * 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 * oct-env.cc (do_absolute_pathname): Undo previous change. diff -r e96d66e0d634 -r da5a11b3d13e liboctave/dSparse.cc --- 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())