[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: solving triadiagonal (and banded in general) systems of linear equat
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: solving triadiagonal (and banded in general) systems of linear equations |
Date: |
Thu, 27 Sep 2012 09:12:24 -0400 |
On 26 September 2012 18:48, Sergei Steshenko <address@hidden> wrote:
> So, do I understand it correctly, that I simply need to provide
> matrix to the solver, and it will detect automatically that the
> matrix is banded and choose the most optimal algorithm ?
http://hg.savannah.gnu.org/hgweb/octave/file/46dd555edd33/liboctave/array/MatrixType.cc#l268
Note that the argument for this function is a sparse matrix, so the
check only occurs for sparse matrices. For full matrices the check is
http://hg.savannah.gnu.org/hgweb/octave/file/46dd555edd33/liboctave/array/MatrixType.cc#l60
only upper, lower, and hermitian matrices. No bandedness is checked if
the matrix isn't of sparse type. This is consistent with the
documentation:
octave:1> x = toeplitz ([1 2 0 0 0 0]); y = toeplitz ([1 2 3 0 0 0]);
octave:2> matrix_type (x), matrix_type (y)
ans = Full
ans = Full
octave:3> matrix_type (sparse (x)), matrix_type (sparse (y))
ans = Tridiagonal
ans = Banded
HTH,
- Jordi G. H.