[Fwd: Cholesky Decomposition in JAMA vs Matlab]


Sender: Sione <sionep@xtra.co.nz>
Subject: Cholesky Decomposition in JAMA vs Matlab


Hi All,

Does anyone know why the following output in JAMA is different from that in Matlab for cholesky decomposition?

JAMA:
----
public static void main(String[] args){
     double[][] d = {{1,    -1},{ 0,     1}};
     Matrix A = new Matrix(d);
     CholeskyDecomposition chol = new CholeskyDecomposition(A,true);
     Matrix R = chol.getLR();
     System.out.println(" chol.isSPD = "+chol.isSPD());
   }

The output is :==>  "chol.isSPD = false"


Matlab:
------

A = [1    -1; 0     1];
[R,p] = chol(A);

The output for 'p' is :==>  p = 2


In Matlab, anything that is non-zero is regarded as true (logical value), and this means that  'chol' function in matlab returns a "TRUE"  that A is symmetric and positive definite,  while that of  JAMA returns "FALSE". 


Is my interpretation of both the outputs in JAMA vs Matlab is correct here, that they are different for the same matrix A?

Any hint (perhaps from Cleve Moler) would be appreciated.

Cheers,
Sione.







Date Index | Thread Index | Problems or questions? Contact list-master@nist.gov