help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sparse matrix improvements in 2.9.x


From: David Bateman
Subject: Re: sparse matrix improvements in 2.9.x
Date: Sat, 10 Jun 2006 09:01:50 +0200
User-agent: Mozilla Thunderbird 1.0.6-7.6.20060mdk (X11/20050322)

Shai Ayal wrote:
> Hi all,
> 
> I have to invert a sparse matrix using the "\" operator. This matrix is 
> the result of a discretization of a Poisson equation using finite 
> differencing. When I increase the resolution of the discretization above 
> a certain threshold the inversion stops to work. I can currently invert 
> a ~200x200 matrix, but not 300x300 derived from the same physical 
> problem (i.e. I just decrease the cell size). I am almost sure this is 
> not a memory problem (I have 1GB ram). So this is probably a numerical 
> problem. It might be something in my discretization code, or in the 
> inversion code.
> 
> I am currently using 2.1.72 with octave-forge. Should I upgrade to 
> 2.9.x? Is the sparse inversion there "better" in that it tries to do 
> some clever decompositions (like matlab)?
> 
> Shai

I hope you don't mean invert as a sparse inversion is generally full.
The "\" operator in 2.9.x is pretty much like that in matlab and does

  1. If the matrix is diagonal, solve directly and goto 8

  2. If the matrix is a permuted diagonal, solve directly taking into
     account the permutations. Goto 8

  3. If the matrix is square, banded and if the band density is less
     than that given by `spparms ("bandden")' continue, else goto 4.

       a. If the matrix is tridiagonal and the right-hand side is not
          sparse continue, else goto 3b.

            1. If the matrix is hermitian, with a positive real
               diagonal, attempt       Cholesky factorization using
               LAPACK xPTSV.

            2. If the above failed or the matrix is not hermitian with
               a positive       real diagonal use Gaussian elimination
               with pivoting using       LAPACK xGTSV, and goto 8.

       b. If the matrix is hermitian with a positive real diagonal,
          attempt       Cholesky factorization using LAPACK xPBTRF.

       c. if the above failed or the matrix is not hermitian with a
          positive       real diagonal use Gaussian elimination with
          pivoting using       LAPACK xGBTRF, and goto 8.

  4. If the matrix is upper or lower triangular perform a sparse forward
     or backward substitution, and goto 8

  5. If the matrix is a upper triangular matrix with column permutations
     or lower triangular matrix with row permutations, perform a sparse
     forward or backward substitution, and goto 8

  6. If the matrix is square, hermitian with a real positive diagonal,
     attempt sparse Cholesky factorization using CHOLMOD.

  7. If the sparse Cholesky factorization failed or the matrix is not
     hermitian with a real positive diagonal, and the matrix is square,
     factorize using UMFPACK.

  8. If the matrix is not square, or any of the previous solvers flags
     a singular or near singular matrix, find a minimum norm solution
     using CXSPARSE(1).


You are probably having problems with SuperLU with 2.1 and they will go
away with 2.9. Note that you need to install UFSparse to get the full
benefits of the above, otherwise large parts are deactivated

D.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]