[Fwd: Re: Cholesky Decomposition in JAMA vs Matlab]


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



I have just read the matlab user-guide carefully and concluded that :

p = 0  in Cholesky to mean that  matrix  A is symmetric and positive 
definite which is "true" instead of being "false" (where a zero in 
matlab traditionally means "false").  So, the cholesky in JAMA has 
exactly the same output as in cholesky in Matlab, therefore my own 
question has been sorted.

Cheers,
Sione.


Sione wrote:
> Please discard my previous message as my example matrix was wrong. 
> Here is the correct codes:
>
> 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},{ -1,     2}};
>    Matrix A = new Matrix(d);
>    CholeskyDecomposition chol = new CholeskyDecomposition(A);
>    Matrix R = chol.getL();
>    System.out.println(" chol.isSPD = "+chol.isSPD());
>  }
>
> The output is :==>  "chol.isSPD = true"
>
>
> Matlab:
> ------
>
> A = [1    -1; -1     2];
> [R,p] = chol(A);
>
> The output for 'p' is :==>  p = 0
>
>
> In Matlab, anything that is zero is regarded as  false (logical 
> value), and this means that  'chol' function in matlab returns a 
> "FALSE" (ie, p=0)  that A is not symmetric and positive definite,  
> while that of  JAMA returns "TRUE".
>
> 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