[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: funny behavior of the sparse
From: |
David Bateman |
Subject: |
Re: funny behavior of the sparse |
Date: |
Wed, 22 Nov 2006 15:50:36 +0100 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
David Bateman wrote:
> Yes this is strange, particularly as
>
> spinv(A')'
>
> given a correct result, and internally this is pretty much what is down
> with this case... I'll take a look, but can say when I'll get back with
> an answer..
>
>
Opps, ok I see the issue. I forgot to transpose the matrix type as well
when calling the tinverse method with a lower triangular matrix. The
attached patch should fix it..
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
*** liboctave/dSparse.cc.~1.28.~ 2006-07-16 09:48:19.000000000 +0200
--- liboctave/dSparse.cc 2006-11-22 14:22:42.112214824 +0100
***************
*** 1049,1055 ****
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);
else if (typ != MatrixType::Rectangular)
{
if (mattype.is_hermitian())
--- 1049,1058 ----
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)
! {
! MatrixType newtype = mattype.transpose();
! ret = transpose().tinverse (newtype, info, rcond, true, calc_cond);
! }
else if (typ != MatrixType::Rectangular)
{
if (mattype.is_hermitian())
*** liboctave/CSparse.cc.~1.30.~ 2006-10-18 04:56:22.000000000 +0200
--- liboctave/CSparse.cc 2006-11-22 14:23:06.275992645 +0100
***************
*** 973,979 ****
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);
else if (typ != MatrixType::Rectangular)
{
if (mattype.is_hermitian())
--- 973,982 ----
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)
! {
! MatrixType newtype = mattype.transpose();
! ret = transpose().tinverse (newtype, info, rcond, true, calc_cond);
! }
else if (typ != MatrixType::Rectangular)
{
if (mattype.is_hermitian())
2006-11-22 David Bateman <address@hidden>
* dSparse.cc (SparseMatrix SparseMatrix::inverse(...)): Transpose
the matrix type as well when calling tinverse for lower triangular
matrices
* CSparse.cc (SparseComplexMatrix SparseComplexMatrix::inverse(...)):
ditto.