[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: sparse symmetric matrices

**From**: |
David Bateman |

**Subject**: |
Re: sparse symmetric matrices |

**Date**: |
Sun, 12 Jun 2011 09:44:15 +0200 |

**User-agent**: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 |

On 06/11/2011 09:38 PM, Bill Greene wrote:
>* I guess I should have mentioned that I did try:*
>* *
>* u = ks \ b'*
>* *
>* This returns an incorrect solution, u.*
>* I also tried to let chol() compute a permutation*
>* [lt, err, p] = chol(ks, 'vector');*
>* and this results in an incorrect solution, also.*
>* *
>* I'm guessing all of these errors are related: I'm*
>* creating only the upper triangle and, when permuted,*
>* entries end up in both triangles.*
>* *
>* I'm hoping someone has a good strategy for dealing with*
>* this.*
>* *
>* Bill*
>* *
Because Octave is recognising that the matrix is upper triangular and
treating it as such, even though the choloesky only uses the upper
triangular part of the matrix. I only see one solution
Tell Octave that the matrix is positive definite rather than upper
triangular. cf
octave:1> n = 1000; d = 0.1; a = sprand(n,n,d); s0 = matrix_type(a *
a',"positive definite"); x = rand(n,1); y0 = s0 \ x; s1 =
matrix_type(triu(s0), "positive definite"); y1 = s1 \ x; norm(y1 - y0)
ans = 0
D.