commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-1176) QRDecomposition does not detect the matrix singularity
Date Thu, 04 Dec 2014 17:03:12 GMT

    [ https://issues.apache.org/jira/browse/MATH-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14234365#comment-14234365
] 

Thomas Neidhart commented on MATH-1176:
---------------------------------------

Yes, there seems to be a bug. I have compared this to octave and jama:

Octave:
{noformat}
A =

   1   2   3
   4   5   6
   7   8   9

octave:9> qr(A)
ans =

  -8.1240e+00  -9.6011e+00  -1.1078e+01
   4.9237e-01   9.0453e-01   1.8091e+00
   8.6164e-01   9.9547e-01  -8.1207e-16

octave:10> qr(transpose(A))
ans =

  -3.7417e+00  -8.5524e+00  -1.3363e+01
   5.3452e-01   1.9640e+00   3.9279e+00
   8.0178e-01   9.8869e-01  -5.3083e-16
{noformat}

Jama:
{noformat}
A.qr(): [-3.741657386773941, 1.963961012123933, -1.7763568394002505E-15]
A.transpose().qr(): [-8.12403840463596, 0.9045340337332888, 2.220446049250313E-16]
{noformat}

> QRDecomposition does not detect the matrix singularity
> ------------------------------------------------------
>
>                 Key: MATH-1176
>                 URL: https://issues.apache.org/jira/browse/MATH-1176
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.3
>            Reporter: alberto trivellato
>            Priority: Minor
>         Attachments: MATH-1176.failing.patch
>
>
> QRDecomposition fails this test. The default contructor sets the threshold=0, so we will
never have abs(Rii) <= 0
> public void testSimpleRankDeficient() throws Exception {
> 		double[][] A = new double[][] { 
> 				{ 1, 2, 3 }, 
> 				{ 4, 5, 6 },
> 				{ 7, 8, 9 }};
> 		//this matrix is singular			
> 		
> 		RealMatrix M2 = MatrixUtils.createRealMatrix(A);
> 		QRDecomposition qr2 = new QRDecomposition(M2);
> 		assertFalse(qr2.getSolver().isNonSingular());//this fails
> }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message