help-octave
[Top][All Lists]
Advanced

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

Re: tridiagonal matrix solver


From: Jordi Gutiérrez Hermoso
Subject: Re: tridiagonal matrix solver
Date: Fri, 7 Oct 2011 10:15:25 -0500

On 7 October 2011 10:08, Juan Pablo Carbajal <address@hidden> wrote:
> On Fri, Oct 7, 2011 at 8:40 AM, asha g <address@hidden> wrote:
> In the same level of details of your question:
>
> Use sparse representation and inv
>> M = sparse(N,N);
> ...
> **here you assemble your matrix**
> ...
>> x = inv(M)*r

That computes the inverse, which is seldom sparse, and then multiplies
by it. Write "x = M\r" instead in order to avoid potentially running
out of memory.

Also, it may be better to build the sparse matrix by the S = sparse(i,
j, v, m, n) form of the function call instead.

Asha, Octave's sparse soler automatically recognises tridiagonal systems:

    
http://www.gnu.org/software/octave/doc/interpreter/Sparse-Linear-Algebra.html#Sparse-Linear-Algebra

HTH
- Jordi G. H.


reply via email to

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